Last active
May 7, 2016 16:36
-
-
Save johncarl81/7c7a134ff832b656cfe06e8c9f4ee155 to your computer and use it in GitHub Desktop.
RBridge Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Referencing the given R class kicks off the annotaion processor to generate an RBridge: | |
| @Bridge(R.class) | |
| // Input R: | |
| public final class R { | |
| public static final class layout { | |
| public static int example_layout=0x7f030000; | |
| } | |
| } | |
| // Generated: | |
| public class RBridge { | |
| public final static class layout { | |
| @RMapping(clazz = R.layout.class, name = "example_layout") | |
| public static final int example_layout=-123; | |
| } | |
| } | |
| // Usage: | |
| @Activity | |
| @Layout(RBridge.layout.example_layout) | |
| public class LibraryActivity { | |
| @OnCreate | |
| public void create(){} | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment