Skip to content

Commit e1c7af4

Browse files
authored
Merge pull request #294 from draganbjedov/update_dependencies
Updated dependencies to latest versions
2 parents b0729bd + d0989b0 commit e1c7af4

19 files changed

Lines changed: 155 additions & 96 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
.cxx
1010
local.properties
1111
.idea/jarRepositories.xml
12+
*.klib

android/build.gradle.kts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
plugins {
22
id("org.jetbrains.compose")
3+
id("org.jetbrains.kotlin.plugin.compose")
34
id("com.android.application")
45
kotlin("android")
56
}
67

78
dependencies {
89
implementation(project(":reorderable"))
9-
implementation("androidx.compose.runtime:runtime:1.3.3")
10-
implementation("androidx.compose.material:material:1.3.1")
11-
implementation("androidx.activity:activity-compose:1.6.1")
12-
implementation("com.google.android.material:material:1.8.0")
13-
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
14-
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")
15-
implementation("androidx.navigation:navigation-compose:2.5.3")
10+
implementation("androidx.compose.runtime:runtime:1.8.1")
11+
implementation("androidx.compose.material3:material3:1.3.2")
12+
implementation("androidx.activity:activity-compose:1.10.1")
13+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.0")
14+
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.9.0")
15+
implementation("androidx.navigation:navigation-compose:2.9.0")
16+
implementation("androidx.appcompat:appcompat:1.7.0")
17+
implementation("androidx.appcompat:appcompat-resources:1.7.0")
1618
implementation("io.coil-kt:coil-compose:2.2.2")
1719
}
1820

@@ -38,7 +40,7 @@ android {
3840
}
3941

4042
kotlinOptions {
41-
jvmTarget = "1.8"
43+
jvmTarget = "11"
4244
}
4345
namespace = "org.burnoutcrew.android"
44-
}
46+
}

android/src/main/kotlin/org/burnoutcrew/android/ui/Root.kt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
package org.burnoutcrew.android.ui
1717

1818
import androidx.compose.foundation.layout.padding
19-
import androidx.compose.material.BottomNavigation
20-
import androidx.compose.material.BottomNavigationItem
21-
import androidx.compose.material.Icon
22-
import androidx.compose.material.Scaffold
23-
import androidx.compose.material.Text
24-
import androidx.compose.material.TopAppBar
2519
import androidx.compose.material.icons.Icons
26-
import androidx.compose.material.icons.filled.List
20+
import androidx.compose.material.icons.automirrored.filled.List
2721
import androidx.compose.material.icons.filled.Settings
2822
import androidx.compose.material.icons.filled.Star
23+
import androidx.compose.material3.ExperimentalMaterial3Api
24+
import androidx.compose.material3.Icon
25+
import androidx.compose.material3.NavigationBar
26+
import androidx.compose.material3.NavigationBarItem
27+
import androidx.compose.material3.Scaffold
28+
import androidx.compose.material3.Text
29+
import androidx.compose.material3.TopAppBar
2930
import androidx.compose.runtime.Composable
3031
import androidx.compose.ui.Modifier
3132
import androidx.compose.ui.graphics.Color
@@ -44,6 +45,7 @@ import org.burnoutcrew.android.ui.reorderlist.ReorderList
4445
import org.burnoutcrew.android.ui.theme.ReorderListTheme
4546

4647

