From dc589cb4ab47eca681bf0136ea52b308d0c5ad35 Mon Sep 17 00:00:00 2001 From: rookie Date: Sun, 13 Oct 2024 10:12:15 +0800 Subject: [PATCH] rename compose theme --- .../com/engineer/imitate/ui/fragments/ComposeFragment.kt | 4 ++-- .../src/main/java/com/engineer/compose/ui/ChatActivity.kt | 6 ++---- .../main/java/com/engineer/compose/ui/GalleryActivity.kt | 5 ++--- .../java/com/engineer/compose/ui/MainComposeActivity.kt | 4 ++-- .../src/main/java/com/engineer/compose/ui/ui/theme/Theme.kt | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/imitate/src/main/java/com/engineer/imitate/ui/fragments/ComposeFragment.kt b/imitate/src/main/java/com/engineer/imitate/ui/fragments/ComposeFragment.kt index e12c5896..21bfc90d 100644 --- a/imitate/src/main/java/com/engineer/imitate/ui/fragments/ComposeFragment.kt +++ b/imitate/src/main/java/com/engineer/imitate/ui/fragments/ComposeFragment.kt @@ -13,7 +13,7 @@ import androidx.fragment.app.Fragment import com.alibaba.android.arouter.facade.annotation.Route import com.engineer.compose.ui.Message import com.engineer.compose.ui.MessageCard -import com.engineer.compose.ui.ui.theme.MiniAppTheme +import com.engineer.compose.ui.ui.theme.ComposeAppTheme import com.engineer.imitate.R /** @@ -34,7 +34,7 @@ class ComposeFragment : Fragment() { // is destroyed setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) setContent { - MiniAppTheme { + ComposeAppTheme { // A surface container using the 'background' color from the theme Surface(color = MaterialTheme.colorScheme.background) { MessageCard(Message("lucy", "hello world")) diff --git a/subs/compose/src/main/java/com/engineer/compose/ui/ChatActivity.kt b/subs/compose/src/main/java/com/engineer/compose/ui/ChatActivity.kt index 43e02a0b..d14f101c 100644 --- a/subs/compose/src/main/java/com/engineer/compose/ui/ChatActivity.kt +++ b/subs/compose/src/main/java/com/engineer/compose/ui/ChatActivity.kt @@ -2,11 +2,9 @@ package com.engineer.compose.ui import android.os.Bundle import android.util.Log -import android.view.View import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.foundation.Image -import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -49,7 +47,7 @@ import com.engineer.compose.ui.preview.ChatUIWithKeyboard import com.engineer.compose.ui.preview.ChatUIWithKeyboardPre import com.engineer.compose.ui.preview.provideTestChat import com.engineer.compose.ui.ui.theme.ChatPop -import com.engineer.compose.ui.ui.theme.MiniAppTheme +import com.engineer.compose.ui.ui.theme.ComposeAppTheme import com.engineer.compose.uitls.KeyBoardUtil import com.engineer.compose.viewmodel.ChatMessage import com.engineer.compose.viewmodel.ChatViewModel @@ -59,7 +57,7 @@ class ChatActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { - MiniAppTheme { + ComposeAppTheme { // A surface container using the 'background' color from the theme Surface(color = MaterialTheme.colorScheme.background) { ChatScreen(chatUIWithKeyboard = ChatUIWithKeyboard { diff --git a/subs/compose/src/main/java/com/engineer/compose/ui/GalleryActivity.kt b/subs/compose/src/main/java/com/engineer/compose/ui/GalleryActivity.kt index f2f51850..ef3f26b4 100644 --- a/subs/compose/src/main/java/com/engineer/compose/ui/GalleryActivity.kt +++ b/subs/compose/src/main/java/com/engineer/compose/ui/GalleryActivity.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Scaffold import androidx.compose.material3.Text @@ -35,7 +34,7 @@ import coil.decode.GifDecoder import coil.decode.ImageDecoderDecoder import coil.request.ImageRequest import coil.size.Size -import com.engineer.compose.ui.ui.theme.MiniAppTheme +import com.engineer.compose.ui.ui.theme.ComposeAppTheme import com.engineer.compose.viewmodel.ImagePreviewPayload import com.google.accompanist.pager.ExperimentalPagerApi import com.google.accompanist.pager.HorizontalPager @@ -53,7 +52,7 @@ class GalleryActivity : ComponentActivity() { setContent { - MiniAppTheme { + ComposeAppTheme { Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> diff --git a/subs/compose/src/main/java/com/engineer/compose/ui/MainComposeActivity.kt b/subs/compose/src/main/java/com/engineer/compose/ui/MainComposeActivity.kt index a5d784bd..c3c9b64c 100644 --- a/subs/compose/src/main/java/com/engineer/compose/ui/MainComposeActivity.kt +++ b/subs/compose/src/main/java/com/engineer/compose/ui/MainComposeActivity.kt @@ -5,7 +5,7 @@ import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface -import com.engineer.compose.ui.ui.theme.MiniAppTheme +import com.engineer.compose.ui.ui.theme.ComposeAppTheme /** * https://developer.android.google.cn/jetpack/compose/tutorial @@ -17,7 +17,7 @@ class MainComposeActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { - MiniAppTheme { + ComposeAppTheme { // A surface container using the 'background' color from the theme Surface(color = MaterialTheme.colorScheme.background) { MessageCard(Message("lucy", "hello world")) diff --git a/subs/compose/src/main/java/com/engineer/compose/ui/ui/theme/Theme.kt b/subs/compose/src/main/java/com/engineer/compose/ui/ui/theme/Theme.kt index 57655235..aa78b959 100644 --- a/subs/compose/src/main/java/com/engineer/compose/ui/ui/theme/Theme.kt +++ b/subs/compose/src/main/java/com/engineer/compose/ui/ui/theme/Theme.kt @@ -38,7 +38,7 @@ private val LightColorScheme = lightColorScheme( ) @Composable -fun MiniAppTheme( +fun ComposeAppTheme( darkTheme: Boolean = isSystemInDarkTheme(), // Dynamic color is available on Android 12+ dynamicColor: Boolean = true,