Add new drawable resources for icons and themes

- Created `archive_filled.xml` for filled archive icon.
- Added `bookmark_outlined.xml` for outlined bookmark icon.
- Introduced `day_theme_filled.xml` for day theme icon.
- Added `folder_outlined.xml` for outlined folder icon.
- Created `gear_outlined.xml` for outlined gear icon.
- Introduced `night_mode.xml` for night mode icon.
This commit is contained in:
2026-02-13 17:37:03 +05:00
parent e17b03c1c5
commit 93ce53d3d5
30 changed files with 1269 additions and 147 deletions

View File

@@ -415,6 +415,16 @@ class MainActivity : FragmentActivity() {
publicKey = acc.publicKey
)
}
},
onSwitchAccount = { targetPublicKey ->
// Switch to another account: logout current, then auto-login target
currentAccount = null
scope.launch {
com.rosetta.messenger.network.ProtocolManager.disconnect()
accountManager.logout()
// Set the target account as last logged so UnlockScreen picks it up
accountManager.setLastLoggedPublicKey(targetPublicKey)
}
}
)
}
@@ -560,7 +570,8 @@ fun MainScreen(
onThemeModeChange: (String) -> Unit = {},
onLogout: () -> Unit = {},
onDeleteAccount: () -> Unit = {},
onAccountInfoUpdated: suspend () -> Unit = {}
onAccountInfoUpdated: suspend () -> Unit = {},
onSwitchAccount: (String) -> Unit = {}
) {
// Reactive state for account name and username
var accountName by remember { mutableStateOf(account?.name ?: "Account") }
@@ -754,7 +765,12 @@ fun MainScreen(
},
chatsViewModel = chatsListViewModel,
avatarRepository = avatarRepository,
onLogout = onLogout
onLogout = onLogout,
onAddAccount = {
// Logout current account and go to auth screen to add new one
onLogout()
},
onSwitchAccount = onSwitchAccount
)
SwipeBackContainer(