Skip to content

Commit dbd68c4

Browse files
committed
feat: Remove build type bubble
Signed-off-by: Hu Shenghao <dede.hu@qq.com>
1 parent 0fa150e commit dbd68c4

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

app/src/main/java/com/dede/android_eggs/views/main/compose/EasterEggScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import androidx.compose.ui.platform.LocalContext
2323
import androidx.compose.ui.tooling.preview.Preview
2424
import androidx.compose.ui.unit.dp
2525
import com.dede.android_eggs.R
26-
import com.dede.android_eggs.views.main.util.EasterEggHelp
27-
import com.dede.android_eggs.util.compose.plus
2826
import 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
2929
import com.dede.basic.provider.BaseEasterEgg
3030
import 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
}

app/src/main/java/com/dede/android_eggs/views/main/compose/MainTitleBar.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import androidx.compose.animation.fadeIn
77
import androidx.compose.animation.fadeOut
88
import androidx.compose.animation.scaleIn
99
import androidx.compose.animation.scaleOut
10-
import androidx.compose.foundation.layout.Row
1110
import androidx.compose.material.icons.Icons
1211
import androidx.compose.material.icons.rounded.Search
1312
import androidx.compose.material.icons.rounded.Settings
@@ -27,7 +26,6 @@ import androidx.compose.ui.text.font.FontWeight
2726
import androidx.compose.ui.text.style.TextOverflow
2827
import androidx.compose.ui.tooling.preview.Preview
2928
import com.dede.android_eggs.R
30-
import com.dede.android_eggs.ui.composes.BuildTypeBubble
3129
import 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(

theme/src/main/java/com/dede/android_eggs/views/theme/Theme.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@file:Suppress("PrivatePropertyName")
2-
31
package com.dede.android_eggs.views.theme
42

53
import 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+
}

0 commit comments

Comments
 (0)