|
@@ -7,10 +7,13 @@ import android.os.Handler
|
|
|
import android.os.Looper
|
|
|
import android.util.Log
|
|
|
import android.widget.Toast
|
|
|
+import androidx.compose.foundation.BorderStroke
|
|
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
|
import androidx.compose.foundation.Image
|
|
|
import androidx.compose.foundation.LocalOverscrollConfiguration
|
|
|
import androidx.compose.foundation.background
|
|
|
+import androidx.compose.foundation.clickable
|
|
|
+import androidx.compose.foundation.focusable
|
|
|
import androidx.compose.foundation.gestures.detectTapGestures
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
import androidx.compose.foundation.layout.Box
|
|
@@ -48,6 +51,9 @@ import androidx.compose.runtime.setValue
|
|
|
import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.draw.alpha
|
|
|
+import androidx.compose.ui.focus.FocusRequester
|
|
|
+import androidx.compose.ui.focus.focusRequester
|
|
|
+import androidx.compose.ui.focus.onFocusChanged
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
import androidx.compose.ui.graphics.ColorFilter
|
|
|
import androidx.compose.ui.graphics.painter.Painter
|
|
@@ -512,6 +518,10 @@ fun BoxScope.LogoutDialog(
|
|
|
val homeViewModel: HomeViewModel = viewModel {
|
|
|
HomeViewModel(context, scope)
|
|
|
}
|
|
|
+ var isButtonFocused1 by remember { mutableStateOf(false) }
|
|
|
+ var isButtonFocused2 by remember { mutableStateOf(false) }
|
|
|
+ val focusRequester = remember { FocusRequester() }
|
|
|
+
|
|
|
Surface(
|
|
|
color = colorResource(id = R.color.white),
|
|
|
modifier = Modifier
|
|
@@ -524,17 +534,20 @@ fun BoxScope.LogoutDialog(
|
|
|
verticalArrangement = Arrangement.Top,
|
|
|
horizontalAlignment = Alignment.CenterHorizontally,
|
|
|
modifier = Modifier
|
|
|
- .background(MaterialTheme.colorScheme.onBackground)
|
|
|
+// .background(MaterialTheme.colorScheme.onBackground)
|
|
|
+ .background(Color.White)
|
|
|
) {
|
|
|
Log.d("islogoutClicked", "AlertDialog")
|
|
|
|
|
|
Text(text = title,
|
|
|
- color = MaterialTheme.colorScheme.primary,
|
|
|
+// color = MaterialTheme.colorScheme.primary,
|
|
|
+ color = colorResource(id = R.color.dark_blue_gray_text),
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
modifier = Modifier.padding(top = 45.dp)
|
|
|
)
|
|
|
Text(text = desc,
|
|
|
- color = MaterialTheme.colorScheme.primary,
|
|
|
+// color = MaterialTheme.colorScheme.primary,
|
|
|
+ color = colorResource(id = R.color.dark_blue_gray_text),
|
|
|
style = MaterialTheme.typography.labelSmall,
|
|
|
maxLines = 2,
|
|
|
modifier = Modifier.padding(top = 26.dp)
|
|
@@ -557,15 +570,19 @@ fun BoxScope.LogoutDialog(
|
|
|
start = 15.dp, end = 5.dp,
|
|
|
bottom = 0.dp, top = 0.dp
|
|
|
)
|
|
|
+ .onFocusChanged {
|
|
|
+ isButtonFocused1 = it.isFocused
|
|
|
+ }
|
|
|
.background(colorResource(id = R.color.transparent))
|
|
|
.weight(1F)
|
|
|
.height(52.dp),
|
|
|
|
|
|
shape = RoundedCornerShape(15.dp),
|
|
|
colors = ButtonDefaults.buttonColors(
|
|
|
- contentColor = colorResource(id = R.color.white),
|
|
|
+ contentColor = if (isButtonFocused1) colorResource(id = R.color.dark_blue_gray_text) else colorResource(id = R.color.white),
|
|
|
containerColor = colorResource(id = R.color.light_blue),
|
|
|
),
|
|
|
+ border = BorderStroke(2.dp, if (isButtonFocused1) colorResource(id = R.color.dark_blue_gray_text) else colorResource(id = R.color.light_blue))
|
|
|
)
|
|
|
{
|
|
|
Text(text = "No",
|
|
@@ -610,15 +627,17 @@ fun BoxScope.LogoutDialog(
|
|
|
bottom = 0.dp, top = 0.dp
|
|
|
)
|
|
|
.background(colorResource(id = R.color.transparent))
|
|
|
+ .onFocusChanged {
|
|
|
+ isButtonFocused2 = it.isFocused
|
|
|
+ }
|
|
|
.weight(1F)
|
|
|
.height(52.dp),
|
|
|
shape = RoundedCornerShape(15.dp),
|
|
|
colors = ButtonDefaults.buttonColors(
|
|
|
- contentColor = colorResource(id = R.color.white),
|
|
|
+ contentColor = if (isButtonFocused2) colorResource(id = R.color.dark_blue_gray_text) else colorResource(id = R.color.white),
|
|
|
containerColor = colorResource(id = R.color.red),
|
|
|
),
|
|
|
-// border = BorderStroke(2.dp,
|
|
|
-// colorResource(id = R.color.gray_icon))
|
|
|
+ border = BorderStroke(2.dp, if (isButtonFocused2) colorResource(id = R.color.dark_blue_gray_text) else colorResource(id = R.color.red))
|
|
|
)
|
|
|
{
|
|
|
Text(text = "Yes",
|