GitXplorerGitXplorer
f

litho

public
7688 stars
761 forks
89 issues

Commits

List of commits on branch master.
Unverified
105106a78d8ebc812285fdf2d163b9d73e8a9a92

fbandroid/libraries/components/litho-instrumentation-tests/src/main/java/com/facebook/litho/sections/treeprops/TopDiffingGroupSectionSpec.java

committed 4 hours ago
Unverified
df7506ee552b1244c69f1af4206b4045452ebfef

fbandroid/libraries/components/litho-intellij-plugin/src/main/java/com/facebook/litho/intellij/completion/FromParameterProvider.java

committed 4 hours ago
Unverified
234e46b0b9265f5a7919c77eddb7a4e21420a30a

fbandroid/libraries/components/litho-intellij-plugin/src/main/java/com/facebook/litho/intellij/completion/MethodGenerateHandler.java

committed 9 hours ago
Unverified
53f0a8f70fe60ff1472b206e0367e84d2fa54137

fbandroid/libraries/components/litho-intellij-plugin/src/main/java/com/facebook/litho/intellij/completion/LayoutSpecMethodParameterAnnotationsContributor.java

committed 9 hours ago
Unverified
ed705ee1aee3ecebfe39895c101b993e45fdbfbd

fbandroid/libraries/components/litho-intellij-plugin/src/main/java/com/facebook/litho/intellij/extensions/TemplateProvider.java

committed 9 hours ago
Unverified
54aaab19bc3dec15b559b8858346f40f51b547f9

fbandroid/libraries/components/litho-intellij-plugin/src/main/java/com/facebook/litho/intellij/actions/templates/LithoTemplateActionGroup.java

committed 9 hours ago

README

The README file for this repository.

Litho GithubCI Bintray Join the chat at https://gitter.im/facebook/litho License

Litho is a declarative framework for building efficient UIs on Android.

  • Declarative: Litho uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of immutable inputs and the framework takes care of the rest.
  • Asynchronous layout: Litho can measure and layout your UI ahead of time without blocking the UI thread.
  • View flattening: Litho uses Yoga for layout and automatically reduces the number of ViewGroups that your UI contains.
  • Fine-grained recycling: Any component such as a text or image can be recycled and reused anywhere in the UI.

To get started, check out these links:

Installation

Litho can be integrated either in Gradle or Buck projects. Read our Getting Started guide for installation instructions.

Quick start

1. Initialize SoLoader in your Application class.

public class SampleApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, false);
  }
}

2. Create and display a component in your Activity

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final ComponentContext c = new ComponentContext(this);

    final Component component = Text.create(c)
        .text("Hello World")
        .textSizeDip(50)
        .build();

    setContentView(LithoView.create(c, component));
}

Run sample

You can find more examples in our sample app.

To build and run (on an attached device/emulator) the sample app, execute

$ buck fetch sample
$ buck install -r sample

or, if you prefer Gradle,

$ ./gradlew :sample:installDebug

Contributing

Before contributing to Litho, please first read the Code of Conduct that we expect project participants to adhere to.

For pull requests, please see our CONTRIBUTING guide.

See our issues page for ideas on how to contribute or to let us know of any problems.

Please also read our Coding Style and Code of Conduct before you contribute.

Getting Help

  • Post on StackOverflow using the #litho tag.
  • Chat with us on Gitter.
  • Join our Facebook Group to stay up-to-date with announcements.
  • Please open GitHub issues only if you suspect a bug in the framework or have a feature request and not for general questions.

License

Litho is licensed under the Apache 2.0 License.