|
@@ -623,22 +623,11 @@ fun HomeTV(
|
|
|
when (it.key) {
|
|
|
Key.DirectionDown -> {
|
|
|
Log.d("test_settings_keys", "DirectionDown")
|
|
|
-// Toast
|
|
|
-// .makeText(
|
|
|
-// context, "DirectionDown", Toast.LENGTH_SHORT
|
|
|
-// )
|
|
|
-// .show()
|
|
|
if (it.type == KeyEventType.KeyDown) {
|
|
|
-// Toast
|
|
|
-// .makeText(
|
|
|
-// context, "KeyDown", Toast.LENGTH_SHORT
|
|
|
-// )
|
|
|
-// .show()
|
|
|
focusRequester2.requestFocus()
|
|
|
}
|
|
|
true
|
|
|
}
|
|
|
-
|
|
|
else -> {
|
|
|
true
|
|
|
}
|
|
@@ -690,11 +679,7 @@ fun HomeTV(
|
|
|
// else if (isConnect == App.CONNECTED) homeViewModel.setConnectState(App.DISCONNECTED)
|
|
|
}
|
|
|
.focusable()
|
|
|
- .border(
|
|
|
- BorderStroke(
|
|
|
- 2.dp, color
|
|
|
- ), shape = CircleShape
|
|
|
- ),
|
|
|
+ ,
|
|
|
)
|
|
|
{
|
|
|
if (isConnect == App.CONNECTED) {
|
|
@@ -704,7 +689,13 @@ fun HomeTV(
|
|
|
// painter = painterResource(id = R.drawable.iv_connect),
|
|
|
contentDescription = "Home Map",
|
|
|
contentScale = ContentScale.FillBounds,
|
|
|
- modifier = Modifier.fillMaxSize()
|
|
|
+ modifier = Modifier
|
|
|
+ .size(150.dp)
|
|
|
+ .border(
|
|
|
+ BorderStroke(
|
|
|
+ 2.dp, color
|
|
|
+ ), shape = CircleShape
|
|
|
+ )
|
|
|
)
|
|
|
} else {
|
|
|
Image(
|
|
@@ -713,7 +704,13 @@ fun HomeTV(
|
|
|
// painter = painterResource(id = R.drawable.iv_disconnect),
|
|
|
contentDescription = "Home Map",
|
|
|
contentScale = ContentScale.FillBounds,
|
|
|
- modifier = Modifier.fillMaxSize()
|
|
|
+ modifier = Modifier
|
|
|
+ .size(150.dp)
|
|
|
+ .border(
|
|
|
+ BorderStroke(
|
|
|
+ 2.dp, color
|
|
|
+ ), shape = CircleShape
|
|
|
+ )
|
|
|
)
|
|
|
}
|
|
|
}
|
|
@@ -773,53 +770,16 @@ fun HomeTV(
|
|
|
}
|
|
|
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)
|
|
|
+ val color = if (isSmartButtonFocused && isConnect == App.CONNECTED) MaterialTheme.colorScheme.primary
|
|
|
+ else if (isSmartButtonFocused) MaterialTheme.colorScheme.primary
|
|
|
else colorResource(id = R.color.blue_text)
|
|
|
Button(
|
|
|
- onClick = {
|
|
|
-// Log.d("test_button", "onClick Smart Connect ${smartServer?.server_name}")
|
|
|
-// basePreferenceHelper.setSmartServerObject(smartServer)
|
|
|
-// if (isConnect == App.CONNECTED) {
|
|
|
-// Log.d("isConnect_State_vpn", "stopVPN")
|
|
|
-// val lastServer = basePreferenceHelper.getConnectedServer()
|
|
|
-// Log.d("test_conn_ser_obj", "smart => ${lastServer?.server_name} ${smartServer?.server_name}")
|
|
|
-//
|
|
|
-// if (lastServer?.id != smartServer?.id) {
|
|
|
-// isServerDialog.value = true
|
|
|
-// if (smartServer != null) {
|
|
|
-// serverObj.value = smartServer
|
|
|
-// }
|
|
|
-//// basePreferenceHelper.setConnectedServer(smartServer)
|
|
|
-//
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// vpnConnectionsUtil.stopVpn()
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//// vpnConnectionsUtil.stopVpn()
|
|
|
-//// Handler().postDelayed(Runnable {
|
|
|
-//// vpnConnectionsUtil.startVpn()
|
|
|
-//// }, 500)
|
|
|
-//// homeViewModel.getIp()
|
|
|
-// }
|
|
|
-// else if (isConnect == App.CONNECTING) {
|
|
|
-// vpnConnectionsUtil.stopVpn()
|
|
|
-// }
|
|
|
-// else if (isConnect == App.DISCONNECTED) {
|
|
|
-// Log.d("isConnect_State_vpn", "startVPN")
|
|
|
-// basePreferenceHelper.setConnectedServer(smartServer)
|
|
|
-// if (smartServer != null) {
|
|
|
-//// serverListViewModel.setRecentlyConnectedServer(smartServer)
|
|
|
-// }
|
|
|
-// vpnConnectionsUtil.startVpn()
|
|
|
-// }
|
|
|
- },
|
|
|
+ onClick = {},
|
|
|
modifier = Modifier
|
|
|
.padding(start = 14.dp, end = 14.dp, bottom = 6.dp, top = 12.dp)
|
|
|
.align(Alignment.BottomCenter)
|
|
|
- .background(colorResource(id = R.color.transparent))
|
|
|
+ .background(MaterialTheme.colorScheme.onBackground, RoundedCornerShape(16.dp))
|
|
|
+ .border(2.dp, color, RoundedCornerShape(16.dp))
|
|
|
.onFocusChanged {
|
|
|
isSmartButtonFocused = it.isFocused
|
|
|
}
|
|
@@ -870,7 +830,7 @@ fun HomeTV(
|
|
|
shape = RoundedCornerShape(16.dp),
|
|
|
colors = ButtonDefaults.buttonColors(
|
|
|
contentColor = colorResource(id = R.color.white),
|
|
|
- containerColor = color,
|
|
|
+ containerColor = colorResource(id = R.color.blue_text),
|
|
|
),
|
|
|
) {
|
|
|
Text(
|
|
@@ -890,7 +850,7 @@ fun HomeTV(
|
|
|
|
|
|
var isLayoutFocused by remember { mutableStateOf(false) }
|
|
|
val color = if (isLayoutFocused && isConnect == App.CONNECTED) MaterialTheme.colorScheme.primary
|
|
|
- else if (isLayoutFocused) colorResource(id = R.color.maroon_text)
|
|
|
+ else if (isLayoutFocused) MaterialTheme.colorScheme.primary
|
|
|
else MaterialTheme.colorScheme.onBackground
|
|
|
Box(
|
|
|
modifier = Modifier
|
|
@@ -900,11 +860,6 @@ fun HomeTV(
|
|
|
.height(50.dp)
|
|
|
.onKeyEvent {
|
|
|
if (it.type == KeyEventType.KeyDown && it.key == Key.DirectionDown) {
|
|
|
-// Toast
|
|
|
-// .makeText(
|
|
|
-// context, "KeyDown & DirectionDown", Toast.LENGTH_SHORT
|
|
|
-// )
|
|
|
-// .show()
|
|
|
isFirstItemPressed.value = true
|
|
|
true
|
|
|
} else {
|
|
@@ -919,9 +874,6 @@ fun HomeTV(
|
|
|
indication = null,
|
|
|
interactionSource = remember { MutableInteractionSource() }
|
|
|
) {
|
|
|
-// Toast
|
|
|
-// .makeText(context, "See All Pressed", Toast.LENGTH_SHORT)
|
|
|
-// .show()
|
|
|
toChangeServer.value = false
|
|
|
navHostController.navigate(
|
|
|
ScreenTV.ServerListTV.route
|
|
@@ -1355,9 +1307,9 @@ fun BoxScope.AddRowSmartTV(
|
|
|
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)
|
|
|
+ val color = if (isButtonFocused && isConnect == App.CONNECTED) MaterialTheme.colorScheme.primary
|
|
|
+ else if (isButtonFocused) MaterialTheme.colorScheme.primary
|
|
|
+ else MaterialTheme.colorScheme.surfaceContainerLow
|
|
|
ClickableText(
|
|
|
modifier = Modifier
|
|
|
.onKeyEvent {
|
|
@@ -1387,8 +1339,8 @@ fun BoxScope.AddRowSmartTV(
|
|
|
.focusable(),
|
|
|
text = AnnotatedString("Change"),
|
|
|
style = MaterialTheme.typography.customTypography.headlineMedium.copy(
|
|
|
- color = MaterialTheme.colorScheme.surfaceContainerLow,
|
|
|
-// color = color,
|
|
|
+// color = MaterialTheme.colorScheme.surfaceContainerLow,
|
|
|
+ color = color,
|
|
|
fontSize = 18.sp
|
|
|
),
|
|
|
onClick = {},
|