Getting Started
- Gradel/Java
- Gradel/Kotlin
- Buck/Java
- Testing/Java
- Testing/Kotlin
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 {// ...// Lithoimplementation 'com.facebook.litho:litho-core:0.36.0'implementation 'com.facebook.litho:litho-widget:0.36.0'annotationProcessor 'com.facebook.litho:litho-processor:0.36.0'// SoLoaderimplementation 'com.facebook.soloader:soloader:0.9.0'// For integration with Frescoimplementation 'com.facebook.litho:litho-fresco:0.36.0'// For testingtestImplementation 'com.facebook.litho:litho-testing:0.36.0'}
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 {// Sectionsimplementation 'com.facebook.litho:litho-sections-core:0.36.0'implementation 'com.facebook.litho:litho-sections-widget:0.36.0'compileOnly 'com.facebook.litho:litho-sections-annotations:0.36.0'annotationProcessor 'com.facebook.litho:litho-sections-processor:0.36.0'}
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 {// ...// Lithoimplementation 'com.facebook.litho:litho-core:0.36.1-SNAPSHOT'implementation 'com.facebook.litho:litho-widget:0.36.1-SNAPSHOT'annotationProcessor 'com.facebook.litho:litho-processor:0.36.1-SNAPSHOT'// SoLoaderimplementation 'com.facebook.soloader:soloader:0.9.0'// For integration with Frescoimplementation 'com.facebook.litho:litho-fresco:0.36.1-SNAPSHOT'// For testingtestImplementation 'com.facebook.litho:litho-testing:0.36.1-SNAPSHOT'}