mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +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,
|
viewState: NotificationUiState,
|
||||||
onDismissDialog: () -> Unit
|
onDismissDialog: () -> Unit
|
||||||
) {
|
) {
|
||||||
val message = when (viewState) {
|
val message = getMessage(context, 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)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
LoadingIndicator()
|
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)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
fun DiagnoseContentPreview() {
|
fun DiagnoseContentPreview() {
|
||||||
|
Loading…
Reference in New Issue
Block a user