|
@@ -496,6 +496,9 @@ fun ColumnScope.AddRowSettingsColumnTV(
|
|
|
"Auto", "WireGuard", "IKEv2", "OpenVPN TCP", "OpenVPN UDP"
|
|
|
)
|
|
|
var selectedProtocol by remember { mutableStateOf(basePreferenceHelper.getProtocol().full_name) }
|
|
|
+ var focusedProtocol by remember { mutableStateOf(availableProtocols[0]) }
|
|
|
+ var isButtonFocused by remember { mutableStateOf(false) }
|
|
|
+ var isFocusedAnyItem by remember { mutableStateOf(false) }
|
|
|
var isFirstRowFocused by remember { mutableStateOf(false) }
|
|
|
|
|
|
// val serverListViewModel = serverListViewModelSplash
|
|
@@ -543,8 +546,6 @@ fun ColumnScope.AddRowSettingsColumnTV(
|
|
|
.focusRequester(focusRequester1)
|
|
|
.onFocusChanged {
|
|
|
isFirstRowFocused = it.isFocused
|
|
|
-// if (!it.isFocused) focusRequester2.requestFocus()
|
|
|
-
|
|
|
}
|
|
|
.focusable()
|
|
|
// .pointerInput(Unit) {
|
|
@@ -631,7 +632,6 @@ fun ColumnScope.AddRowSettingsColumnTV(
|
|
|
}
|
|
|
|
|
|
if (isSheetOpen) {
|
|
|
-
|
|
|
ModalBottomSheet(
|
|
|
onDismissRequest = { isSheetOpen = false },
|
|
|
sheetState = sheetState,
|
|
@@ -659,19 +659,24 @@ fun ColumnScope.AddRowSettingsColumnTV(
|
|
|
style = MaterialTheme.typography.titleMedium
|
|
|
)
|
|
|
availableProtocols.forEach { protocol ->
|
|
|
+ isButtonFocused = focusedProtocol == protocol
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
- .background(Color.White)
|
|
|
+ .background(if (isButtonFocused && isFocusedAnyItem) Color.LightGray else Color.Transparent)
|
|
|
.padding(start = 2.dp)
|
|
|
+ .onFocusChanged {
|
|
|
+ if (it.isFocused) {
|
|
|
+ focusedProtocol = protocol
|
|
|
+ }
|
|
|
+ isFocusedAnyItem = it.isFocused
|
|
|
+ }
|
|
|
+ .focusable()
|
|
|
.selectable(
|
|
|
selected = selectedProtocol == protocol,
|
|
|
onClick = {
|
|
|
selectedProtocol = protocol
|
|
|
isSheetOpen = false
|
|
|
- Toast.makeText(
|
|
|
- context, selectedProtocol, Toast.LENGTH_SHORT
|
|
|
- ).show()
|
|
|
selectProtocolCallbackTV(
|
|
|
protocol = protocol,
|
|
|
context,
|
|
@@ -770,6 +775,9 @@ fun ColumnScope.AddRowSettingsSmartTV(
|
|
|
val context = LocalContext.current
|
|
|
val basePreferenceHelper = BasePreferenceHelper(context)
|
|
|
var isRowFocused by remember { mutableStateOf(false) }
|
|
|
+ var isSmartFocused by remember { mutableStateOf(smartConnect[0]) }
|
|
|
+ var isButtonFocused by remember { mutableStateOf(false) }
|
|
|
+ var isAnyItemFocused by remember { mutableStateOf(false) }
|
|
|
|
|
|
// if (isRowShown) { }
|
|
|
|
|
@@ -874,7 +882,8 @@ fun ColumnScope.AddRowSettingsSmartTV(
|
|
|
mutableStateOf(basePreferenceHelper.getSmartList()) }
|
|
|
|
|
|
ModalBottomSheet(
|
|
|
- onDismissRequest = { isSmartSheetOpen = false
|
|
|
+ onDismissRequest = {
|
|
|
+ isSmartSheetOpen = false
|
|
|
BottomBarScreen.Settings.isTrue = false
|
|
|
},
|
|
|
sheetState = sheetState,
|
|
@@ -901,11 +910,19 @@ fun ColumnScope.AddRowSettingsSmartTV(
|
|
|
style = MaterialTheme.typography.titleMedium
|
|
|
)
|
|
|
smartConnect.forEach { smart ->
|
|
|
+ isButtonFocused = isSmartFocused == smart
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
- .background(Color.Transparent)
|
|
|
+ .background(if (isButtonFocused && isAnyItemFocused) Color.LightGray else Color.Transparent)
|
|
|
.padding(start = 2.dp)
|
|
|
+ .onFocusChanged {
|
|
|
+ if (it.isFocused) {
|
|
|
+ isSmartFocused = smart
|
|
|
+ }
|
|
|
+ isAnyItemFocused = it.isFocused
|
|
|
+ }
|
|
|
+ .focusable()
|
|
|
.selectable(
|
|
|
selected = selectedSmartConnect == smart,
|
|
|
onClick = {
|