48+
@OptIn(ExperimentalMaterial3Api::class)
4749
@Composable
4850
fun Root() {
4951
ReorderListTheme {
@@ -87,11 +89,11 @@ private fun Navigation(navController: NavHostController, modifier: Modifier) {
8789

8890
@Composable
8991
private fun BottomNavigationBar(items: List<NavigationItem>, navController: NavController) {
90-
BottomNavigation(contentColor = Color.White) {
92+
NavigationBar (contentColor = Color.White) {
9193
val navBackStackEntry = navController.currentBackStackEntryAsState()
9294
val currentRoute = navBackStackEntry.value?.destination?.route
9395
items.forEach { item ->
94-
BottomNavigationItem(
96+
NavigationBarItem(
9597
icon = { Icon(item.icon, item.title) },
9698
label = { Text(text = item.title) },
9799
selected = currentRoute == item.route,
@@ -112,7 +114,7 @@ private fun BottomNavigationBar(items: List<NavigationItem>, navController: NavC
112114
}
113115

114116
private sealed class NavigationItem(var route: String, var icon: ImageVector, var title: String) {
115-
object Lists : NavigationItem("lists", Icons.Default.List, "Lists")
116-
object Grids : NavigationItem("grids", Icons.Default.Settings, "Grids")
117-
object Fixed : NavigationItem("fixed", Icons.Default.Star, "Fixed")
117+
data object Lists : NavigationItem("lists", Icons.AutoMirrored.Filled.List, "Lists")
118+
data object Grids : NavigationItem("grids", Icons.Default.Settings, "Grids")
119+
data object Fixed : NavigationItem("fixed", Icons.Default.Star, "Fixed")
118120
}

android/src/main/kotlin/org/burnoutcrew/android/ui/reorderlist/ReorderGrid.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import androidx.compose.foundation.lazy.grid.GridCells
2929
import androidx.compose.foundation.lazy.grid.LazyHorizontalGrid
3030
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
3131
import androidx.compose.foundation.lazy.grid.items
32-
import androidx.compose.material.MaterialTheme
33-
import androidx.compose.material.Text
32+
import androidx.compose.material3.MaterialTheme
33+
import androidx.compose.material3.Text
3434
import androidx.compose.runtime.Composable
3535
import androidx.compose.ui.Alignment
3636
import androidx.compose.ui.Modifier
@@ -78,7 +78,7 @@ private fun HorizontalGrid(
7878
modifier = Modifier
7979
.shadow(elevation.value)
8080
.aspectRatio(1f)
81-
.background(MaterialTheme.colors.secondary)
81+
.background(MaterialTheme.colorScheme.secondary)
8282
) {
8383
Text(item.title)
8484
}
@@ -107,7 +107,7 @@ private fun VerticalGrid(
107107
contentAlignment = Alignment.Center,
108108
modifier = Modifier
109109
.size(100.dp)
110-
.background(MaterialTheme.colors.surface)
110+
.background(MaterialTheme.colorScheme.surface)
111111
) {
112112
Text(item.title)
113113
}
@@ -120,7 +120,7 @@ private fun VerticalGrid(
120120
.detectReorderAfterLongPress(state)
121121
.shadow(elevation.value)
122122
.aspectRatio(1f)
123-
.background(MaterialTheme.colors.primary)
123+
.background(MaterialTheme.colorScheme.primary)
124124
) {
125125
Text(item.title)
126126
}

android/src/main/kotlin/org/burnoutcrew/android/ui/reorderlist/ReorderImageList.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ import androidx.compose.foundation.layout.padding
2828
import androidx.compose.foundation.layout.size
2929
import androidx.compose.foundation.lazy.LazyColumn
3030
import androidx.compose.foundation.lazy.items
31-
import androidx.compose.material.Divider
32-
import androidx.compose.material.MaterialTheme
33-
import androidx.compose.material.Text
31+
import androidx.compose.material3.MaterialTheme
32+
import androidx.compose.material3.Text
3433
import androidx.compose.material.icons.Icons
35-
import androidx.compose.material.icons.filled.List
34+
import androidx.compose.material.icons.automirrored.filled.List
35+
import androidx.compose.material3.HorizontalDivider
3636
import androidx.compose.runtime.Composable
3737
import androidx.compose.ui.Alignment
3838
import androidx.compose.ui.Modifier
@@ -71,14 +71,14 @@ fun ReorderImageList(
7171
modifier = Modifier
7272
.shadow(elevation.value)
7373
.fillMaxWidth()
74-
.background(MaterialTheme.colors.surface)
74+
.background(MaterialTheme.colorScheme.surface)
7575

7676
) {
7777
Row(verticalAlignment = Alignment.CenterVertically) {
7878
Image(
79-
Icons.Default.List,
79+
Icons.AutoMirrored.Filled.List,
8080
"",
81-
colorFilter = ColorFilter.tint(color = MaterialTheme.colors.onBackground),
81+
colorFilter = ColorFilter.tint(color = MaterialTheme.colorScheme.onBackground),
8282
modifier = Modifier.detectReorder(state)
8383
)
8484
Image(
@@ -91,7 +91,7 @@ fun ReorderImageList(
9191
modifier = Modifier.padding(16.dp)
9292
)
9393
}
94-
Divider()
94+
HorizontalDivider()
9595
}
9696
}
9797
}
@@ -112,7 +112,7 @@ private fun HeaderFooter(title: String, url: String) {
112112
)
113113
Text(
114114
title,
115-
style = MaterialTheme.typography.h2,
115+
style = MaterialTheme.typography.displayMedium,
116116
color = Color.White,
117117
modifier = Modifier.align(Alignment.Center)
118118
)

android/src/main/kotlin/org/burnoutcrew/android/ui/reorderlist/ReorderList.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import androidx.compose.foundation.lazy.LazyColumn
2828
import androidx.compose.foundation.lazy.LazyRow
2929
import androidx.compose.foundation.lazy.items
3030
import androidx.compose.foundation.shape.RoundedCornerShape
31-
import androidx.compose.material.Divider
32-
import androidx.compose.material.MaterialTheme
33-
import androidx.compose.material.Text
31+
import androidx.compose.material3.HorizontalDivider
32+
import androidx.compose.material3.MaterialTheme
33+
import androidx.compose.material3.Text
3434
import androidx.compose.runtime.Composable
3535
import androidx.compose.ui.Alignment
3636
import androidx.compose.ui.Modifier
@@ -86,13 +86,13 @@ private fun VerticalReorderList(
8686
.detectReorderAfterLongPress(state)
8787
.shadow(elevation.value)
8888
.fillMaxWidth()
89-
.background(MaterialTheme.colors.surface)
89+
.background(MaterialTheme.colorScheme.surface)
9090
) {
9191
Text(
9292
text = item.title,
9393
modifier = Modifier.padding(16.dp)
9494
)
95-
Divider()
95+
HorizontalDivider()
9696
}
9797
}
9898
}

android/src/main/kotlin/org/burnoutcrew/android/ui/theme/Color.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ package org.burnoutcrew.android.ui.theme
22

33
import androidx.compose.ui.graphics.Color
44

5-
val Purple200 = Color(0xFFBB86FC)
6-
val Purple500 = Color(0xFF6200EE)
7-
val Purple700 = Color(0xFF3700B3)
8-
val Teal200 = Color(0xFF03DAC5)
5+
val Purple80 = Color(0xFFD0BCFF)
6+
val PurpleGrey80 = Color(0xFFCCC2DC)
7+
val Pink80 = Color(0xFFEFB8C8)
8+
9+
val Purple40 = Color(0xFF6650a4)
10+
val PurpleGrey40 = Color(0xFF625b71)
11+
val Pink40 = Color(0xFF7D5260)

android/src/main/kotlin/org/burnoutcrew/android/ui/theme/Shape.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.burnoutcrew.android.ui.theme
22

33
import androidx.compose.foundation.shape.RoundedCornerShape
4-
import androidx.compose.material.Shapes
4+
import androidx.compose.material3.Shapes
55
import androidx.compose.ui.unit.dp
66

77
val Shapes = Shapes(

android/src/main/kotlin/org/burnoutcrew/android/ui/theme/Theme.kt

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,57 @@
11
package org.burnoutcrew.android.ui.theme
22

3+
4+
import android.os.Build
35
import androidx.compose.foundation.isSystemInDarkTheme
4-
import androidx.compose.material.MaterialTheme
5-
import androidx.compose.material.darkColors
6-
import androidx.compose.material.lightColors
6+
import androidx.compose.material3.MaterialTheme
7+
import androidx.compose.material3.darkColorScheme
8+
import androidx.compose.material3.dynamicDarkColorScheme
9+
import androidx.compose.material3.dynamicLightColorScheme
10+
import androidx.compose.material3.lightColorScheme
711
import androidx.compose.runtime.Composable
12+
import androidx.compose.ui.platform.LocalContext
813

9-
private val DarkColorPalette = darkColors(
10-
primary = Purple200,
11-
primaryVariant = Purple700,
12-
secondary = Teal200
14+
private val DarkColorScheme = darkColorScheme(
15+
primary = Purple80,
16+
secondary = PurpleGrey80,
17+
tertiary = Pink80
1318
)
1419

15-
private val LightColorPalette = lightColors(
16-
primary = Purple500,
17-
primaryVariant = Purple700,
18-
secondary = Teal200
20+
private val LightColorScheme = lightColorScheme(
21+
primary = Purple40,
22+
secondary = PurpleGrey40,
23+
tertiary = Pink40
24+
25+
/* Other default colors to override
26+
background = Color(0xFFFFFBFE),
27+
surface = Color(0xFFFFFBFE),
28+
onPrimary = Color.White,
29+
onSecondary = Color.White,
30+
onTertiary = Color.White,
31+
onBackground = Color(0xFF1C1B1F),
32+
onSurface = Color(0xFF1C1B1F),
33+
*/
1934
)
2035

2136
@Composable
22-
fun ReorderListTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
23-
val colors = if (darkTheme) {
24-
DarkColorPalette
25-
} else {
26-
LightColorPalette
37+
fun ReorderListTheme(
38+
darkTheme: Boolean = isSystemInDarkTheme(),
39+
// Dynamic color is available on Android 12+
40+
dynamicColor: Boolean = true,
41+
content: @Composable () -> Unit
42+
) {
43+
val colorScheme = when {
44+
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
45+
val context = LocalContext.current
46+
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
47+
}
48+
49+
darkTheme -> DarkColorScheme
50+
else -> LightColorScheme
2751
}
2852

2953
MaterialTheme(
30-
colors = colors,
54+
colorScheme = colorScheme,
3155
typography = Typography,
3256
shapes = Shapes,
3357
content = content
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
package org.burnoutcrew.android.ui.theme
22

3-
import androidx.compose.material.Typography
3+
import androidx.compose.material3.Typography
44
import androidx.compose.ui.text.TextStyle
55
import androidx.compose.ui.text.font.FontFamily
66
import androidx.compose.ui.text.font.FontWeight
77
import androidx.compose.ui.unit.sp
88

99
// Set of Material typography styles to start with
1010
val Typography = Typography(
11-
body1 = TextStyle(
11+
bodyLarge = TextStyle(
1212
fontFamily = FontFamily.Default,
1313
fontWeight = FontWeight.Normal,
14-
fontSize = 16.sp
14+
fontSize = 16.sp,
15+
lineHeight = 24.sp,
16+
letterSpacing = 0.5.sp
1517
)
16-
)
18+
/* Other default text styles to override
19+
titleLarge = TextStyle(
20+
fontFamily = FontFamily.Default,
21+
fontWeight = FontWeight.Normal,
22+
fontSize = 22.sp,
23+
lineHeight = 28.sp,
24+
letterSpacing = 0.sp
25+
),
26+
labelSmall = TextStyle(
27+
fontFamily = FontFamily.Default,
28+
fontWeight = FontWeight.Medium,
29+
fontSize = 11.sp,
30+
lineHeight = 16.sp,
31+
letterSpacing = 0.5.sp
32+
)
33+
*/
34+
)

0 commit comments

Comments
 (0)