A declarative framework for building efficient UIs on Android.
Java C++ C Python Shell CMake
Latest commit f41ed81 Jun 1, 2017 @woehrl01 woehrl01 committed with facebook-github-bot Fix absolute position if wrap-reverse and align-items: flex-end
Summary:
This is a fix on top of 56b10fc. It takes the case into account were you have `wrap-reverse` and `align-items: flex-end` set.
Closes facebook/yoga#568

Differential Revision: D5155521

Pulled By: emilsjolander

fbshipit-source-id: 7e5fcfa2fbb48b6c6279da46cc648a071ff2b079
Permalink
Failed to load latest commit information.
.github Add issue template Apr 11, 2017
docs Bump snapshot version Jun 1, 2017
gradle Upgrade to Gradle 3.5 May 11, 2017
lib Fix absolute position if wrap-reverse and align-items: flex-end Jun 1, 2017
litho-annotations Support variable arguments in Litho May 20, 2017
litho-core Revert touch handling changes May 31, 2017
litho-espresso Doc fixes May 31, 2017
litho-fresco Remove redundant dependencies. Apr 24, 2017
litho-it-powermock Always hide sticky header when there are two sticky items stacked May 27, 2017
litho-it Keep List builder method for varArgs in Litho May 30, 2017
litho-processor Keep List builder method for varArgs in Litho May 30, 2017
litho-stetho DebugComponent can only mount one view OR have component children May 29, 2017
litho-stubs Fix license Apr 12, 2017
litho-testing Rename mBuilderPool -> sBuilderPool May 22, 2017
litho-widget Fix snap to center for RecyclerBinder May 30, 2017
sample-barebones Tutorial fixes Apr 18, 2017
sample Add docs for espresso testing May 31, 2017
scripts Bump build tools version May 25, 2017
.buckconfig Bump build tools version May 25, 2017
.buckjavaargs Limit memory usage for CI Apr 1, 2017
.gitignore Extend gitignore May 15, 2017
BUCK Remove references to CSSLayoutDEPRECATED Apr 13, 2017
COMPONENTS_DEFS Add separate hamcrest target May 31, 2017
CONTRIBUTING.md Lines authored by rspencer Mar 29, 2017
LICENSE Fix license Apr 12, 2017
LICENSE-examples Lines authored by rspencer Mar 29, 2017
PATENTS Lines authored by rspencer Mar 29, 2017
README.md Add gitter.im chat badge May 11, 2017
THIRD_PARTY_NOTICES.txt Add THIRD_PARTY_NOTICES.txt Apr 18, 2017
build.gradle Bump snapshot version Jun 1, 2017
circle.yml Fix CircleCI build May 26, 2017
gradle.properties Bump snapshot version Jun 1, 2017
gradlew Initial gradle build Apr 5, 2017
gradlew.bat Initial gradle build Apr 5, 2017
settings.gradle Gradle project for litho-espresso May 25, 2017

README.md

Litho CircleCI Join the chat at https://gitter.im/facebook/litho

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 context = new ComponentContext(this);

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

    setContentView(LithoView.create(context, 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

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.

License

Litho is BSD-licensed. We also provide an additional patent grant.