|
@@ -352,10 +352,9 @@ fun HomeTV(navHostController: NavHostController) {
|
|
|
}
|
|
|
.background(Color.Transparent)
|
|
|
) {
|
|
|
- val color = if (isButtonFocused && isConnect == App.CONNECTED) colorResource(id = R.color.blue_text)
|
|
|
+ val color = if (isButtonFocused && isConnect == App.CONNECTED) colorResource(id = R.color.dark_blue_gray_text)
|
|
|
else if (isButtonFocused) colorResource(id = R.color.maroon_text)
|
|
|
else colorResource(id = R.color.transparent)
|
|
|
-
|
|
|
IconButton(
|
|
|
onClick = {
|
|
|
// Toast.makeText(
|
|
@@ -444,7 +443,10 @@ fun HomeTV(navHostController: NavHostController) {
|
|
|
.onFocusChanged {
|
|
|
isButtonFocused = it.isFocused
|
|
|
}
|
|
|
-// .clickable { }
|
|
|
+ .clickable {
|
|
|
+ if (isConnect == App.DISCONNECTED) homeViewModel.setConnectState(App.CONNECTED)
|
|
|
+ else if (isConnect == App.CONNECTED) homeViewModel.setConnectState(App.DISCONNECTED)
|
|
|
+ }
|
|
|
.focusable()
|
|
|
.border(
|
|
|
BorderStroke(
|
|
@@ -510,7 +512,8 @@ fun HomeTV(navHostController: NavHostController) {
|
|
|
basePreferenceHelper,
|
|
|
context,
|
|
|
isTablet(),
|
|
|
- focusRequester2
|
|
|
+ focusRequester2,
|
|
|
+ homeViewModel
|
|
|
)
|
|
|
var smartServer = basePreferenceHelper.getSmartServerObject()
|
|
|
val recommended = basePreferenceHelper.getRecommendedServerObject()
|
|
@@ -528,6 +531,9 @@ fun HomeTV(navHostController: NavHostController) {
|
|
|
}
|
|
|
else -> {}
|
|
|
}
|
|
|
+ val color = if (isSmartButtonFocused && isConnect == App.CONNECTED) colorResource(id = R.color.dark_blue_gray_text)
|
|
|
+ else if (isSmartButtonFocused) colorResource(id = R.color.maroon_text)
|
|
|
+ else colorResource(id = R.color.blue_text)
|
|
|
Button(
|
|
|
onClick = {
|
|
|
// Toast.makeText(
|
|
@@ -589,7 +595,7 @@ fun HomeTV(navHostController: NavHostController) {
|
|
|
shape = RoundedCornerShape(16.dp),
|
|
|
colors = ButtonDefaults.buttonColors(
|
|
|
contentColor = colorResource(id = R.color.white),
|
|
|
- containerColor = if (isSmartButtonFocused) colorResource(id = R.color.maroon_text) else colorResource(id = R.color.blue_text),
|
|
|
+ containerColor = color,
|
|
|
),
|
|
|
) {
|
|
|
Text(
|
|
@@ -608,7 +614,10 @@ fun HomeTV(navHostController: NavHostController) {
|
|
|
// Spacer(modifier = Modifier.weight(1f))
|
|
|
|
|
|
var isLayoutFocused by remember { mutableStateOf(false) }
|
|
|
- val color = if (isLayoutFocused) colorResource(id = R.color.maroon_text) else colorResource(id = R.color.white)
|
|
|
+
|
|
|
+ val color = if (isLayoutFocused && isConnect == App.CONNECTED) colorResource(id = R.color.dark_blue_gray_text)
|
|
|
+ else if (isLayoutFocused) colorResource(id = R.color.maroon_text)
|
|
|
+ else colorResource(id = R.color.white)
|
|
|
Box(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth(fraction = if (isTablet()) 0.5f else 1f)
|
|
@@ -669,7 +678,8 @@ fun BoxScope.AddRowSmartTV(
|
|
|
basePreferenceHelper: BasePreferenceHelper,
|
|
|
context: Context,
|
|
|
isTablet: Boolean,
|
|
|
- focusRequester2: FocusRequester
|
|
|
+ focusRequester2: FocusRequester,
|
|
|
+ homeViewModel: HomeViewModel
|
|
|
) {
|
|
|
val smart = basePreferenceHelper.getSmartServerObject()
|
|
|
val recommended = basePreferenceHelper.getRecommendedServerObject()
|
|
@@ -764,6 +774,12 @@ fun BoxScope.AddRowSmartTV(
|
|
|
.padding(start = 15.dp),
|
|
|
color = Color.Transparent
|
|
|
) {
|
|
|
+ var isConnect: Int? = homeViewModel.isConnect.observeAsState().value
|
|
|
+ isConnect = basePreferenceHelper.getConnectState()
|
|
|
+
|
|
|
+ val color = if (isButtonFocused && isConnect == App.CONNECTED) colorResource(id = R.color.dark_blue_gray_text)
|
|
|
+ else if (isButtonFocused) colorResource(id = R.color.maroon_text)
|
|
|
+ else colorResource(id = R.color.blue_text)
|
|
|
ClickableText(
|
|
|
modifier = Modifier
|
|
|
.onKeyEvent {
|
|
@@ -794,7 +810,7 @@ fun BoxScope.AddRowSmartTV(
|
|
|
text = AnnotatedString("Change"),
|
|
|
style = MaterialTheme.typography.customTypography.headlineMedium.copy(
|
|
|
// MaterialTheme.colorScheme.surfaceContainerLow,
|
|
|
- color = if (isButtonFocused) colorResource(id = R.color.maroon_text) else colorResource(id = R.color.blue_text),
|
|
|
+ color = color,
|
|
|
fontSize = if (isTablet()) 20.sp else 14.sp
|
|
|
),
|
|
|
onClick = {},
|