Merge: Android: import the R class
authorJean Privat <jean@pryen.org>
Wed, 3 Aug 2016 16:38:33 +0000 (12:38 -0400)
committerJean Privat <jean@pryen.org>
Wed, 3 Aug 2016 16:38:33 +0000 (12:38 -0400)
commit3a6c485eafaf3e9429b7d1ae69e4c669f76b4cb9
treea357bfa9ac3295c60c8b508677697a2c53bbcc9d
parent04e5f059e87b1bd9f99c1a3b36e1e9d3072ee62e
parent5bba42d4ae6027fb587107cda03ef3ab8bf5ef27
Merge: Android: import the R class

The R class is generated by the Android toolchain and acts as a static way to identify resources in Java code. The ID of each values from the `android/res` folder is sorted in a category and accessible through a static field. An example of a generated R class is shown at the bottom of this description.

This PR import the R class in all Java classes generated from the Java FFI. This creates a similar effect as having the R class in the same package. Previously, the user could not reliably import the R class manually as the package name changes between the debug and release version.

~~~
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package net.xymus.benitlux_debug;

public final class R {
    public static final class attr {
    }
    public static final class color {
        public static final int item_background=0x7f050000;
    }
    public static final class drawable {
        public static final int ic_launcher=0x7f020000;
        public static final int icon=0x7f020001;
        public static final int notif=0x7f020002;
    }
    public static final class layout {
        public static final int main=0x7f030000;
    }
    public static final class string {
        public static final int app_name=0x7f040000;
    }
}

~~~

Pull-Request: #2227
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>