Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compose/snippets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ dependencies {
implementation(libs.androidx.emoji2.views)
implementation(libs.androidx.lifecycle.runtime.compose)

implementation(libs.androidx.fragment.compose)
implementation(libs.androidx.fragment.ktx)
implementation(libs.androidx.coordinator.layout)
implementation(libs.google.android.material)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.viewinterop.AndroidView
import androidx.compose.ui.viewinterop.AndroidViewBinding
import androidx.fragment.app.Fragment
import androidx.fragment.compose.AndroidFragment
import com.example.compose.snippets.MyActivity
import com.example.compose.snippets.R
import com.example.compose.snippets.databinding.ExampleLayoutBinding
import com.example.compose.snippets.databinding.FragmentExampleBinding
import com.example.compose.snippets.databinding.MyFragmentLayoutBinding

// [START android_compose_interop_apis_compose_in_views]
class ExampleActivity : ComponentActivity() {
Expand Down Expand Up @@ -272,10 +272,7 @@ fun AndroidViewBindingExample() {
// [START android_compose_interop_apis_fragments_in_compose]
@Composable
fun FragmentInComposeExample() {
AndroidViewBinding(MyFragmentLayoutBinding::inflate) {
val myFragment = fragmentContainerView.getFragment<MyFragment>()
// ...
}
AndroidFragment<MyFragment>()
}

// [START_EXCLUDE silent]
Expand Down
23 changes: 0 additions & 23 deletions compose/snippets/src/main/res/layout/my_fragment_layout.xml

This file was deleted.

5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ androidx-corektx = "1.17.0"
androidx-credentials = "1.6.0-beta03"
androidx-credentials-play-services-auth = "1.6.0-beta03"
androidx-emoji2-views = "1.6.0"
androidx-fragment-ktx = "1.8.9"
androidx-fragment = "1.8.9"
androidx-glance-appwidget = "1.1.1"
androidx-lifecycle-compose = "2.9.4"
androidx-lifecycle-runtime-compose = "2.9.4"
Expand Down Expand Up @@ -141,7 +141,8 @@ androidx-datastore-preferences-core = { group = "androidx.datastore", name = "da
androidx-datastore-preferences-rxjava2 = { module = "androidx.datastore:datastore-preferences-rxjava2", version.ref = "datastorePreferencesRxjava2" }
androidx-datastore-preferences-rxjava3 = { module = "androidx.datastore:datastore-preferences-rxjava3", version.ref = "datastorePreferencesRxjava3" }
androidx-emoji2-views = { module = "androidx.emoji2:emoji2-views", version.ref = "androidx-emoji2-views" }
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment-ktx" }
androidx-fragment-compose = { module = "androidx.fragment:fragment-compose", version.ref = "androidx-fragment" }
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" }
androidx-glance-appwidget = { module = "androidx.glance:glance-appwidget", version.ref = "androidx-glance-appwidget" }
androidx-glance-appwidget-testing = { module = "androidx.glance:glance-appwidget-testing", version.ref = "androidx-glance-appwidget" }
androidx-glance-material3 = { module = "androidx.glance:glance-material3", version.ref = "androidx-glance-appwidget" }
Expand Down