Skip to content

Instantly share code, notes, and snippets.

@tatocaster
Created April 30, 2017 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatocaster/641ddf2a256e9f4d9a5959cd89db5398 to your computer and use it in GitHub Desktop.
Save tatocaster/641ddf2a256e9f4d9a5959cd89db5398 to your computer and use it in GitHub Desktop.
MyActivity Litho
public class MyActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final ComponentContext context = new ComponentContext(this);
final Component component = Text.create(context)
.text("Hello World!")
.textColor(Color.RED)
.textSizeDip(50)
.textStyle(BOLD)
.build();
setContentView(LithoView.create(context, component));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment