mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-08 07:44:11 +00:00
rename bars properties and strings
This commit is contained in:
+3
-2
@@ -118,9 +118,10 @@ fun AppearanceScope.AppearanceLayout(
|
||||
MessageShapeSection()
|
||||
|
||||
SectionDividerSpaced()
|
||||
BarsAlphaSection(appPrefs.barsAlpha, 0.9f)
|
||||
BarsAlphaSection(MR.strings.appearance_in_app_bars_alpha, appPrefs.inAppBarsAlpha, 0.9f)
|
||||
SectionDividerSpaced()
|
||||
SectionSpacer()
|
||||
BarsAlphaSection(appPrefs.barsAlpha2, 0.6f)
|
||||
BarsAlphaSection(MR.strings.appearance_nav_bar_alpha, appPrefs.navBarAlpha, 0.6f)
|
||||
|
||||
SectionDividerSpaced()
|
||||
ProfileImageSection()
|
||||
|
||||
+4
-4
@@ -223,8 +223,8 @@ class AppPreferences {
|
||||
val chatItemTail = mkBoolPreference(SHARED_PREFS_CHAT_ITEM_TAIL, true)
|
||||
val fontScale = mkFloatPreference(SHARED_PREFS_FONT_SCALE, 1f)
|
||||
val densityScale = mkFloatPreference(SHARED_PREFS_DENSITY_SCALE, 1f)
|
||||
val barsAlpha = mkFloatPreference(SHARED_PREFS_BARS_ALPHA, 0.9f)
|
||||
val barsAlpha2 = mkFloatPreference(SHARED_PREFS_BARS_ALPHA2, 0.6f)
|
||||
val inAppBarsAlpha = mkFloatPreference(SHARED_PREFS_IN_APP_BARS_ALPHA, 0.9f)
|
||||
val navBarAlpha = mkFloatPreference(SHARED_PREFS_NAV_BAR_ALPHA, 0.6f)
|
||||
|
||||
val whatsNewVersion = mkStrPreference(SHARED_PREFS_WHATS_NEW_VERSION, null)
|
||||
val lastMigratedVersionCode = mkIntPreference(SHARED_PREFS_LAST_MIGRATED_VERSION_CODE, 0)
|
||||
@@ -430,8 +430,8 @@ class AppPreferences {
|
||||
private const val SHARED_PREFS_CHAT_ITEM_TAIL = "ChatItemTail"
|
||||
private const val SHARED_PREFS_FONT_SCALE = "FontScale"
|
||||
private const val SHARED_PREFS_DENSITY_SCALE = "DensityScale"
|
||||
private const val SHARED_PREFS_BARS_ALPHA = "BarsAlpha"
|
||||
private const val SHARED_PREFS_BARS_ALPHA2 = "BarsAlpha2"
|
||||
private const val SHARED_PREFS_IN_APP_BARS_ALPHA = "InAppBarsAlpha"
|
||||
private const val SHARED_PREFS_NAV_BAR_ALPHA = "NavBarAlpha"
|
||||
private const val SHARED_PREFS_WHATS_NEW_VERSION = "WhatsNewVersion"
|
||||
private const val SHARED_PREFS_LAST_MIGRATED_VERSION_CODE = "LastMigratedVersionCode"
|
||||
private const val SHARED_PREFS_CUSTOM_DISAPPEARING_MESSAGE_TIME = "CustomDisappearingMessageTime"
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ fun TerminalLayout(
|
||||
.align(Alignment.BottomCenter)
|
||||
.navigationBarsPadding()
|
||||
.imePadding()
|
||||
.background(MaterialTheme.colors.background.copy(remember { appPrefs.barsAlpha.state }.value))
|
||||
.background(MaterialTheme.colors.background.copy(remember { appPrefs.inAppBarsAlpha.state }.value))
|
||||
) {
|
||||
Divider()
|
||||
Box(Modifier.padding(horizontal = 8.dp)) {
|
||||
|
||||
+1
-1
@@ -897,7 +897,7 @@ fun ComposeView(
|
||||
}
|
||||
}
|
||||
}
|
||||
Column(Modifier.background(MaterialTheme.colors.background.copy(remember { appPrefs.barsAlpha.state }.value))) {
|
||||
Column(Modifier.background(MaterialTheme.colors.background.copy(remember { appPrefs.inAppBarsAlpha.state }.value))) {
|
||||
Divider()
|
||||
Row(Modifier.padding(end = 8.dp), verticalAlignment = Alignment.Bottom) {
|
||||
val isGroupAndProhibitedFiles = chat.chatInfo is ChatInfo.Group && !chat.chatInfo.groupInfo.fullGroupPreferences.files.on(chat.chatInfo.groupInfo.membership)
|
||||
|
||||
+3
-3
@@ -589,7 +589,7 @@ enum class ScrollDirection {
|
||||
@Composable
|
||||
fun BoxScope.StatusBarBackground() {
|
||||
if (appPlatform.isAndroid) {
|
||||
val finalColor = MaterialTheme.colors.background.copy(remember { appPrefs.barsAlpha.state }.value)
|
||||
val finalColor = MaterialTheme.colors.background.copy(remember { appPrefs.inAppBarsAlpha.state }.value)
|
||||
Box(Modifier.fillMaxWidth().windowInsetsTopHeight(WindowInsets.statusBars).background(finalColor))
|
||||
}
|
||||
}
|
||||
@@ -601,7 +601,7 @@ fun BoxScope.NavigationBarBackground(appBarOnBottom: Boolean = false, mixedColor
|
||||
val barPadding = WindowInsets.navigationBars.asPaddingValues()
|
||||
val paddingBottom = barPadding.calculateBottomPadding()
|
||||
val color = if (mixedColor) MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.97f) else MaterialTheme.colors.background
|
||||
val finalColor = color.copy(remember(appBarOnBottom) { if (appBarOnBottom) appPrefs.barsAlpha.state else appPrefs.barsAlpha2.state }.value)
|
||||
val finalColor = color.copy(remember(appBarOnBottom) { if (appBarOnBottom) appPrefs.inAppBarsAlpha.state else appPrefs.navBarAlpha.state }.value)
|
||||
Box(Modifier.align(Alignment.BottomStart).height(paddingBottom).fillMaxWidth().background(finalColor))
|
||||
}
|
||||
}
|
||||
@@ -612,7 +612,7 @@ fun BoxScope.NavigationBarBackground(modifier: Modifier, color: Color = Material
|
||||
if (appPlatform.isAndroid && keyboardState.value == KeyboardState.Closed) {
|
||||
val barPadding = WindowInsets.navigationBars.asPaddingValues()
|
||||
val paddingBottom = barPadding.calculateBottomPadding()
|
||||
val finalColor = color.copy(remember { appPrefs.barsAlpha2.state }.value)
|
||||
val finalColor = color.copy(remember { appPrefs.navBarAlpha.state }.value)
|
||||
Box(modifier.align(Alignment.BottomStart).height(paddingBottom).fillMaxWidth().background(finalColor))
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ fun CloseSheetBar(
|
||||
endButtons: @Composable RowScope.() -> Unit = {}
|
||||
) {
|
||||
val background = MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.97f)
|
||||
val themeBackgroundMix = background.copy(remember { appPrefs.barsAlpha.state }.value)
|
||||
val themeBackgroundMix = background.copy(remember { appPrefs.inAppBarsAlpha.state }.value)
|
||||
val handler = LocalAppBarHandler.current
|
||||
val connection = LocalAppBarHandler.current?.connection
|
||||
val title = remember(handler?.title?.value) { handler?.title ?: mutableStateOf("") }
|
||||
@@ -157,7 +157,7 @@ fun AppBarTitle(title: String, hostDevice: Pair<Long?, String>? = null, withPad
|
||||
|
||||
private fun topTitleAlpha(text: Boolean, connection: CollapsingAppBarNestedScrollConnection) =
|
||||
if (connection.appBarOffset.absoluteValue < AppBarHandler.appBarMaxHeightPx / 3) 0f
|
||||
else ((-connection.appBarOffset * 1.5f) / (AppBarHandler.appBarMaxHeightPx)).coerceIn(0f, if (text) 1f else appPrefs.barsAlpha.get())
|
||||
else ((-connection.appBarOffset * 1.5f) / (AppBarHandler.appBarMaxHeightPx)).coerceIn(0f, if (text) 1f else appPrefs.inAppBarsAlpha.get())
|
||||
|
||||
private fun bottomTitleAlpha(connection: CollapsingAppBarNestedScrollConnection?) =
|
||||
if ((connection?.appBarOffset ?: 0f).absoluteValue < AppBarHandler.appBarMaxHeightPx / 3) 1f
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ fun DefaultTopAppBar(
|
||||
}
|
||||
},
|
||||
backgroundColor = MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.97f)
|
||||
.copy(remember { appPrefs.barsAlpha.state }.value),
|
||||
.copy(remember { appPrefs.inAppBarsAlpha.state }.value),
|
||||
navigationIcon = navigationButton,
|
||||
buttons = if (!showSearch) buttons else emptyList(),
|
||||
centered = !showSearch,
|
||||
|
||||
+3
-2
@@ -39,6 +39,7 @@ import chat.simplex.common.views.chat.item.msgTailWidthDp
|
||||
import chat.simplex.res.MR
|
||||
import com.godaddy.android.colorpicker.ClassicColorPicker
|
||||
import com.godaddy.android.colorpicker.HsvColor
|
||||
import dev.icerock.moko.resources.StringResource
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.datetime.Clock
|
||||
@@ -171,9 +172,9 @@ object AppearanceScope {
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun BarsAlphaSection(pref: SharedPreference<Float>, defaultValue: Float) {
|
||||
fun BarsAlphaSection(sectionTitle: StringResource, pref: SharedPreference<Float>, defaultValue: Float) {
|
||||
val barsAlpha = remember { mutableStateOf(pref.get()) }
|
||||
SectionView(stringResource(MR.strings.appearance_bars_alpha).uppercase(), contentPadding = PaddingValues(horizontal = DEFAULT_PADDING)) {
|
||||
SectionView(stringResource(sectionTitle).uppercase(), contentPadding = PaddingValues(horizontal = DEFAULT_PADDING)) {
|
||||
Row(Modifier.padding(top = 10.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Box(Modifier.size(60.dp)
|
||||
.background(MaterialTheme.colors.surface, RoundedCornerShape(percent = 22))
|
||||
|
||||
@@ -1755,7 +1755,8 @@
|
||||
<string name="theme_remove_image">Remove image</string>
|
||||
<string name="appearance_font_size">Font size</string>
|
||||
<string name="appearance_zoom">Zoom</string>
|
||||
<string name="appearance_bars_alpha">Navigation bars transparency</string>
|
||||
<string name="appearance_in_app_bars_alpha">In-app bars transparency</string>
|
||||
<string name="appearance_nav_bar_alpha">Navigation bar transparency</string>
|
||||
<string name="system_mode_toast">System mode</string>
|
||||
|
||||
<!-- Wallpapers -->
|
||||
|
||||
+1
-3
@@ -68,9 +68,7 @@ fun AppearanceScope.AppearanceLayout(
|
||||
MessageShapeSection()
|
||||
|
||||
SectionDividerSpaced()
|
||||
BarsAlphaSection(appPrefs.barsAlpha, 0.9f)
|
||||
SectionSpacer()
|
||||
BarsAlphaSection(appPrefs.barsAlpha2, 0.6f)
|
||||
BarsAlphaSection(MR.strings.appearance_in_app_bars_alpha, appPrefs.inAppBarsAlpha, 0.9f)
|
||||
|
||||
SectionDividerSpaced()
|
||||
ProfileImageSection()
|
||||
|
||||
Reference in New Issue
Block a user