mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-18 19:19:33 +01:00
detekt
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
0b6ed3bcc1
commit
fd6bb5b17e
@ -170,16 +170,7 @@ fun ShowNotificationData(
|
||||
viewState: NotificationUiState,
|
||||
onDismissDialog: () -> Unit
|
||||
) {
|
||||
val message = when (viewState) {
|
||||
is NotificationUiState.Success -> viewState.testNotification ?: context.getString(
|
||||
R.string.nc_push_notification_fetch_error
|
||||
)
|
||||
is NotificationUiState.Error -> String.format(
|
||||
context.getString(R.string.nc_push_notification_error),
|
||||
viewState.message
|
||||
)
|
||||
else -> context.getString(R.string.nc_common_error_sorry)
|
||||
}
|
||||
val message = getMessage(context, viewState)
|
||||
|
||||
if (isLoading) {
|
||||
LoadingIndicator()
|
||||
@ -232,6 +223,19 @@ fun ShowNotificationData(
|
||||
}
|
||||
}
|
||||
|
||||
fun getMessage(context: Context, viewState: NotificationUiState): String {
|
||||
return when (viewState) {
|
||||
is NotificationUiState.Success ->
|
||||
viewState.testNotification ?: context.getString(R.string.nc_push_notification_fetch_error)
|
||||
|
||||
is NotificationUiState.Error ->
|
||||
context.getString(R.string.nc_push_notification_error, viewState.message)
|
||||
|
||||
else ->
|
||||
context.getString(R.string.nc_common_error_sorry)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun DiagnoseContentPreview() {
|
||||
|
Loading…
Reference in New Issue
Block a user