Skip to content

Instantly share code, notes, and snippets.

@johncarl81
Last active May 7, 2016 16:36
Show Gist options
  • Select an option

  • Save johncarl81/7c7a134ff832b656cfe06e8c9f4ee155 to your computer and use it in GitHub Desktop.

Select an option

Save johncarl81/7c7a134ff832b656cfe06e8c9f4ee155 to your computer and use it in GitHub Desktop.
RBridge Example
// 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