Skip to content

Commit e766b8d

Browse files
authored
Merge pull request #306 from antonshilov/material3
Migrate sample apps to Material3
2 parents 7b502eb + 9992041 commit e766b8d

59 files changed

Lines changed: 183 additions & 186 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
3535
compose-animation-core = { module = "androidx.compose.animation:animation-core", version.ref = "compose" }
3636
compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "compose" }
3737
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
38-
compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
38+
compose-material = "androidx.compose.material3:material3:1.0.1"
3939
compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
4040
compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
4141
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }

samples/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android {
1010
compileSdk = libs.versions.androidCompileSdk.get().toInt()
1111

1212
defaultConfig {
13-
applicationId = "com.bumble.appyx"
13+
applicationId = "com.bumble.appyx.samples"
1414
minSdk = libs.versions.androidMinSdk.get().toInt()
1515
targetSdk = libs.versions.androidTargetSdk.get().toInt()
1616
versionCode = 1

samples/app/src/main/kotlin/com/bumble/appyx/app/MainActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import android.os.Bundle
44
import androidx.activity.compose.setContent
55
import androidx.compose.animation.ExperimentalAnimationApi
66
import androidx.compose.foundation.layout.Column
7-
import androidx.compose.material.MaterialTheme
8-
import androidx.compose.material.Surface
7+
import androidx.compose.material3.MaterialTheme
8+
import androidx.compose.material3.Surface
99
import androidx.compose.runtime.Composable
1010
import androidx.compose.ui.ExperimentalComposeUiApi
1111
import androidx.compose.ui.tooling.preview.Preview
@@ -28,7 +28,7 @@ class MainActivity : NodeActivity() {
2828
setContent {
2929
AppyxSampleAppTheme {
3030
// A surface container using the 'background' color from the theme
31-
Surface(color = MaterialTheme.colors.background) {
31+
Surface(color = MaterialTheme.colorScheme.background) {
3232
Column {
3333
NodeHost(integrationPoint = appyxIntegrationPoint) {
3434
SamplesContainerNode(buildContext = it)

samples/app/src/main/kotlin/com/bumble/appyx/app/composable/Page.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import androidx.compose.foundation.layout.height
1010
import androidx.compose.foundation.layout.padding
1111
import androidx.compose.foundation.rememberScrollState
1212
import androidx.compose.foundation.verticalScroll
13-
import androidx.compose.material.MaterialTheme
14-
import androidx.compose.material.Text
13+
import androidx.compose.material3.MaterialTheme
14+
import androidx.compose.material3.Text
1515
import androidx.compose.runtime.Composable
1616
import androidx.compose.ui.Modifier
1717
import androidx.compose.ui.unit.ExperimentalUnitApi
@@ -52,7 +52,7 @@ fun Page(
5252
) {
5353
Text(
5454
text = title,
55-
style = MaterialTheme.typography.h4,
55+
style = MaterialTheme.typography.headlineMedium,
5656
modifier = Modifier
5757
.fillMaxWidth()
5858
.padding(bottom = 8.dp)
@@ -63,7 +63,7 @@ fun Page(
6363
) {
6464
Text(
6565
text = body,
66-
style = MaterialTheme.typography.body1.copy(
66+
style = MaterialTheme.typography.bodyLarge.copy(
6767
lineHeight = TextUnit(1.5f, TextUnitType.Em)
6868
)
6969
)

samples/app/src/main/kotlin/com/bumble/appyx/app/composable/graph/Tree.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import androidx.compose.foundation.layout.Row
99
import androidx.compose.foundation.layout.fillMaxWidth
1010
import androidx.compose.foundation.layout.height
1111
import androidx.compose.foundation.layout.width
12-
import androidx.compose.material.MaterialTheme
12+
import androidx.compose.material3.MaterialTheme
1313
import androidx.compose.runtime.Composable
1414
import androidx.compose.runtime.mutableStateMapOf
1515
import androidx.compose.runtime.mutableStateOf
@@ -39,7 +39,7 @@ fun Tree(
3939
idx: Int = 0,
4040
gapHeight: Dp = 40.dp,
4141
lineColor: Color = if (isSystemInDarkTheme()) Color.Black else Color(0xFFDDDDDD),
42-
activeLineColor: Color = MaterialTheme.colors.primary,
42+
activeLineColor: Color = MaterialTheme.colorScheme.primary,
4343
strokeWidth: Float = 7f,
4444
) {
4545
val children = graphNode.children()

samples/app/src/main/kotlin/com/bumble/appyx/app/composable/graph/nodeimpl/SimpleGraphNode.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import androidx.compose.foundation.layout.fillMaxSize
77
import androidx.compose.foundation.layout.padding
88
import androidx.compose.foundation.layout.wrapContentSize
99
import androidx.compose.foundation.shape.RoundedCornerShape
10-
import androidx.compose.material.MaterialTheme
11-
import androidx.compose.material.Text
10+
import androidx.compose.material3.MaterialTheme
11+
import androidx.compose.material3.Text
1212
import androidx.compose.runtime.Composable
1313
import androidx.compose.runtime.MutableState
1414
import androidx.compose.runtime.getValue
@@ -77,7 +77,7 @@ class SimpleGraphNode(
7777
.wrapContentSize()
7878
.padding(start = horizontalPadding, end = horizontalPadding)
7979
.background(
80-
color = MaterialTheme.colors.surface,
80+
color = MaterialTheme.colorScheme.surface,
8181
shape = RoundedCornerShape(cornerRadius)
8282
)
8383
.alpha(alpha)
@@ -91,7 +91,7 @@ class SimpleGraphNode(
9191
text = label,
9292
modifier = Modifier.align(Alignment.Center),
9393
color = Color.Black,
94-
style = MaterialTheme.typography.caption
94+
style = MaterialTheme.typography.bodySmall
9595
)
9696
}
9797
}

samples/app/src/main/kotlin/com/bumble/appyx/app/composable/graph/nodeimpl/TestImpl.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.Box
55
import androidx.compose.foundation.layout.padding
66
import androidx.compose.foundation.layout.size
77
import androidx.compose.foundation.shape.RoundedCornerShape
8-
import androidx.compose.material.MaterialTheme
8+
import androidx.compose.material3.MaterialTheme
99
import androidx.compose.runtime.Composable
1010
import androidx.compose.runtime.MutableState
1111
import androidx.compose.runtime.mutableStateOf
@@ -79,10 +79,10 @@ class TestImpl(
7979
)
8080
.padding(4.dp)
8181
) {
82-
androidx.compose.material.Text(
82+
androidx.compose.material3.Text(
8383
text = "$id",
8484
modifier = Modifier.align(Alignment.Center),
85-
style = MaterialTheme.typography.caption
85+
style = MaterialTheme.typography.bodySmall
8686
)
8787
}
8888
}

samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/InsideTheBackStack.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import androidx.compose.foundation.layout.Spacer
99
import androidx.compose.foundation.layout.fillMaxSize
1010
import androidx.compose.foundation.layout.fillMaxWidth
1111
import androidx.compose.foundation.layout.padding
12-
import androidx.compose.material.MaterialTheme
13-
import androidx.compose.material.Text
12+
import androidx.compose.material3.MaterialTheme
13+
import androidx.compose.material3.Text
1414
import androidx.compose.runtime.Composable
1515
import androidx.compose.ui.Alignment
1616
import androidx.compose.ui.Modifier
@@ -77,7 +77,7 @@ class InsideTheBackStack(
7777
Box(
7878
modifier = Modifier
7979
.fillMaxSize()
80-
.background(color = MaterialTheme.colors.background)
80+
.background(color = MaterialTheme.colorScheme.background)
8181
) {
8282
Column(
8383
horizontalAlignment = Alignment.CenterHorizontally,

samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/app/ChildNode.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.Box
55
import androidx.compose.foundation.layout.fillMaxSize
66
import androidx.compose.foundation.layout.padding
77
import androidx.compose.foundation.shape.RoundedCornerShape
8-
import androidx.compose.material.Text
8+
import androidx.compose.material3.Text
99
import androidx.compose.runtime.Composable
1010
import androidx.compose.ui.Modifier
1111
import androidx.compose.ui.draw.clip

samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/app/composable/Buttons.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.bumble.appyx.app.node.backstack.app.composable
22

33
import androidx.compose.foundation.layout.padding
4-
import androidx.compose.material.Button
5-
import androidx.compose.material.ButtonDefaults
4+
import androidx.compose.material3.Button
5+
import androidx.compose.material3.ButtonDefaults
66
import androidx.compose.runtime.Composable
77
import androidx.compose.ui.Modifier
88
import androidx.compose.ui.unit.dp
@@ -19,7 +19,7 @@ fun CustomButton(
1919
modifier = modifier.padding(horizontal = 8.dp),
2020
onClick = onClick,
2121
colors = ButtonDefaults.buttonColors(
22-
backgroundColor = appyx_yellow1,
22+
containerColor = appyx_yellow1,
2323
contentColor = appyx_dark
2424
)
2525
) { content() }

0 commit comments

Comments
 (0)