From c804996f12f13f96b2ec4dfefb6c22052b4e74a3 Mon Sep 17 00:00:00 2001 From: iTaysonLab <9827543+iTaysonLab@users.noreply.github.com> Date: Mon, 6 Jun 2022 15:57:34 +0200 Subject: [PATCH] Use TextButton for AlertDialogs Signed-off-by: iTaysonLab <9827543+iTaysonLab@users.noreply.github.com> --- .../itaysonlab/jetispot/ui/AppNavigation.kt | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/bruhcollective/itaysonlab/jetispot/ui/AppNavigation.kt b/app/src/main/java/bruhcollective/itaysonlab/jetispot/ui/AppNavigation.kt index 276959dc..1724d72f 100644 --- a/app/src/main/java/bruhcollective/itaysonlab/jetispot/ui/AppNavigation.kt +++ b/app/src/main/java/bruhcollective/itaysonlab/jetispot/ui/AppNavigation.kt @@ -10,10 +10,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Warning -import androidx.compose.material3.AlertDialog -import androidx.compose.material3.CircularProgressIndicator -import androidx.compose.material3.Icon -import androidx.compose.material3.Text +import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.runtime.LaunchedEffect @@ -122,11 +119,9 @@ fun AppNavigation( }, text = { Text(stringResource(id = R.string.auth_disclaimer_text)) }, confirmButton = { - Text( - stringResource(id = R.string.logout_confirm), - Modifier - .clickable { navController.popBackStack() } - .padding(16.dp)) + TextButton(onClick = { navController.popBackStack() }) { + Text(stringResource(id = R.string.logout_confirm)) + } }) } @@ -138,19 +133,17 @@ fun AppNavigation( }, text = { Text(stringResource(id = R.string.logout_message)) }, confirmButton = { - Text(stringResource(id = R.string.logout_confirm), - Modifier - .clickable { - navController.popBackStack() - authManager.reset() - android.os.Process.killProcess(android.os.Process.myPid()) // TODO: maybe dynamic restart the session instances? - } - .padding(16.dp)) + TextButton(onClick = { + navController.popBackStack() + authManager.reset() + android.os.Process.killProcess(android.os.Process.myPid()) // TODO: maybe dynamic restart the session instances? + }) { + Text(stringResource(id = R.string.logout_confirm)) + } }, dismissButton = { - Text(stringResource(id = R.string.logout_cancel), - Modifier - .clickable { navController.popBackStack() } - .padding(16.dp)) + TextButton(onClick = { navController.popBackStack() }) { + Text(stringResource(id = R.string.logout_cancel)) + } }) } }