feat: UI Changes
* fix(#220): implement edit soul and set model dialogs * fix(#211): make UI more compact and information dense * fix(#211): make navigation drawer sidebar more compact * feat(#252): move settings item to end of navigation drawer * feat(#250): add bottom navigation bar display mode settings * feat(#225): add search bar filtering to remaining screens * fix: make bottom navigation bar display modes more compact * fix: resolve compilation error in KanbanScreen by referencing assignedTo * feat: add search to achievements screen and top padding for icon-only navigation bar * fix: adjust icon-only bottom bar height and remove padding * fix(#249): remove unused PaddingValues imports in 6 screens --------- Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
32def80694
commit
60bf6e8a33
20 files changed
+424
-61
No files matched your search
@@ -63,6 +63,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import com.m57.hermescontrol.BuildConfig
|
||||
import com.m57.hermescontrol.R
|
||||
import com.m57.hermescontrol.theme.BottomNavDisplayMode
|
||||
import com.m57.hermescontrol.theme.ThemePreference
|
||||
import com.m57.hermescontrol.theme.ThemePreset
|
||||
import com.m57.hermescontrol.ui.common.HermesScaffold
|
||||
@@ -478,6 +479,51 @@ fun SettingsScreen(
|
||||
|
||||
// Navigation Bar section
|
||||
SectionCard(title = stringResource(R.string.settings_sec_nav_bar)) {
|
||||
Text(
|
||||
text = stringResource(R.string.settings_item_bottom_nav_display_mode),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
SingleChoiceSegmentedButtonRow(modifier = Modifier.fillMaxWidth()) {
|
||||
BottomNavDisplayMode.entries.forEachIndexed { index, mode ->
|
||||
SegmentedButton(
|
||||
selected = state.bottomNavDisplayMode == mode,
|
||||
onClick = { viewModel.onBottomNavDisplayModeChange(mode) },
|
||||
shape =
|
||||
SegmentedButtonDefaults.itemShape(
|
||||
index = index,
|
||||
count = BottomNavDisplayMode.entries.size,
|
||||
),
|
||||
) {
|
||||
Text(
|
||||
when (mode) {
|
||||
BottomNavDisplayMode.ICON_AND_TEXT -> {
|
||||
stringResource(
|
||||
R.string.settings_display_mode_icon_and_text,
|
||||
)
|
||||
}
|
||||
|
||||
BottomNavDisplayMode.ICON_ONLY -> {
|
||||
stringResource(
|
||||
R.string.settings_display_mode_icon_only,
|
||||
)
|
||||
}
|
||||
|
||||
BottomNavDisplayMode.TEXT_ONLY -> {
|
||||
stringResource(
|
||||
R.string.settings_display_mode_text_only,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(R.string.settings_item_nav_items, state.selectedNavItems.size),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.m57.hermescontrol.data.local.AuthManager
|
||||
import com.m57.hermescontrol.data.remote.ApiClient
|
||||
import com.m57.hermescontrol.data.remote.NetworkResult
|
||||
import com.m57.hermescontrol.data.remote.safeApiCall
|
||||
import com.m57.hermescontrol.theme.BottomNavDisplayMode
|
||||
import com.m57.hermescontrol.theme.ThemePreference
|
||||
import com.m57.hermescontrol.theme.ThemePreset
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -34,6 +35,7 @@ data class SettingsUiState(
|
||||
val profiles: List<com.m57.hermescontrol.data.model.ConnectionProfile> = emptyList(),
|
||||
val selectedProfileId: String? = null,
|
||||
val renameProfileName: String = "",
|
||||
val bottomNavDisplayMode: BottomNavDisplayMode = BottomNavDisplayMode.ICON_AND_TEXT,
|
||||
)
|
||||
|
||||
class SettingsViewModel : ViewModel() {
|
||||
@@ -69,6 +71,7 @@ class SettingsViewModel : ViewModel() {
|
||||
.firstOrNull { p ->
|
||||
p.id == selectedId
|
||||
}?.name ?: "",
|
||||
bottomNavDisplayMode = AuthManager.getBottomNavDisplayMode(),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -137,6 +140,11 @@ class SettingsViewModel : ViewModel() {
|
||||
AuthManager.setThemePreset(preset)
|
||||
}
|
||||
|
||||
fun onBottomNavDisplayModeChange(mode: BottomNavDisplayMode) {
|
||||
_uiState.update { it.copy(bottomNavDisplayMode = mode, isSaved = false) }
|
||||
AuthManager.setBottomNavDisplayMode(mode)
|
||||
}
|
||||
|
||||
fun onTypingEffectEnabledChange(enabled: Boolean) {
|
||||
_uiState.update { it.copy(typingEffectEnabled = enabled, isSaved = false) }
|
||||
}
|
||||
@@ -205,6 +213,7 @@ class SettingsViewModel : ViewModel() {
|
||||
AuthManager.setThemePreference(state.themePreference)
|
||||
AuthManager.setUseDynamicColors(state.useDynamicColors)
|
||||
AuthManager.setThemePreset(state.themePreset)
|
||||
AuthManager.setBottomNavDisplayMode(state.bottomNavDisplayMode)
|
||||
AuthManager.setTypingEffectEnabled(state.typingEffectEnabled)
|
||||
AuthManager.setTypingEffectDelayMs(state.typingEffectDelayMs)
|
||||
ApiClient.rebuild()
|
||||
|
||||
Reference in new issue
Block a user