Skip to content
Open
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 androidapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ dependencies {
implementation(libs.activitycompose)
implementation("androidx.appcompat:appcompat:1.7.1")
implementation(project(":demo-shared"))
implementation("com.google.android.material:material:1.13.0")
}
2 changes: 2 additions & 0 deletions androidapp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name="com.dshatz.collapsingtoolbar.compat.CompatActivity" android:exported="true"
android:theme="@style/Theme.MaterialComponents.Light.NoActionBar"/>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.dshatz.collapsingtoolbar.compat

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.dshatz.collapsingtoolbar.sample.android.R

class CompatActivity: AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.compat)

val composeFragment = CompatFragment()
supportFragmentManager.beginTransaction().add(R.id.contentFrameLayout, composeFragment).commit()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.dshatz.collapsingtoolbar.compat

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import androidx.fragment.app.Fragment
import com.dshatz.collapsingtoolbar.Root
import com.dshatz.collapsingtoolbar.sample.android.R

class CompatFragment: Fragment() {

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
super.onCreateView(inflater, container, savedInstanceState)
val view = inflater.inflate(R.layout.compose, container, false)
(view as ComposeView).setContent {
Root()
}
return view
}
}
27 changes: 27 additions & 0 deletions androidapp/src/main/res/layout/compat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:id="@+id/rootLayout"
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/contentFrameLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
style="?attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/contentFrameLayout" />
</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 6 additions & 0 deletions androidapp/src/main/res/layout/compose.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.compose.ui.platform.ComposeView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.compose.ui.platform.ComposeView>
9 changes: 7 additions & 2 deletions demo-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ kotlin {
compileSdk = 36
minSdk = 23
}
js {
browser()
}
wasmJs {
browser()
}

sourceSets {
commonMain.dependencies {
implementation(project(":lib"))
implementation(compose.foundation)
implementation(compose.ui)
implementation(libs.compose.ui)
implementation(compose.material3)
implementation(compose.desktop.common)
}
jvmMain.dependencies {
implementation(compose.desktop.currentOs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import androidx.compose.ui.unit.sp


@Composable
fun Root() {
fun Root(items: Int = 20) {
MaterialTheme {
Column {
CollapsingToolbarWithTitle("Page title", expandedHeight = 130.dp, toolbarContent = { progress ->
Expand All @@ -61,12 +61,14 @@ fun Root() {
Text("Action")
}
}) {
Column(verticalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier.verticalScroll(
rememberScrollState()
)) {
(1..20).forEach {
Card(Modifier.fillMaxWidth().heightIn(min = 40.dp)) {
Text("Item $it", modifier = Modifier.padding(10.dp))
Column(Modifier.fillMaxSize()) {
Column(verticalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier.verticalScroll(
rememberScrollState()
)) {
(1..items).forEach {
Card(Modifier.fillMaxWidth().heightIn(min = 40.dp)) {
Text("Item $it", modifier = Modifier.padding(10.dp))
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ agp = "9.2.0"

[libraries]
activitycompose = { module = "androidx.activity:activity-compose", version = "1.13.0" }

compose-ui = { module = "org.jetbrains.compose.ui:ui", version = "1.11.0-beta02"}

[plugins]
mp = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Expand Down
8 changes: 8 additions & 0 deletions kotlin-js-store/wasm/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@js-joda/core@3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273"
integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg==
Loading
Loading