|
@@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
+import androidx.compose.foundation.layout.wrapContentHeight
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
import androidx.compose.foundation.lazy.items
|
|
|
import androidx.compose.foundation.lazy.itemsIndexed
|
|
@@ -50,6 +51,7 @@ import androidx.compose.ui.text.TextStyle
|
|
|
import androidx.compose.ui.text.font.FontWeight
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
|
+import androidx.compose.ui.unit.TextUnit
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
import androidx.navigation.NavHostController
|
|
@@ -143,11 +145,23 @@ fun ColumnScope.ShowRadioButtons() {
|
|
|
Spacer(modifier = Modifier.height(15.dp))
|
|
|
|
|
|
splitList.forEachIndexed { index, list ->
|
|
|
+ var splitListLingual: String = ""
|
|
|
+ when (list) {
|
|
|
+ splitList[0] -> {
|
|
|
+ splitListLingual = context.getString(R.string.all_apps_use_vpn)
|
|
|
+ }
|
|
|
+ splitList[1] -> {
|
|
|
+ splitListLingual = context.getString(R.string.only_selected_apps_use_vpn)
|
|
|
+ }
|
|
|
+ splitList[2] -> {
|
|
|
+ splitListLingual = context.getString(R.string.only_selected_apps_not_use_vpn)
|
|
|
+ }
|
|
|
+ }
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
.background(Color.Transparent)
|
|
|
- .padding(top = 0.dp)
|
|
|
+ .padding(top = 5.dp)
|
|
|
.selectable(
|
|
|
selected = selectedList == list,
|
|
|
onClick = {
|
|
@@ -164,9 +178,11 @@ fun ColumnScope.ShowRadioButtons() {
|
|
|
// }
|
|
|
// )
|
|
|
,
|
|
|
- verticalAlignment = Alignment.CenterVertically
|
|
|
+ verticalAlignment = Alignment.CenterVertically,
|
|
|
+ horizontalArrangement = Arrangement.Start
|
|
|
) {
|
|
|
- RadioButton(selected = list == selectedList,
|
|
|
+ RadioButton(
|
|
|
+ selected = list == selectedList,
|
|
|
onClick = {
|
|
|
selectedList = list
|
|
|
prefHelper.saveSplitPosition(list)
|
|
@@ -176,13 +192,17 @@ fun ColumnScope.ShowRadioButtons() {
|
|
|
selectedColor = colorResource(
|
|
|
id = R.color.radio_button_blue),
|
|
|
unselectedColor = colorResource(
|
|
|
- id = R.color.gray_icon),)
|
|
|
+ id = R.color.gray_icon),
|
|
|
+ ),
|
|
|
+ modifier = Modifier.align(Alignment.Top)
|
|
|
)
|
|
|
Text(
|
|
|
- text = list,
|
|
|
- modifier = Modifier.padding(start = 12.dp),
|
|
|
+ text = splitListLingual,
|
|
|
style = MaterialTheme.typography.bodySmall,
|
|
|
- color = MaterialTheme.colorScheme.primary
|
|
|
+ color = MaterialTheme.colorScheme.primary,
|
|
|
+ maxLines = 2,
|
|
|
+ lineHeight = 15.sp,
|
|
|
+ modifier = Modifier.padding(start = 12.dp)
|
|
|
)
|
|
|
}
|
|
|
}
|
|
@@ -325,7 +345,6 @@ fun getInstalledApps(context: Context): ArrayList<SelectApplicationEntry> {
|
|
|
|
|
|
@Composable
|
|
|
fun ColumnScope.ShowSplitTunnelList(list: List<SelectApplicationEntry>) {
|
|
|
-
|
|
|
Box(modifier = Modifier
|
|
|
.padding(top = 5.dp)
|
|
|
.fillMaxSize()
|
|
@@ -341,6 +360,7 @@ fun ColumnScope.ShowSplitTunnelList(list: List<SelectApplicationEntry>) {
|
|
|
|
|
|
@Composable
|
|
|
fun BoxScope.HeaderRowST(navHostController: NavHostController) {
|
|
|
+ val context = LocalContext.current
|
|
|
IconButton(
|
|
|
onClick = {
|
|
|
navHostController.popBackStack()
|
|
@@ -367,7 +387,7 @@ fun BoxScope.HeaderRowST(navHostController: NavHostController) {
|
|
|
.padding(5.dp),
|
|
|
color = colorResource(id = R.color.transparent)
|
|
|
) {
|
|
|
- Text(text = "Split Tunneling",
|
|
|
+ Text(text = context.getString(R.string.split_tunneling),
|
|
|
color = MaterialTheme.colorScheme.primary,
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
modifier = Modifier.fillMaxHeight()
|