Add Notifications section in app settings
This commit is contained in:
parent
b326ca28cc
commit
e8b80b9a55
4 changed files with 19 additions and 0 deletions
1
changelog.d/510.misc
Normal file
1
changelog.d/510.misc
Normal file
|
|
@ -0,0 +1 @@
|
|||
Add a sub-screen "Notifications" in the existing application Settings
|
||||
|
|
@ -90,6 +90,10 @@ class PreferencesFlowNode @AssistedInject constructor(
|
|||
override fun onOpenDeveloperSettings() {
|
||||
backstack.push(NavTarget.DeveloperSettings)
|
||||
}
|
||||
|
||||
override fun onOpenNotificationSettings() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
createNode<PreferencesRootNode>(buildContext, plugins = listOf(callback))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class PreferencesRootNode @AssistedInject constructor(
|
|||
fun onOpenAnalytics()
|
||||
fun onOpenAbout()
|
||||
fun onOpenDeveloperSettings()
|
||||
fun onOpenNotificationSettings()
|
||||
}
|
||||
|
||||
private fun onOpenBugReport() {
|
||||
|
|
@ -72,6 +73,10 @@ class PreferencesRootNode @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun onOpenNotificationSettings() {
|
||||
plugins<Callback>().forEach { it.onOpenNotificationSettings() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val state = presenter.present()
|
||||
|
|
@ -87,6 +92,7 @@ class PreferencesRootNode @AssistedInject constructor(
|
|||
onOpenDeveloperSettings = this::onOpenDeveloperSettings,
|
||||
onSuccessLogout = { onSuccessLogout(activity, it) },
|
||||
onManageAccountClicked = { onManageAccountClicked(activity, state.accountManagementUrl) },
|
||||
onOpenNotificationSettings = this::onOpenNotificationSettings
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import androidx.compose.material.icons.outlined.DeveloperMode
|
|||
import androidx.compose.material.icons.outlined.Help
|
||||
import androidx.compose.material.icons.outlined.InsertChart
|
||||
import androidx.compose.material.icons.outlined.ManageAccounts
|
||||
import androidx.compose.material.icons.outlined.Notifications
|
||||
import androidx.compose.material.icons.outlined.VerifiedUser
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
|
@ -58,6 +59,7 @@ fun PreferencesRootView(
|
|||
onOpenAbout: () -> Unit,
|
||||
onOpenDeveloperSettings: () -> Unit,
|
||||
onSuccessLogout: (String?) -> Unit,
|
||||
onOpenNotificationSettings: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val snackbarHostState = rememberSnackbarHostState(snackbarMessage = state.snackbarMessage)
|
||||
|
|
@ -92,6 +94,11 @@ fun PreferencesRootView(
|
|||
onClick = onOpenAnalytics,
|
||||
)
|
||||
}
|
||||
PreferenceText(
|
||||
title = "Notifications",
|
||||
icon = Icons.Outlined.Notifications,
|
||||
onClick = onOpenNotificationSettings,
|
||||
)
|
||||
PreferenceText(
|
||||
title = stringResource(id = CommonStrings.action_report_bug),
|
||||
icon = Icons.Outlined.BugReport,
|
||||
|
|
@ -153,5 +160,6 @@ private fun ContentToPreview(matrixUser: MatrixUser) {
|
|||
onVerifyClicked = {},
|
||||
onSuccessLogout = {},
|
||||
onManageAccountClicked = {},
|
||||
onOpenNotificationSettings = {},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue