File tree Expand file tree Collapse file tree 3 files changed +17
-20
lines changed
app/src/main/java/com/dede/android_eggs/views/main/compose
theme/src/main/java/com/dede/android_eggs/views/theme Expand file tree Collapse file tree 3 files changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ import androidx.compose.ui.platform.LocalContext
2323import androidx.compose.ui.tooling.preview.Preview
2424import androidx.compose.ui.unit.dp
2525import com.dede.android_eggs.R
26- import com.dede.android_eggs.views.main.util.EasterEggHelp
27- import com.dede.android_eggs.util.compose.plus
2826import com.dede.android_eggs.inject.EasterEggModules
27+ import com.dede.android_eggs.util.compose.plus
28+ import com.dede.android_eggs.views.main.util.EasterEggHelp
2929import com.dede.basic.provider.BaseEasterEgg
3030import com.dede.basic.provider.EasterEgg
3131
@@ -110,7 +110,7 @@ private fun SearchEmpty(contentPadding: PaddingValues) {
110110 Icon (
111111 imageVector = Icons .Rounded .SearchOff ,
112112 contentDescription = null ,
113- modifier = Modifier .size(108 .dp)
113+ modifier = Modifier .size(102 .dp)
114114 )
115115 }
116116}
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import androidx.compose.animation.fadeIn
77import androidx.compose.animation.fadeOut
88import androidx.compose.animation.scaleIn
99import androidx.compose.animation.scaleOut
10- import androidx.compose.foundation.layout.Row
1110import androidx.compose.material.icons.Icons
1211import androidx.compose.material.icons.rounded.Search
1312import androidx.compose.material.icons.rounded.Settings
@@ -27,7 +26,6 @@ import androidx.compose.ui.text.font.FontWeight
2726import androidx.compose.ui.text.style.TextOverflow
2827import androidx.compose.ui.tooling.preview.Preview
2928import com.dede.android_eggs.R
30- import com.dede.android_eggs.ui.composes.BuildTypeBubble
3129import kotlinx.coroutines.launch
3230
3331
@@ -61,15 +59,12 @@ fun MainTitleBar(
6159 }
6260 },
6361 title = {
64- Row {
65- Text (
66- text = stringResource(R .string.app_name),
67- maxLines = 1 ,
68- overflow = TextOverflow .Ellipsis ,
69- fontWeight = FontWeight .Medium
70- )
71- BuildTypeBubble ()
72- }
62+ Text (
63+ text = stringResource(R .string.app_name),
64+ maxLines = 1 ,
65+ overflow = TextOverflow .Ellipsis ,
66+ fontWeight = FontWeight .Medium
67+ )
7368 },
7469 actions = {
7570 IconButton (
Original file line number Diff line number Diff line change 1- @file:Suppress(" PrivatePropertyName" )
2-
31package com.dede.android_eggs.views.theme
42
53import android.content.Context
@@ -138,13 +136,17 @@ var currentColorScheme: ColorScheme = lightScheme
138136 private set
139137
140138@Composable
141- fun EasterEggsTheme (content : @Composable () -> Unit ) {
142- var nightModeValue = themeMode
139+ fun EasterEggsTheme (
140+ theme : Int = themeMode,
141+ dynamicColor : Boolean = isDynamicColorEnable,
142+ content : @Composable () -> Unit
143+ ) {
144+ var nightModeValue = theme
143145 if (nightModeValue == ThemePrefUtil .FOLLOW_SYSTEM ) {
144146 nightModeValue = if (isSystemInDarkTheme()) ThemePrefUtil .DARK else ThemePrefUtil .LIGHT
145147 }
146148
147- val colors = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S && isDynamicColorEnable ) {
149+ val colors = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S && dynamicColor ) {
148150 val context: Context = LocalContext .current
149151 when (nightModeValue) {
150152 ThemePrefUtil .AMOLED -> dynamicDarkColorScheme(context).toAmoled()
@@ -163,4 +165,4 @@ fun EasterEggsTheme(content: @Composable () -> Unit) {
163165 colorScheme = colors,
164166 content = content
165167 )
166- }
168+ }
You can’t perform that action at this time.
0 commit comments