Skip to main content

Getting Started

Adding Litho to your Project​

We publish the Litho artifacts to Bintray's JCenter. To include Litho to your Android project, make sure you include the reference to the repository in your build.gradle file:

repositories {
jcenter()
}

Then add the dependencies like this:

dependencies {
// ...
// Litho
implementation 'com.facebook.litho:litho-core:0.50.2'
implementation 'com.facebook.litho:litho-widget:0.50.2'
annotationProcessor 'com.facebook.litho:litho-processor:0.50.2'
// SoLoader
implementation 'com.facebook.soloader:soloader:0.10.5'
// For integration with Fresco
implementation 'com.facebook.litho:litho-fresco:0.50.2'
// For testing
testImplementation 'com.facebook.litho:litho-testing:0.50.2'
}

Adding Sections to your Project​

Litho comes with an optional library called Sections for declaratively building lists. You can include Sections by adding the following additional dependencies to your build.gradle file:

dependencies {
// Sections
implementation 'com.facebook.litho:litho-sections-core:0.50.2'
implementation 'com.facebook.litho:litho-sections-widget:0.50.2'
compileOnly 'com.facebook.litho:litho-sections-annotations:0.50.2'
annotationProcessor 'com.facebook.litho:litho-sections-processor:0.50.2'
}

Using Snapshot releases​

caution

This will break and may set your house on fire. Snapshots are unsigned and automatically published by our CI system. Use them for testing purposes only.

First, add the Sonatype Snapshots repository to your gradle config:

repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

Then you can access the snapshot versions of all Litho artifacts that we publish:

dependencies {
// ...
// Litho
implementation 'com.facebook.litho:litho-core:0.51.0-SNAPSHOT'
implementation 'com.facebook.litho:litho-widget:0.51.0-SNAPSHOT'
annotationProcessor 'com.facebook.litho:litho-processor:0.51.0-SNAPSHOT'
// SoLoader
implementation 'com.facebook.soloader:soloader:0.10.5'
// For integration with Fresco
implementation 'com.facebook.litho:litho-fresco:0.51.0-SNAPSHOT'
// For testing
testImplementation 'com.facebook.litho:litho-testing:0.51.0-SNAPSHOT'
}