Skip to content

Commit fd3a4aa

Browse files
committed
show settings option when there is no internet connection
Signed-off-by: sowjanyakch <[email protected]>
1 parent ddbe89d commit fd3a4aa

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogCompose.kt

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,12 @@ private fun ChooseAccountDialogContent(
364364
}
365365
}
366366
}
367-
if (isOnline) {
368-
OnlineActions(
369-
onAddAccountClick = onAddAccountClick,
370-
onOpenSettingsClick = onOpenSettingsClick
371-
)
372-
}
367+
368+
OnlineActions(
369+
onAddAccountClick = onAddAccountClick,
370+
onOpenSettingsClick = onOpenSettingsClick,
371+
isOnline = isOnline
372+
)
373373
}
374374
}
375375
}
@@ -470,23 +470,25 @@ private fun StatusActionButtons(onSetOnlineStatusClick: () -> Unit, onSetStatusM
470470
}
471471

472472
@Composable
473-
private fun OnlineActions(onAddAccountClick: () -> Unit, onOpenSettingsClick: () -> Unit) {
474-
TextButton(onClick = onAddAccountClick, modifier = Modifier.fillMaxWidth()) {
475-
Row(
476-
modifier = Modifier.padding(start = 16.dp, top = 8.dp).fillMaxWidth(),
477-
verticalAlignment = Alignment.CenterVertically
478-
) {
479-
Icon(
480-
painterResource(R.drawable.ic_account_plus),
481-
contentDescription = null,
482-
tint = colorResource(id = R.color.high_emphasis_text)
483-
)
484-
Spacer(Modifier.size(16.dp))
485-
Text(
486-
stringResource(R.string.nc_account_chooser_add_account),
487-
color = colorResource(id = R.color.high_emphasis_text),
488-
fontWeight = FontWeight.Bold
489-
)
473+
private fun OnlineActions(onAddAccountClick: () -> Unit, onOpenSettingsClick: () -> Unit, isOnline: Boolean) {
474+
if (isOnline) {
475+
TextButton(onClick = onAddAccountClick, modifier = Modifier.fillMaxWidth()) {
476+
Row(
477+
modifier = Modifier.padding(start = 16.dp, top = 8.dp).fillMaxWidth(),
478+
verticalAlignment = Alignment.CenterVertically
479+
) {
480+
Icon(
481+
painterResource(R.drawable.ic_account_plus),
482+
contentDescription = null,
483+
tint = colorResource(id = R.color.high_emphasis_text)
484+
)
485+
Spacer(Modifier.size(16.dp))
486+
Text(
487+
stringResource(R.string.nc_account_chooser_add_account),
488+
color = colorResource(id = R.color.high_emphasis_text),
489+
fontWeight = FontWeight.Bold
490+
)
491+
}
490492
}
491493
}
492494

0 commit comments

Comments
 (0)