Remove default value for lambda.
We enforce a value to be provided and it's better for code code coverage.
This commit is contained in:
parent
202173c8e3
commit
542de5a487
2 changed files with 12 additions and 5 deletions
|
|
@ -51,9 +51,9 @@ import io.element.android.libraries.ui.strings.CommonStrings
|
||||||
@Composable
|
@Composable
|
||||||
fun RoomNotificationSettingsView(
|
fun RoomNotificationSettingsView(
|
||||||
state: RoomNotificationSettingsState,
|
state: RoomNotificationSettingsState,
|
||||||
|
onShowGlobalNotifications: () -> Unit,
|
||||||
|
onBackPressed: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
onShowGlobalNotifications: () -> Unit = {},
|
|
||||||
onBackPressed: () -> Unit = {},
|
|
||||||
) {
|
) {
|
||||||
if (state.showUserDefinedSettingStyle) {
|
if (state.showUserDefinedSettingStyle) {
|
||||||
UserDefinedRoomNotificationSettingsView(
|
UserDefinedRoomNotificationSettingsView(
|
||||||
|
|
@ -193,5 +193,9 @@ private fun RoomNotificationSettingsTopBar(
|
||||||
internal fun RoomNotificationSettingsPreview(
|
internal fun RoomNotificationSettingsPreview(
|
||||||
@PreviewParameter(RoomNotificationSettingsStateProvider::class) state: RoomNotificationSettingsState
|
@PreviewParameter(RoomNotificationSettingsStateProvider::class) state: RoomNotificationSettingsState
|
||||||
) = ElementPreview {
|
) = ElementPreview {
|
||||||
RoomNotificationSettingsView(state)
|
RoomNotificationSettingsView(
|
||||||
|
state = state,
|
||||||
|
onShowGlobalNotifications = {},
|
||||||
|
onBackPressed = {},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ import io.element.android.libraries.designsystem.theme.components.TopAppBar
|
||||||
@Composable
|
@Composable
|
||||||
fun UserDefinedRoomNotificationSettingsView(
|
fun UserDefinedRoomNotificationSettingsView(
|
||||||
state: RoomNotificationSettingsState,
|
state: RoomNotificationSettingsState,
|
||||||
|
onBackPressed: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
onBackPressed: () -> Unit = {},
|
|
||||||
) {
|
) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
|
|
@ -120,5 +120,8 @@ private fun UserDefinedRoomNotificationSettingsTopBar(
|
||||||
internal fun UserDefinedRoomNotificationSettingsPreview(
|
internal fun UserDefinedRoomNotificationSettingsPreview(
|
||||||
@PreviewParameter(UserDefinedRoomNotificationSettingsStateProvider::class) state: RoomNotificationSettingsState
|
@PreviewParameter(UserDefinedRoomNotificationSettingsStateProvider::class) state: RoomNotificationSettingsState
|
||||||
) = ElementPreview {
|
) = ElementPreview {
|
||||||
UserDefinedRoomNotificationSettingsView(state)
|
UserDefinedRoomNotificationSettingsView(
|
||||||
|
state = state,
|
||||||
|
onBackPressed = {},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue