Skip to content

Commit

Permalink
Use TextButton for AlertDialogs
Browse files Browse the repository at this point in the history
Signed-off-by: iTaysonLab <[email protected]>
  • Loading branch information
iTaysonLab committed Jun 6, 2022
1 parent 5140d6d commit c804996
Showing 1 changed file with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}
})
}

Expand All @@ -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))
}
})
}
}
Expand Down

0 comments on commit c804996

Please sign in to comment.