Add jetpack compose to sample app

Summary: Add an entry to the sample app to showcase Jetpack compose support. Note that you need to enable View Attribute Debugging in the Android Debug settings for this to work.

Reviewed By: lblasa

Differential Revision: D46933645

fbshipit-source-id: fbe2ddd50ef0e7917ef873959db5b3f35b833cf0
This commit is contained in:
Pascal Hartig
2023-06-23 14:42:14 -07:00
committed by Facebook GitHub Bot
parent ad25c2468d
commit 820cf6a75e
5 changed files with 80 additions and 6 deletions

View File

@@ -5,7 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
namespace 'com.facebook.flipper.sample'
@@ -36,9 +39,16 @@ android {
}
}
compileOptions {
targetCompatibility rootProject.javaTargetVersion
sourceCompatibility rootProject.javaTargetVersion
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.6"
}
kotlinOptions {
jvmTarget = "1.8"
}
packagingOptions {
@@ -61,9 +71,18 @@ dependencies {
implementation deps.lithoWidget
implementation deps.lithoAnnotations
implementation deps.lithoFresco
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
annotationProcessor deps.lithoProcessor
// Compose
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.activity:activity-ktx:1.7.2'
implementation 'androidx.compose.runtime:runtime:1.4.3'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation 'androidx.compose.ui:ui:1.4.3'
implementation 'androidx.compose.material3:material3:1.1.1'
implementation 'androidx.compose.ui:ui-tooling:1.4.3'
implementation 'androidx.compose.ui:ui-tooling-preview:1.4.3'
// Third-party
implementation deps.soloader
implementation deps.okhttp3
@@ -83,5 +102,6 @@ dependencies {
debugImplementation project(':android')
debugImplementation project(':network-plugin')
debugImplementation project(':litho-plugin')
debugImplementation project(':jetpack-compose-plugin')
releaseImplementation project(':noop')
}