mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 16:27:06 +05:30
all: migrate to M3
This commit is contained in:
parent
e57a476145
commit
72d7297818
13 changed files with 295 additions and 66 deletions
|
@ -1,3 +1,5 @@
|
|||
@file:OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
|
||||
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
|
@ -13,6 +15,7 @@ dependencies {
|
|||
implementation(projects.api)
|
||||
implementation(projects.common)
|
||||
implementation(projects.database)
|
||||
implementation(compose.material3)
|
||||
implementation(libs.accompanist.insets)
|
||||
implementation(libs.accompanist.swiperefresh)
|
||||
implementation(libs.accompanist.sysuicontroller)
|
||||
|
|
|
@ -8,8 +8,8 @@ import androidx.compose.animation.core.tween
|
|||
import androidx.compose.animation.slideInVertically
|
||||
import androidx.compose.animation.slideOutVertically
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.material.FloatingActionButton
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material3.FloatingActionButton
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.Modifier
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package dev.msfjarvis.claw.android.ui
|
||||
|
||||
import androidx.compose.animation.ExperimentalAnimationApi
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.primarySurface
|
||||
import androidx.compose.material.rememberScaffoldState
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.rememberScaffoldState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
|
@ -40,7 +39,7 @@ import dev.msfjarvis.claw.database.local.SavedPost
|
|||
|
||||
private const val ScrollDelta = 50
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun LobstersApp(
|
||||
viewModel: ClawViewModel = viewModel(),
|
||||
|
@ -101,11 +100,10 @@ fun LobstersApp(
|
|||
),
|
||||
) {
|
||||
ProvideWindowInsets {
|
||||
val useDarkIcons = MaterialTheme.colors.isLight
|
||||
val statusBarColor = MaterialTheme.colors.primarySurface
|
||||
val statusBarColor = MaterialTheme.colorScheme.background
|
||||
|
||||
SideEffect {
|
||||
systemUiController.setStatusBarColor(color = statusBarColor, darkIcons = useDarkIcons)
|
||||
systemUiController.setStatusBarColor(color = statusBarColor)
|
||||
systemUiController.setNavigationBarColor(color = Color.Transparent)
|
||||
}
|
||||
val items = viewModel.pagerFlow.collectAsLazyPagingItems()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package dev.msfjarvis.claw.android.ui
|
||||
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TopAppBar
|
||||
import androidx.compose.material3.SmallTopAppBar
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
|
@ -14,7 +14,7 @@ import dev.msfjarvis.claw.android.R
|
|||
fun ClawAppBar(
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
TopAppBar(
|
||||
SmallTopAppBar(
|
||||
title = {
|
||||
Text(
|
||||
text = stringResource(R.string.app_name),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue