|
@@ -7,6 +7,7 @@ import android.os.Looper
|
|
import android.util.Log
|
|
import android.util.Log
|
|
import android.widget.Toast
|
|
import android.widget.Toast
|
|
import androidx.activity.compose.BackHandler
|
|
import androidx.activity.compose.BackHandler
|
|
|
|
+import androidx.compose.foundation.BorderStroke
|
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
import androidx.compose.foundation.Image
|
|
import androidx.compose.foundation.Image
|
|
import androidx.compose.foundation.LocalOverscrollConfiguration
|
|
import androidx.compose.foundation.LocalOverscrollConfiguration
|
|
@@ -225,7 +226,7 @@ fun AccountTV(navHostController: NavHostController,
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
.height(228.dp)
|
|
.height(228.dp)
|
|
) {
|
|
) {
|
|
- LogoutDialog("Logout Account",
|
|
|
|
|
|
+ LogoutDialogTV("Logout Account",
|
|
"Are you sure to logout the account?",
|
|
"Are you sure to logout the account?",
|
|
onCancel = {
|
|
onCancel = {
|
|
isLoggedOut = false
|
|
isLoggedOut = false
|
|
@@ -249,7 +250,7 @@ fun AccountTV(navHostController: NavHostController,
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
.height(228.dp)
|
|
.height(228.dp)
|
|
) {
|
|
) {
|
|
- LogoutDialog("Delete Account",
|
|
|
|
|
|
+ LogoutDialogTV("Delete Account",
|
|
"Are you sure to delete the account?",
|
|
"Are you sure to delete the account?",
|
|
onCancel = { isDelete = false },
|
|
onCancel = { isDelete = false },
|
|
settingsNavHostController,
|
|
settingsNavHostController,
|
|
@@ -306,13 +307,17 @@ fun AccountTV(navHostController: NavHostController,
|
|
|
|
|
|
val deleteResponse = accountViewModel.liveDataDelete.observeAsState().value
|
|
val deleteResponse = accountViewModel.liveDataDelete.observeAsState().value
|
|
deleteResponse?.let {
|
|
deleteResponse?.let {
|
|
|
|
+ Log.d("test_api_response","Delete Response")
|
|
|
|
+// Toast.makeText(
|
|
|
|
+// context, "API Response IN", Toast.LENGTH_SHORT
|
|
|
|
+// ).show()
|
|
accountViewModel.setLogoutStatus(false)
|
|
accountViewModel.setLogoutStatus(false)
|
|
if (it.status) {
|
|
if (it.status) {
|
|
Log.d("test_api_response","Delete live: ${deleteResponse.status}")
|
|
Log.d("test_api_response","Delete live: ${deleteResponse.status}")
|
|
basePreferenceHelper.setLoggedInState(false)
|
|
basePreferenceHelper.setLoggedInState(false)
|
|
basePreferenceHelper.clearAllData()
|
|
basePreferenceHelper.clearAllData()
|
|
settingsNavHostController.popBackStack()
|
|
settingsNavHostController.popBackStack()
|
|
- settingsNavHostController.navigate(Screen.Started.route)
|
|
|
|
|
|
+ settingsNavHostController.navigate(ScreenTV.LoginTV.route)
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
Log.d("test_api_response","Delete false: ${deleteResponse.status}")
|
|
Log.d("test_api_response","Delete false: ${deleteResponse.status}")
|
|
@@ -584,6 +589,9 @@ fun BoxScope.LogoutDialogTV(
|
|
val homeViewModel: HomeViewModel = viewModel {
|
|
val homeViewModel: HomeViewModel = viewModel {
|
|
HomeViewModel(context, scope)
|
|
HomeViewModel(context, scope)
|
|
}
|
|
}
|
|
|
|
+ var isButtonFocused1 by remember { mutableStateOf(false) }
|
|
|
|
+ var isButtonFocused2 by remember { mutableStateOf(false) }
|
|
|
|
+
|
|
Surface(
|
|
Surface(
|
|
color = colorResource(id = R.color.white),
|
|
color = colorResource(id = R.color.white),
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
@@ -596,17 +604,17 @@ fun BoxScope.LogoutDialogTV(
|
|
verticalArrangement = Arrangement.Top,
|
|
verticalArrangement = Arrangement.Top,
|
|
horizontalAlignment = Alignment.CenterHorizontally,
|
|
horizontalAlignment = Alignment.CenterHorizontally,
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
- .background(MaterialTheme.colorScheme.onBackground)
|
|
|
|
|
|
+ .background(Color.White)
|
|
) {
|
|
) {
|
|
Log.d("islogoutClicked", "AlertDialog")
|
|
Log.d("islogoutClicked", "AlertDialog")
|
|
|
|
|
|
Text(text = title,
|
|
Text(text = title,
|
|
- color = MaterialTheme.colorScheme.inversePrimary,
|
|
|
|
|
|
+ color = colorResource(id = R.color.dark_blue_gray_text),
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
modifier = Modifier.padding(top = 45.dp)
|
|
modifier = Modifier.padding(top = 45.dp)
|
|
)
|
|
)
|
|
Text(text = desc,
|
|
Text(text = desc,
|
|
- color = MaterialTheme.colorScheme.inversePrimary,
|
|
|
|
|
|
+ color = colorResource(id = R.color.dark_blue_gray_text),
|
|
style = MaterialTheme.typography.labelSmall,
|
|
style = MaterialTheme.typography.labelSmall,
|
|
maxLines = 2,
|
|
maxLines = 2,
|
|
modifier = Modifier.padding(top = 26.dp)
|
|
modifier = Modifier.padding(top = 26.dp)
|
|
@@ -629,15 +637,18 @@ fun BoxScope.LogoutDialogTV(
|
|
start = 15.dp, end = 5.dp,
|
|
start = 15.dp, end = 5.dp,
|
|
bottom = 0.dp, top = 0.dp
|
|
bottom = 0.dp, top = 0.dp
|
|
)
|
|
)
|
|
|
|
+ .onFocusChanged {
|
|
|
|
+ isButtonFocused1 = it.isFocused
|
|
|
|
+ }
|
|
.background(colorResource(id = R.color.transparent))
|
|
.background(colorResource(id = R.color.transparent))
|
|
.weight(1F)
|
|
.weight(1F)
|
|
.height(52.dp),
|
|
.height(52.dp),
|
|
-
|
|
|
|
shape = RoundedCornerShape(15.dp),
|
|
shape = RoundedCornerShape(15.dp),
|
|
colors = ButtonDefaults.buttonColors(
|
|
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),
|
|
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",
|
|
Text(text = "No",
|
|
@@ -681,14 +692,19 @@ fun BoxScope.LogoutDialogTV(
|
|
start = 5.dp, end = 15.dp,
|
|
start = 5.dp, end = 15.dp,
|
|
bottom = 0.dp, top = 0.dp
|
|
bottom = 0.dp, top = 0.dp
|
|
)
|
|
)
|
|
|
|
+ .onFocusChanged {
|
|
|
|
+ isButtonFocused2 = it.isFocused
|
|
|
|
+ }
|
|
.background(colorResource(id = R.color.transparent))
|
|
.background(colorResource(id = R.color.transparent))
|
|
.weight(1F)
|
|
.weight(1F)
|
|
.height(52.dp),
|
|
.height(52.dp),
|
|
shape = RoundedCornerShape(15.dp),
|
|
shape = RoundedCornerShape(15.dp),
|
|
colors = ButtonDefaults.buttonColors(
|
|
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),
|
|
containerColor = colorResource(id = R.color.red),
|
|
),
|
|
),
|
|
|
|
+ border = BorderStroke(2.dp, if (isButtonFocused2) colorResource(id = R.color.dark_blue_gray_text) else colorResource(id = R.color.red))
|
|
|
|
+
|
|
// border = BorderStroke(2.dp,
|
|
// border = BorderStroke(2.dp,
|
|
// colorResource(id = R.color.gray_icon))
|
|
// colorResource(id = R.color.gray_icon))
|
|
)
|
|
)
|