Skip to content

Commit 4945e47

Browse files
authored
Merge pull request #857 from synonymdev/feat/settings-v60
feat: settings design updates v60
2 parents 3a2adae + b11aeba commit 4945e47

101 files changed

Lines changed: 3391 additions & 2336 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ suspend fun getData(): Result<Data> = withContext(Dispatchers.IO) {
192192
- NEVER hardcode strings and always preserve string resources
193193
- ALWAYS localize in ViewModels using injected `@ApplicationContext`, e.g. `context.getString()`
194194
- ALWAYS use `remember` for expensive Compose computations
195-
- ALWAYS add modifiers to the last place in the argument list when calling composable functions
196-
- NEVER add parameters with default values BEFORE the `modifier` parameter in composable functions - modifier must be the FIRST optional parameter
195+
- ALWAYS declare `modifier: Modifier = Modifier,` as the FIRST optional parameter in composable declarations
196+
- ALWAYS pass `modifier = ...` as the LAST argument in composable calls
197+
- ALWAYS add trailing commas in multi-line declarations; NEVER add a trailing comma to `modifier = ...` at call sites
197198
- ALWAYS use `navController.navigateTo(route)` for simple navigation; NEVER use raw `navController.navigate(route)``navigateTo` prevents duplicate destinations
198199
- ALWAYS prefer `VerticalSpacer`, `HorizontalSpacer`, `FillHeight` and `FillWidth` over `Spacer` when applicable
199200
- PREFER declaring small dependant classes, constants, interfaces or top-level functions in the same file with the core class where these are used

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- Lightning Connections empty state with onboarding screen #857
12+
- Unified PIN management screen (enable/disable/change in one place) #857
13+
- Support entry in drawer menu #857
14+
- Brand endorsement row (Synonym + Tether logos) in Support screen #857
15+
- Reset Widgets and Reset Suggestions Cards options in Widgets settings #857
16+
- Diagonal orange footer background in Support screen #857
17+
- Mnemonic warning text transitions on reveal #857
18+
19+
### Changed
20+
- Settings redesigned with tabbed navigation (General/Security/Advanced) with swipe support #857
21+
- Icons added to all settings rows for faster scanning #857
22+
- Selected values displayed on right side of settings rows #857
23+
- Support screen redesigned with About content merged in #857
24+
- Backup and Reset moved into Security tab #857
25+
- PIN flow reworked into sheet-based enable/disable/change #857
26+
- Social links simplified with Brand tint #857
27+
- Mnemonic warning updated with new copy and red styling #857
28+
- Security title changed from "Security and Privacy" to "Security" #857
29+
- Language model updated to use string resources for "System Settings" #857
30+
31+
### Removed
32+
- About screen (content merged into Support) #857
33+
- Standalone General, Security, and Advanced settings screens (merged into tabs) #857
34+
1035
[Unreleased]: https://github.com/synonymdev/bitkit-android/compare/v2.1.2...HEAD

app/src/main/java/to/bitkit/models/Language.kt

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
package to.bitkit.models
22

3+
import androidx.annotation.StringRes
34
import kotlinx.serialization.Serializable
5+
import to.bitkit.R
46
import java.util.Locale
57

68
@Serializable
79
enum class Language(
8-
val displayName: String,
10+
@StringRes val displayNameResId: Int? = null,
11+
val nativeName: String? = null,
912
val languageCode: String,
1013
val countryCode: String? = null,
1114
val isSystemDefault: Boolean = false,
1215
) {
1316
SYSTEM_DEFAULT(
14-
displayName = "System Default",
17+
displayNameResId = R.string.settings__language_system_default,
1518
languageCode = "system",
1619
countryCode = null,
1720
isSystemDefault = true
1821
),
19-
ARABIC("العربية", "ar"),
20-
CATALAN("Català", "ca"),
21-
CZECH("Čeština", "cs"),
22-
DUTCH("Nederlands", "nl"),
23-
ENGLISH("English", "en", "US"),
24-
FRENCH("Français", "fr", "FR"),
25-
GERMAN("Deutsch", "de"),
26-
GREEK("Ελληνικά", "el"),
27-
ITALIAN("Italiano", "it"),
28-
POLISH("Polski", "pl"),
29-
PORTUGUESE("Português", "pt", "BR"),
30-
RUSSIAN("Русский", "ru"),
31-
SPANISH("Español", "es", "ES"),
32-
SPANISH_LATIN_AMERICA("Español (Latinoamérica)", "es", "419");
22+
ARABIC(nativeName = "العربية", languageCode = "ar"),
23+
CATALAN(nativeName = "Català", languageCode = "ca"),
24+
CZECH(nativeName = "Čeština", languageCode = "cs"),
25+
DUTCH(nativeName = "Nederlands", languageCode = "nl"),
26+
ENGLISH(nativeName = "English", languageCode = "en", countryCode = "US"),
27+
FRENCH(nativeName = "Français", languageCode = "fr", countryCode = "FR"),
28+
GERMAN(nativeName = "Deutsch", languageCode = "de"),
29+
GREEK(nativeName = "Ελληνικά", languageCode = "el"),
30+
ITALIAN(nativeName = "Italiano", languageCode = "it"),
31+
POLISH(nativeName = "Polski", languageCode = "pl"),
32+
PORTUGUESE(nativeName = "Português", languageCode = "pt", countryCode = "BR"),
33+
RUSSIAN(nativeName = "Русский", languageCode = "ru"),
34+
SPANISH(nativeName = "Español", languageCode = "es", countryCode = "ES"),
35+
SPANISH_LATIN_AMERICA(nativeName = "Español (Latinoamérica)", languageCode = "es", countryCode = "419");
3336

3437
companion object {
3538
fun fromLanguageCode(languageCode: String, countryCode: String? = null): Language? {

app/src/main/java/to/bitkit/ui/ContentView.kt

Lines changed: 16 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ import to.bitkit.ui.screens.widgets.suggestions.SuggestionsViewModel
122122
import to.bitkit.ui.screens.widgets.weather.WeatherEditScreen
123123
import to.bitkit.ui.screens.widgets.weather.WeatherPreviewScreen
124124
import to.bitkit.ui.screens.widgets.weather.WeatherViewModel
125-
import to.bitkit.ui.settings.AboutScreen
126-
import to.bitkit.ui.settings.AdvancedSettingsScreen
127125
import to.bitkit.ui.settings.BackupSettingsScreen
128126
import to.bitkit.ui.settings.BlocktankRegtestScreen
129127
import to.bitkit.ui.settings.CJitDetailScreen
@@ -132,7 +130,6 @@ import to.bitkit.ui.settings.LanguageSettingsScreen
132130
import to.bitkit.ui.settings.LogDetailScreen
133131
import to.bitkit.ui.settings.LogsScreen
134132
import to.bitkit.ui.settings.OrderDetailScreen
135-
import to.bitkit.ui.settings.SecuritySettingsScreen
136133
import to.bitkit.ui.settings.SettingsScreen
137134
import to.bitkit.ui.settings.advanced.AddressTypePreferenceScreen
138135
import to.bitkit.ui.settings.advanced.AddressViewerScreen
@@ -144,19 +141,14 @@ import to.bitkit.ui.settings.backgroundPayments.BackgroundPaymentsIntroScreen
144141
import to.bitkit.ui.settings.backgroundPayments.BackgroundPaymentsSettings
145142
import to.bitkit.ui.settings.backups.ResetAndRestoreScreen
146143
import to.bitkit.ui.settings.general.DefaultUnitSettingsScreen
147-
import to.bitkit.ui.settings.general.GeneralSettingsScreen
148144
import to.bitkit.ui.settings.general.LocalCurrencySettingsScreen
149145
import to.bitkit.ui.settings.general.TagsSettingsScreen
150146
import to.bitkit.ui.settings.general.WidgetsSettingsScreen
151147
import to.bitkit.ui.settings.lightning.ChannelDetailScreen
152148
import to.bitkit.ui.settings.lightning.CloseConnectionScreen
153149
import to.bitkit.ui.settings.lightning.LightningConnectionsScreen
154150
import to.bitkit.ui.settings.lightning.LightningConnectionsViewModel
155-
import to.bitkit.ui.settings.pin.ChangePinConfirmScreen
156-
import to.bitkit.ui.settings.pin.ChangePinNewScreen
157-
import to.bitkit.ui.settings.pin.ChangePinResultScreen
158-
import to.bitkit.ui.settings.pin.ChangePinScreen
159-
import to.bitkit.ui.settings.pin.DisablePinScreen
151+
import to.bitkit.ui.settings.pin.PinManagementScreen
160152
import to.bitkit.ui.settings.quickPay.QuickPayIntroScreen
161153
import to.bitkit.ui.settings.quickPay.QuickPaySettingsScreen
162154
import to.bitkit.ui.settings.support.ReportIssueResultScreen
@@ -167,7 +159,9 @@ import to.bitkit.ui.settings.transactionSpeed.TransactionSpeedSettingsScreen
167159
import to.bitkit.ui.sheets.BackgroundPaymentsIntroSheet
168160
import to.bitkit.ui.sheets.BackupRoute
169161
import to.bitkit.ui.sheets.BackupSheet
162+
import to.bitkit.ui.sheets.ChangePinSheet
170163
import to.bitkit.ui.sheets.ConnectionClosedSheet
164+
import to.bitkit.ui.sheets.DisablePinSheet
171165
import to.bitkit.ui.sheets.ForceTransferSheet
172166
import to.bitkit.ui.sheets.GiftSheet
173167
import to.bitkit.ui.sheets.HighBalanceWarningSheet
@@ -398,6 +392,8 @@ fun ContentView(
398392
is Sheet.ActivityDateRangeSelector -> DateRangeSelectorSheet()
399393
is Sheet.ActivityTagSelector -> TagSelectorSheet()
400394
is Sheet.Pin -> PinSheet(sheet, appViewModel)
395+
Sheet.ChangePin -> ChangePinSheet(appViewModel)
396+
Sheet.DisablePin -> DisablePinSheet(appViewModel)
401397
is Sheet.Backup -> BackupSheet(sheet, onDismiss = { appViewModel.hideSheet() })
402398
is Sheet.LnurlAuth -> LnurlAuthSheet(sheet, appViewModel)
403399
Sheet.ForceTransfer -> ForceTransferSheet(appViewModel, transferViewModel)
@@ -491,7 +487,7 @@ fun ContentView(
491487
rootNavController = navController,
492488
hasSeenWidgetsIntro = hasSeenWidgetsIntro,
493489
hasSeenShopIntro = hasSeenShopIntro,
494-
modifier = Modifier.align(Alignment.TopEnd),
490+
modifier = Modifier.align(Alignment.TopEnd)
495491
)
496492
}
497493
}
@@ -527,16 +523,10 @@ private fun RootNavHost(
527523
comingSoon(navController)
528524
profile(navController, settingsViewModel)
529525
shop(navController, settingsViewModel, appViewModel)
530-
generalSettings(navController)
531-
advancedSettings(navController)
532-
aboutSettings(navController)
526+
generalSettingsSubScreens(navController)
527+
advancedSettingsSubScreens(navController)
533528
transactionSpeedSettings(navController)
534-
securitySettings(navController)
535-
disablePin(navController)
536-
changePin(navController)
537-
changePinNew(navController)
538-
changePinConfirm(navController)
539-
changePinResult(navController)
529+
pinManagement(navController)
540530
defaultUnitSettings(currencyViewModel, navController)
541531
localCurrencySettings(currencyViewModel, navController)
542532
backupSettings(navController)
@@ -972,11 +962,7 @@ private fun NavGraphBuilder.shop(
972962
}
973963
}
974964

975-
private fun NavGraphBuilder.generalSettings(navController: NavHostController) {
976-
composableWithDefaultTransitions<Routes.GeneralSettings> {
977-
GeneralSettingsScreen(navController)
978-
}
979-
965+
private fun NavGraphBuilder.generalSettingsSubScreens(navController: NavHostController) {
980966
composableWithDefaultTransitions<Routes.WidgetsSettings> {
981967
WidgetsSettingsScreen(navController)
982968
}
@@ -1000,10 +986,7 @@ private fun NavGraphBuilder.generalSettings(navController: NavHostController) {
1000986
}
1001987
}
1002988

1003-
private fun NavGraphBuilder.advancedSettings(navController: NavHostController) {
1004-
composableWithDefaultTransitions<Routes.AdvancedSettings> {
1005-
AdvancedSettingsScreen(navController)
1006-
}
989+
private fun NavGraphBuilder.advancedSettingsSubScreens(navController: NavHostController) {
1007990
composableWithDefaultTransitions<Routes.CoinSelectPreference> {
1008991
CoinSelectPreferenceScreen(navController)
1009992
}
@@ -1024,16 +1007,6 @@ private fun NavGraphBuilder.advancedSettings(navController: NavHostController) {
10241007
}
10251008
}
10261009

1027-
private fun NavGraphBuilder.aboutSettings(navController: NavHostController) {
1028-
composableWithDefaultTransitions<Routes.AboutSettings> {
1029-
AboutScreen(
1030-
onBack = {
1031-
navController.popBackStack()
1032-
}
1033-
)
1034-
}
1035-
}
1036-
10371010
private fun NavGraphBuilder.transactionSpeedSettings(navController: NavHostController) {
10381011
composableWithDefaultTransitions<Routes.TransactionSpeedSettings> {
10391012
TransactionSpeedSettingsScreen(navController)
@@ -1043,43 +1016,9 @@ private fun NavGraphBuilder.transactionSpeedSettings(navController: NavHostContr
10431016
}
10441017
}
10451018

1046-
private fun NavGraphBuilder.securitySettings(navController: NavHostController) {
1047-
composableWithDefaultTransitions<Routes.SecuritySettings> {
1048-
SecuritySettingsScreen(navController = navController)
1049-
}
1050-
}
1051-
1052-
private fun NavGraphBuilder.disablePin(navController: NavHostController) {
1053-
composableWithDefaultTransitions<Routes.DisablePin> {
1054-
DisablePinScreen(navController)
1055-
}
1056-
}
1057-
1058-
private fun NavGraphBuilder.changePin(navController: NavHostController) {
1059-
composableWithDefaultTransitions<Routes.ChangePin> {
1060-
ChangePinScreen(navController)
1061-
}
1062-
}
1063-
1064-
private fun NavGraphBuilder.changePinNew(navController: NavHostController) {
1065-
composableWithDefaultTransitions<Routes.ChangePinNew> {
1066-
ChangePinNewScreen(navController)
1067-
}
1068-
}
1069-
1070-
private fun NavGraphBuilder.changePinConfirm(navController: NavHostController) {
1071-
composableWithDefaultTransitions<Routes.ChangePinConfirm> {
1072-
val route = it.toRoute<Routes.ChangePinConfirm>()
1073-
ChangePinConfirmScreen(
1074-
newPin = route.newPin,
1075-
navController = navController,
1076-
)
1077-
}
1078-
}
1079-
1080-
private fun NavGraphBuilder.changePinResult(navController: NavHostController) {
1081-
composableWithDefaultTransitions<Routes.ChangePinResult> {
1082-
ChangePinResultScreen(navController)
1019+
private fun NavGraphBuilder.pinManagement(navController: NavHostController) {
1020+
composableWithDefaultTransitions<Routes.PinManagement> {
1021+
PinManagementScreen(navController)
10831022
}
10841023
}
10851024

@@ -1517,21 +1456,7 @@ inline fun <reified T : Any> NavController.navigateTo(
15171456
}
15181457
}
15191458

1520-
fun NavController.navigateToGeneralSettings() = navigateTo(Routes.GeneralSettings)
1521-
1522-
fun NavController.navigateToSecuritySettings() = navigateTo(Routes.SecuritySettings)
1523-
1524-
fun NavController.navigateToDisablePin() = navigateTo(Routes.DisablePin)
1525-
1526-
fun NavController.navigateToChangePin() = navigateTo(Routes.ChangePin)
1527-
1528-
fun NavController.navigateToChangePinNew() = navigateTo(Routes.ChangePinNew)
1529-
1530-
fun NavController.navigateToChangePinConfirm(newPin: String) = navigateTo(
1531-
Routes.ChangePinConfirm(newPin),
1532-
)
1533-
1534-
fun NavController.navigateToChangePinResult() = navigateTo(Routes.ChangePinResult)
1459+
fun NavController.navigateToPinManagement() = navigateTo(Routes.PinManagement)
15351460

15361461
fun NavController.navigateToAuthCheck(
15371462
showLogoOnPin: Boolean = false,
@@ -1592,9 +1517,6 @@ fun NavController.navigateToTagsSettings() = navigateTo(Routes.TagsSettings)
15921517

15931518
fun NavController.navigateToLanguageSettings() = navigateTo(Routes.LanguageSettings)
15941519

1595-
fun NavController.navigateToAdvancedSettings() = navigateTo(Routes.AdvancedSettings)
1596-
1597-
fun NavController.navigateToAboutSettings() = navigateTo(Routes.AboutSettings)
15981520
// endregion
15991521

16001522
@Stable
@@ -1614,9 +1536,6 @@ sealed interface Routes {
16141536
@Serializable
16151537
data object NodeInfo : Routes
16161538

1617-
@Serializable
1618-
data object GeneralSettings : Routes
1619-
16201539
@Serializable
16211540
data object TransactionSpeedSettings : Routes
16221541

@@ -1626,9 +1545,6 @@ sealed interface Routes {
16261545
@Serializable
16271546
data object TagsSettings : Routes
16281547

1629-
@Serializable
1630-
data object AdvancedSettings : Routes
1631-
16321548
@Serializable
16331549
data object CoinSelectPreference : Routes
16341550

@@ -1644,29 +1560,11 @@ sealed interface Routes {
16441560
@Serializable
16451561
data object AddressViewer : Routes
16461562

1647-
@Serializable
1648-
data object AboutSettings : Routes
1649-
16501563
@Serializable
16511564
data object CustomFeeSettings : Routes
16521565

16531566
@Serializable
1654-
data object SecuritySettings : Routes
1655-
1656-
@Serializable
1657-
data object DisablePin : Routes
1658-
1659-
@Serializable
1660-
data object ChangePin : Routes
1661-
1662-
@Serializable
1663-
data object ChangePinNew : Routes
1664-
1665-
@Serializable
1666-
data class ChangePinConfirm(val newPin: String) : Routes
1667-
1668-
@Serializable
1669-
data object ChangePinResult : Routes
1567+
data object PinManagement : Routes
16701568

16711569
@Serializable
16721570
data class AuthCheck(

app/src/main/java/to/bitkit/ui/components/AuthCheckScreen.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
66
import androidx.navigation.NavController
77
import to.bitkit.ui.Routes
88
import to.bitkit.ui.appViewModel
9-
import to.bitkit.ui.navigateTo
109
import to.bitkit.ui.settingsViewModel
1110

1211
@Composable
@@ -42,12 +41,6 @@ fun AuthCheckScreen(
4241
app.removePin()
4342
navController.popBackStack()
4443
}
45-
46-
AuthCheckAction.NAV_TO_RESET -> {
47-
navController.navigateTo(Routes.ResetAndRestoreSettings) {
48-
popUpTo(Routes.BackupSettings)
49-
}
50-
}
5144
}
5245
},
5346
onBack = { navController.popBackStack() },
@@ -58,5 +51,4 @@ object AuthCheckAction {
5851
const val TOGGLE_BIOMETRICS = "TOGGLE_BIOMETRICS"
5952
const val TOGGLE_PIN_FOR_PAYMENTS = "TOGGLE_PIN_FOR_PAYMENTS"
6053
const val DISABLE_PIN = "DISABLE_PIN"
61-
const val NAV_TO_RESET = "NAV_TO_RESET"
6254
}

0 commit comments

Comments
 (0)