Skip to content
A declarative framework for building efficient UIs on Android.
Java C++ Kotlin Starlark Shell Haskell
Branch: master
Clone or download

Latest commit

Kata Zavorotchenko and facebook-github-bot Refactored LithoPluginUtils#findGeneratedClass method
Summary: We inline #findGeneratedClass methods to be explicit with what method we are using for search.

Reviewed By: muraziz

Differential Revision: D20983734

fbshipit-source-id: f494944a4bd07769710e9946563799575630cb1c
Latest commit e18d1fd Apr 14, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Revert Circle CI config Dec 5, 2019
.github Add Github PR template Jun 17, 2019
codelabs Fix codelabs Nov 29, 2019
config Run oss tests in both release and debug mode Oct 26, 2017
docs Add info to help resolve IndexOutOfBounds in RecyclerBinder to IOOB e… Mar 13, 2020
gradle Update deps and AGP Oct 16, 2019
lib Set width/height also to Undefined when we change the measure mode to… Apr 14, 2020
litho-annotations Format all BUCK files Apr 10, 2020
litho-core-kotlin Optimize Row & Column Kotlin builders to not call method on `null` va… Apr 6, 2020
litho-core Clear ComponentTree in IncrementalMountHelper when it's being released. Apr 14, 2020
litho-espresso Format all BUCK files Apr 10, 2020
litho-fresco-kotlin Make Java fresco widget dep implicit when adding Kotlin fresco widget… Mar 23, 2020
litho-fresco Format all BUCK files Apr 10, 2020
litho-instrumentation-tests Format all BUCK files Apr 10, 2020
litho-intellij-plugin Refactored LithoPluginUtils#findGeneratedClass method Apr 14, 2020
litho-it-powermock Format all BUCK files Apr 10, 2020
litho-it-spec Format all BUCK files Apr 10, 2020
litho-it Makes LithoMountData#isViewSelected static Apr 14, 2020
litho-processor Format all BUCK files Apr 10, 2020
litho-rendercore Reorder the unbind bind calls in MountState#updateMountItemIfNeeded Apr 14, 2020
litho-sections-annotations Format all BUCK files Apr 10, 2020
litho-sections-core Format all BUCK files Apr 10, 2020
litho-sections-debug Format all BUCK files Apr 10, 2020
litho-sections-processor Format all BUCK files Apr 10, 2020
litho-sections-widget Format all BUCK files Apr 10, 2020
litho-testing Format all BUCK files Apr 10, 2020
litho-widget-kotlin Migrate Lithography app components to the new API Apr 1, 2020
litho-widget Make sure to always set text property on AccessibilityNodeInfo for Te… Apr 10, 2020
sample-barebones-kotlin add supportsRtl="true" to application manifests. (#607) Nov 4, 2019
sample-barebones Format all BUCK files Apr 10, 2020
sample-codelab Format all BUCK files Apr 10, 2020
sample-kotlin More Kotlin sample app cleanup Apr 1, 2020
sample Format all BUCK files Apr 10, 2020
scripts Update CircleCI test to use newer build SDK Feb 21, 2020
tools/build_defs/oss Add proper set of configs for AndroidX 'lifecycle-extensions' deps Mar 24, 2020
.buckconfig Update CircleCI test to use newer build SDK Feb 21, 2020
.gitignore Update .gitignore Oct 22, 2019
BUCK Format all BUCK files Apr 10, 2020
CHANGELOG.md Back out "Adds shadow offset support to CardShadowDrawable" Mar 16, 2020
CODE_OF_CONDUCT.md Adopt Contributor Covenant Aug 30, 2019
CONTRIBUTING.md Unify build depepdencies (#413) Aug 10, 2018
LICENSE Add proper attribution to license Oct 10, 2018
README.md Update docs to always refer ComponentContext as c Jan 29, 2020
THIRD_PARTY_NOTICES.txt Add THIRD_PARTY_NOTICES.txt Apr 18, 2017
build.gradle Update Components' build script to compile SDK 29 Mar 11, 2020
gradle.properties Re-enable snapshots post-release Feb 9, 2020
gradlew Update deps and AGP Oct 16, 2019
gradlew.bat Update deps and AGP Oct 16, 2019
settings.gradle InternalNode extends Node and Layout Results from render core. Jan 15, 2020

README.md

Litho CircleCI Bintray 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 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.

You can’t perform that action at this time.