|
@@ -1,6 +1,5 @@
|
|
|
package com.vpn.fastestvpnservice.screens.bottomNavBarScreens
|
|
|
|
|
|
-import android.accessibilityservice.GestureDescription
|
|
|
import android.app.Activity
|
|
|
import android.content.Context
|
|
|
import android.content.Intent
|
|
@@ -8,19 +7,11 @@ import android.os.Build
|
|
|
import android.os.Bundle
|
|
|
import android.os.Handler
|
|
|
import android.util.Log
|
|
|
-import android.view.View
|
|
|
-import android.view.WindowManager
|
|
|
-import android.widget.Toast
|
|
|
-import androidx.annotation.RequiresApi
|
|
|
-import androidx.compose.animation.AnimatedVisibility
|
|
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
|
import androidx.compose.foundation.Image
|
|
|
import androidx.compose.foundation.LocalOverscrollConfiguration
|
|
|
import androidx.compose.foundation.background
|
|
|
-import androidx.compose.foundation.clickable
|
|
|
import androidx.compose.foundation.gestures.detectTapGestures
|
|
|
-import androidx.compose.foundation.indication
|
|
|
-import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
|
import androidx.compose.foundation.isSystemInDarkTheme
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
import androidx.compose.foundation.layout.Box
|
|
@@ -34,49 +25,29 @@ 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.width
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
import androidx.compose.foundation.lazy.items
|
|
|
import androidx.compose.foundation.rememberScrollState
|
|
|
import androidx.compose.foundation.selection.selectable
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
import androidx.compose.material.icons.Icons
|
|
|
-import androidx.compose.material.icons.automirrored.filled.CallSplit
|
|
|
-import androidx.compose.material.icons.filled.Block
|
|
|
-import androidx.compose.material.icons.filled.CallSplit
|
|
|
-import androidx.compose.material.icons.filled.Circle
|
|
|
import androidx.compose.material.icons.filled.DarkMode
|
|
|
-import androidx.compose.material.icons.filled.FlashOff
|
|
|
-import androidx.compose.material.icons.filled.HdrAuto
|
|
|
-import androidx.compose.material.icons.filled.Home
|
|
|
-import androidx.compose.material.icons.filled.Notifications
|
|
|
-import androidx.compose.material.icons.filled.Security
|
|
|
-import androidx.compose.material.icons.filled.Settings
|
|
|
-import androidx.compose.material.icons.filled.SmartDisplay
|
|
|
-import androidx.compose.material.icons.filled.SwitchRight
|
|
|
-import androidx.compose.material.icons.outlined.Circle
|
|
|
-import androidx.compose.material.ripple.rememberRipple
|
|
|
import androidx.compose.material3.DockedSearchBar
|
|
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
|
import androidx.compose.material3.Icon
|
|
|
-import androidx.compose.material3.IconButton
|
|
|
import androidx.compose.material3.MaterialTheme
|
|
|
import androidx.compose.material3.ModalBottomSheet
|
|
|
import androidx.compose.material3.RadioButton
|
|
|
import androidx.compose.material3.RadioButtonDefaults
|
|
|
-import androidx.compose.material3.SearchBar
|
|
|
import androidx.compose.material3.SearchBarDefaults
|
|
|
import androidx.compose.material3.Surface
|
|
|
import androidx.compose.material3.Switch
|
|
|
-import androidx.compose.material3.SwitchColors
|
|
|
import androidx.compose.material3.SwitchDefaults
|
|
|
import androidx.compose.material3.Text
|
|
|
import androidx.compose.material3.TextFieldDefaults
|
|
|
import androidx.compose.material3.rememberModalBottomSheetState
|
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.runtime.CompositionLocalProvider
|
|
|
-import androidx.compose.runtime.LaunchedEffect
|
|
|
-import androidx.compose.runtime.MutableState
|
|
|
import androidx.compose.runtime.getValue
|
|
|
import androidx.compose.runtime.livedata.observeAsState
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
@@ -98,17 +69,12 @@ import androidx.compose.ui.platform.LocalView
|
|
|
import androidx.compose.ui.res.colorResource
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
import androidx.compose.ui.text.TextStyle
|
|
|
-import androidx.compose.ui.text.font.FontStyle
|
|
|
-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.Dp
|
|
|
import androidx.compose.ui.unit.TextUnit
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
-import androidx.core.content.ContextCompat
|
|
|
import androidx.core.content.ContextCompat.startActivity
|
|
|
-import androidx.core.view.WindowCompat
|
|
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
|
|
import androidx.navigation.NavHostController
|
|
|
import androidx.navigation.compose.rememberNavController
|
|
@@ -118,13 +84,10 @@ import com.vpn.fastestvpnservice.beans.isDarkTheme
|
|
|
import com.vpn.fastestvpnservice.beans.themesList
|
|
|
import com.vpn.fastestvpnservice.constants.AppEnum
|
|
|
import com.vpn.fastestvpnservice.constants.smartConnect
|
|
|
-import com.vpn.fastestvpnservice.customItems.ServerSearchItem
|
|
|
import com.vpn.fastestvpnservice.customItems.ServerSpecificItem
|
|
|
import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
|
|
|
-import com.vpn.fastestvpnservice.navigation.navigationAnimation
|
|
|
import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
|
|
|
import com.vpn.fastestvpnservice.sealedClass.Screen
|
|
|
-import com.vpn.fastestvpnservice.utils.VPNConnectionsUtil
|
|
|
import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
|
|
|
import com.vpn.fastestvpnservice.viewmodels.SearchListViewModel
|
|
|
import com.vpn.fastestvpnservice.viewmodels.ServerListViewModel
|
|
@@ -132,9 +95,10 @@ import com.vpn.fastestvpnservice.viewmodels.SplashViewModel
|
|
|
import de.blinkt.openvpn.core.App
|
|
|
import kotlinx.coroutines.launch
|
|
|
|
|
|
-@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
|
|
|
+@OptIn(ExperimentalFoundationApi::class)
|
|
|
@Composable
|
|
|
fun Settings(navHostController: NavHostController) {
|
|
|
+ val context = LocalContext.current
|
|
|
|
|
|
CompositionLocalProvider(
|
|
|
LocalOverscrollConfiguration provides null
|
|
@@ -142,31 +106,13 @@ fun Settings(navHostController: NavHostController) {
|
|
|
Box(modifier = Modifier
|
|
|
.background(MaterialTheme.colorScheme.background)
|
|
|
.fillMaxSize()
|
|
|
- .padding(vertical = 10.dp)
|
|
|
- ,
|
|
|
-// contentAlignment = Alignment.Center
|
|
|
+ .padding(vertical = 10.dp),
|
|
|
) {
|
|
|
-
|
|
|
- val context = LocalContext.current
|
|
|
-
|
|
|
val view = LocalView.current
|
|
|
val window = (view.context as Activity).window
|
|
|
window.statusBarColor = Color.Transparent.toArgb()
|
|
|
window.navigationBarColor = Color.Transparent.toArgb()
|
|
|
|
|
|
-// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
|
|
-// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
|
|
|
-// window.addFlags(View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
|
|
|
-// WindowCompat.setDecorFitsSystemWindows(window, false)
|
|
|
-// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
|
|
|
-// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
|
|
-// window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_FULLSCREEN)
|
|
|
-// window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
|
|
|
-// @RequiresApi(Build.VERSION_CODES.Q)
|
|
|
-// window.isStatusBarContrastEnforced = true
|
|
|
-// window.statusBarColor = ContextCompat.getColor(context, R.color.yellow_text)
|
|
|
-
|
|
|
- val basePreferenceHelper = BasePreferenceHelper(context)
|
|
|
Column(
|
|
|
verticalArrangement = Arrangement.Top,
|
|
|
horizontalAlignment = Alignment.Start,
|
|
@@ -174,17 +120,16 @@ fun Settings(navHostController: NavHostController) {
|
|
|
.padding(start = 16.dp, end = 24.dp)
|
|
|
.fillMaxSize()
|
|
|
.verticalScroll(rememberScrollState())
|
|
|
-
|
|
|
) {
|
|
|
- if (BottomBarScreen.Settings.isTrue) {
|
|
|
- AddRowSettingsSmart(
|
|
|
- icon = R.drawable.smart_connect3x,
|
|
|
- text = "Smart Connect",
|
|
|
- isRowShown = false,
|
|
|
- isSheetShown = true,
|
|
|
- navHostController
|
|
|
- )
|
|
|
- }
|
|
|
+// if (BottomBarScreen.Settings.isTrue) {
|
|
|
+// AddRowSettingsSmart(
|
|
|
+// icon = R.drawable.smart_connect3x,
|
|
|
+// text = "Smart Connect",
|
|
|
+// isRowShown = false,
|
|
|
+// isSheetShown = true,
|
|
|
+// navHostController
|
|
|
+// )
|
|
|
+// }
|
|
|
|
|
|
Spacer(modifier = Modifier.height(60.dp))
|
|
|
AddTextSettings(
|
|
@@ -195,20 +140,22 @@ fun Settings(navHostController: NavHostController) {
|
|
|
)
|
|
|
AddRowSettingsColumn(
|
|
|
icon = R.drawable.vpn_protocols3x,
|
|
|
- text = "VPN Protocols",
|
|
|
- desc = "WireGuard"
|
|
|
+ text = "VPN Protocols"
|
|
|
)
|
|
|
-// AddRowSwitch(
|
|
|
-// icon = R.drawable.autoconnect3x,
|
|
|
-// text = "Auto Connect"
|
|
|
-// )
|
|
|
-
|
|
|
/* Commenting so far ...*/
|
|
|
+
|
|
|
+
|
|
|
+// AddRowSwitch(
|
|
|
+// icon = R.drawable.autoconnect3x,
|
|
|
+// text = "Auto Connect"
|
|
|
+// )
|
|
|
+
|
|
|
// AddRowSettings(
|
|
|
// icon = R.drawable.autoconnect3x,
|
|
|
// text = "Auto Connect",
|
|
|
// onClick = {}
|
|
|
// )
|
|
|
+
|
|
|
AddRowSettingsSmart(
|
|
|
icon = R.drawable.smart_connect3x,
|
|
|
text = "Smart Connect",
|
|
@@ -421,15 +368,14 @@ fun ColumnScope.AddRowSettings(
|
|
|
@Composable
|
|
|
fun ColumnScope.AddRowSettingsColumn(
|
|
|
icon: Int,
|
|
|
- text: String,
|
|
|
- desc: String
|
|
|
+ text: String
|
|
|
) {
|
|
|
val context = LocalContext.current
|
|
|
val basePreferenceHelper = BasePreferenceHelper(context = context)
|
|
|
val availableProtocols = getAvailableProtocols(basePreferenceHelper)
|
|
|
var isSheetOpen by remember { mutableStateOf(false) }
|
|
|
val sheetState = rememberModalBottomSheetState()
|
|
|
- val protocols = listOf<String>(
|
|
|
+ val protocols = listOf(
|
|
|
"Auto", "WireGuard", "IKEv2", "OpenVPN TCP", "OpenVPN UDP"
|
|
|
)
|
|
|
var selectedProtocol by remember { mutableStateOf(basePreferenceHelper.getProtocol().full_name) }
|
|
@@ -439,8 +385,6 @@ fun ColumnScope.AddRowSettingsColumn(
|
|
|
val configuration = LocalConfiguration.current
|
|
|
val isTablet = configuration.screenWidthDp > 840
|
|
|
|
|
|
- Log.d("availableProtocols", availableProtocols.toString())
|
|
|
-
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
@@ -559,7 +503,7 @@ fun ColumnScope.AddRowSettingsColumn(
|
|
|
onClick = {
|
|
|
selectedProtocol = protocol
|
|
|
isSheetOpen = false
|
|
|
- SelectProtocolCallback(
|
|
|
+ selectProtocolCallback(
|
|
|
protocol = protocol,
|
|
|
context,
|
|
|
serverListViewModel
|
|
@@ -579,7 +523,7 @@ fun ColumnScope.AddRowSettingsColumn(
|
|
|
onClick = {
|
|
|
selectedProtocol = protocol
|
|
|
isSheetOpen = false
|
|
|
- SelectProtocolCallback(protocol = protocol, context, serverListViewModel)
|
|
|
+ selectProtocolCallback(protocol = protocol, context, serverListViewModel)
|
|
|
},
|
|
|
colors = RadioButtonDefaults.colors(
|
|
|
selectedColor = colorResource(id = R.color.radio_button_blue),
|
|
@@ -599,7 +543,7 @@ fun ColumnScope.AddRowSettingsColumn(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-fun SelectProtocolCallback(protocol: String, context: Context, serverListViewModel: ServerListViewModel) {
|
|
|
+fun selectProtocolCallback(protocol: String, context: Context, serverListViewModel: ServerListViewModel) {
|
|
|
when (protocol) {
|
|
|
AppEnum.AUTO_PROTOCOL.title -> {
|
|
|
onServer.onChangeProtocol(
|
|
@@ -626,7 +570,7 @@ fun SelectProtocolCallback(protocol: String, context: Context, serverListViewMod
|
|
|
}
|
|
|
}
|
|
|
fun getAvailableProtocols(prefHelper: BasePreferenceHelper): ArrayList<String> {
|
|
|
- var list : ArrayList<String> = ArrayList<String>()
|
|
|
+ var list : ArrayList<String>
|
|
|
|
|
|
prefHelper.getAvailableProtocols().let {
|
|
|
list = it
|
|
@@ -635,12 +579,10 @@ fun getAvailableProtocols(prefHelper: BasePreferenceHelper): ArrayList<String> {
|
|
|
list.add(0, "Auto")
|
|
|
|
|
|
for ((index, obj) in list.withIndex()) {
|
|
|
- Log.d("list test", "$index , ${obj}")
|
|
|
-
|
|
|
- if (obj.contains(AppEnum.WG_PROTOCOL.key)) list.set(index, AppEnum.WG_PROTOCOL.title)
|
|
|
- if (obj.contains(AppEnum.IKEV2_PROTOCOL.key)) list.set(index, AppEnum.IKEV2_PROTOCOL.title)
|
|
|
- if (obj.contains(AppEnum.TCP_PROTOCOL.key)) list.set(index, AppEnum.TCP_PROTOCOL.title)
|
|
|
- if (obj.contains(AppEnum.UDP_PROTOCOL.key)) list.set(index, AppEnum.UDP_PROTOCOL.title)
|
|
|
+ if (obj.contains(AppEnum.WG_PROTOCOL.key)) list[index] = AppEnum.WG_PROTOCOL.title
|
|
|
+ if (obj.contains(AppEnum.IKEV2_PROTOCOL.key)) list[index] = AppEnum.IKEV2_PROTOCOL.title
|
|
|
+ if (obj.contains(AppEnum.TCP_PROTOCOL.key)) list[index] = AppEnum.TCP_PROTOCOL.title
|
|
|
+ if (obj.contains(AppEnum.UDP_PROTOCOL.key)) list[index] = AppEnum.UDP_PROTOCOL.title
|
|
|
}
|
|
|
|
|
|
return list
|
|
@@ -657,7 +599,7 @@ fun AddRowDarkLightTheme(
|
|
|
val sheetState = rememberModalBottomSheetState()
|
|
|
val context = LocalContext.current
|
|
|
val basePreferenceHelper = BasePreferenceHelper(context)
|
|
|
- var selectedtheme = remember { mutableStateOf(basePreferenceHelper.getTheme()) }
|
|
|
+ val selectedtheme = remember { mutableStateOf(basePreferenceHelper.getTheme()) }
|
|
|
val isSystemInDarkTheme = isSystemInDarkTheme()
|
|
|
val systemTheme by remember { mutableStateOf(isSystemInDarkTheme) }
|
|
|
|
|
@@ -832,103 +774,82 @@ fun ColumnScope.AddRowSettingsSmart(
|
|
|
isSheetShown: Boolean,
|
|
|
navHostController: NavHostController
|
|
|
) {
|
|
|
- var isSmartSheetOpen by remember { mutableStateOf(isSheetShown) }
|
|
|
+ var isSmartSheetOpen by remember { mutableStateOf(false) }
|
|
|
var isAnySpecificSheetOpen by remember { mutableStateOf(false) }
|
|
|
- val sheetState = rememberModalBottomSheetState()
|
|
|
- val sheetStateAny = rememberModalBottomSheetState()
|
|
|
val context = LocalContext.current
|
|
|
val basePreferenceHelper = BasePreferenceHelper(context)
|
|
|
|
|
|
- val splashViewModel: SplashViewModel = viewModel{
|
|
|
- SplashViewModel(context)
|
|
|
- }
|
|
|
- val serverListViewModel: ServerListViewModel = viewModel {
|
|
|
- ServerListViewModel(context = context)
|
|
|
- }
|
|
|
- val searchListViewModel: SearchListViewModel = viewModel{
|
|
|
- SearchListViewModel(context, serverListViewModel, splashViewModel)
|
|
|
- }
|
|
|
-
|
|
|
- var selectedSmartConnect by remember {
|
|
|
- mutableStateOf(basePreferenceHelper.getSmartList()) }
|
|
|
-
|
|
|
-
|
|
|
- val searchText = searchListViewModel.searchText.observeAsState().value
|
|
|
- val isActive = searchListViewModel.isActive.observeAsState().value
|
|
|
+// if (isRowShown) { }
|
|
|
|
|
|
- var selectedFilterList by remember { mutableStateOf(basePreferenceHelper.getFilterList()) }
|
|
|
- val scope = rememberCoroutineScope()
|
|
|
-
|
|
|
- if (isRowShown) {
|
|
|
- Row(
|
|
|
- modifier = Modifier
|
|
|
- .fillMaxWidth()
|
|
|
- .padding(top = 33.dp)
|
|
|
- .background(Color.Transparent)
|
|
|
- .pointerInput(Unit) {
|
|
|
- detectTapGestures {
|
|
|
- isSmartSheetOpen = true
|
|
|
- }
|
|
|
+ Row(
|
|
|
+ modifier = Modifier
|
|
|
+ .fillMaxWidth()
|
|
|
+ .padding(top = 33.dp)
|
|
|
+ .background(Color.Transparent)
|
|
|
+ .pointerInput(Unit) {
|
|
|
+ detectTapGestures {
|
|
|
+ isSmartSheetOpen = true
|
|
|
}
|
|
|
- .height(30.dp),
|
|
|
- horizontalArrangement = Arrangement.Start,
|
|
|
- verticalAlignment = Alignment.CenterVertically
|
|
|
- ) {
|
|
|
-
|
|
|
- Surface(
|
|
|
- modifier = Modifier.padding(start = 0.dp),
|
|
|
- color = Color.Transparent
|
|
|
- ) {
|
|
|
- Image(
|
|
|
- painter = painterResource(id = icon),
|
|
|
- contentDescription = "World",
|
|
|
- modifier = Modifier
|
|
|
- .padding(start = 0.dp)
|
|
|
- .size(24.dp)
|
|
|
- .weight(1f),
|
|
|
- colorFilter = ColorFilter.tint(
|
|
|
- MaterialTheme.colorScheme.primary) )
|
|
|
- }
|
|
|
-
|
|
|
- Surface(
|
|
|
- modifier = Modifier.padding(start = 0.dp),
|
|
|
- color = Color.Transparent
|
|
|
- ) {
|
|
|
- Text(text = text,
|
|
|
- style = MaterialTheme.typography.titleSmall,
|
|
|
- color = MaterialTheme.colorScheme.primary,
|
|
|
- maxLines = 1,
|
|
|
- modifier = Modifier
|
|
|
- .padding(start = 20.dp, end = 0.dp)
|
|
|
- .weight(1f)
|
|
|
- )
|
|
|
}
|
|
|
- Spacer(modifier = Modifier.weight(1f))
|
|
|
+ .height(30.dp),
|
|
|
+ horizontalArrangement = Arrangement.Start,
|
|
|
+ verticalAlignment = Alignment.CenterVertically
|
|
|
+ ) {
|
|
|
|
|
|
- Surface(
|
|
|
+ Surface(
|
|
|
+ modifier = Modifier.padding(start = 0.dp),
|
|
|
+ color = Color.Transparent
|
|
|
+ ) {
|
|
|
+ Image(
|
|
|
+ painter = painterResource(id = icon),
|
|
|
+ contentDescription = "World",
|
|
|
modifier = Modifier
|
|
|
- .padding(start = 15.dp)
|
|
|
- .align(Alignment.CenterVertically),
|
|
|
- color = Color.Transparent
|
|
|
+ .padding(start = 0.dp)
|
|
|
+ .size(24.dp)
|
|
|
+ .weight(1f),
|
|
|
+ colorFilter = ColorFilter.tint(
|
|
|
+ MaterialTheme.colorScheme.primary) )
|
|
|
+ }
|
|
|
|
|
|
- ) {
|
|
|
- Image(
|
|
|
- painter = painterResource(id = R.drawable.frontarrow3x),
|
|
|
- contentDescription = "Front_Arrow",
|
|
|
- modifier = Modifier
|
|
|
- .padding(start = 0.dp, end = 20.dp)
|
|
|
- .size(10.dp, 18.dp)
|
|
|
- .weight(1f),
|
|
|
- colorFilter = ColorFilter.tint(
|
|
|
- MaterialTheme.colorScheme.primary
|
|
|
- )
|
|
|
+ Surface(
|
|
|
+ modifier = Modifier.padding(start = 0.dp),
|
|
|
+ color = Color.Transparent
|
|
|
+ ) {
|
|
|
+ Text(text = text,
|
|
|
+ style = MaterialTheme.typography.titleSmall,
|
|
|
+ color = MaterialTheme.colorScheme.primary,
|
|
|
+ maxLines = 1,
|
|
|
+ modifier = Modifier
|
|
|
+ .padding(start = 20.dp, end = 0.dp)
|
|
|
+ .weight(1f)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ Spacer(modifier = Modifier.weight(1f))
|
|
|
+ Surface(
|
|
|
+ modifier = Modifier
|
|
|
+ .padding(start = 15.dp)
|
|
|
+ .align(Alignment.CenterVertically),
|
|
|
+ color = Color.Transparent
|
|
|
+ ) {
|
|
|
+ Image(
|
|
|
+ painter = painterResource(id = R.drawable.frontarrow3x),
|
|
|
+ contentDescription = "Front_Arrow",
|
|
|
+ modifier = Modifier
|
|
|
+ .padding(start = 0.dp, end = 20.dp)
|
|
|
+ .size(10.dp, 18.dp)
|
|
|
+ .weight(1f),
|
|
|
+ colorFilter = ColorFilter.tint(
|
|
|
+ MaterialTheme.colorScheme.primary
|
|
|
)
|
|
|
- }
|
|
|
-
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isSmartSheetOpen) {
|
|
|
+ val sheetState = rememberModalBottomSheetState()
|
|
|
+ var selectedSmartConnect by remember {
|
|
|
+ mutableStateOf(basePreferenceHelper.getSmartList()) }
|
|
|
+
|
|
|
ModalBottomSheet(
|
|
|
onDismissRequest = { isSmartSheetOpen = false
|
|
|
BottomBarScreen.Settings.isTrue = false
|
|
@@ -1030,6 +951,20 @@ fun ColumnScope.AddRowSettingsSmart(
|
|
|
}
|
|
|
|
|
|
if (isAnySpecificSheetOpen) {
|
|
|
+ val sheetStateAny = rememberModalBottomSheetState()
|
|
|
+ val splashViewModel: SplashViewModel = viewModel{
|
|
|
+ SplashViewModel(context)
|
|
|
+ }
|
|
|
+ val serverListViewModel: ServerListViewModel = viewModel {
|
|
|
+ ServerListViewModel(context = context)
|
|
|
+ }
|
|
|
+ val searchListViewModel: SearchListViewModel = viewModel{
|
|
|
+ SearchListViewModel(context, serverListViewModel, splashViewModel)
|
|
|
+ }
|
|
|
+ val searchText = searchListViewModel.searchText.observeAsState().value
|
|
|
+ val isActive = searchListViewModel.isActive.observeAsState().value
|
|
|
+ val scope = rememberCoroutineScope()
|
|
|
+
|
|
|
ModalBottomSheet(
|
|
|
onDismissRequest = { isAnySpecificSheetOpen = false
|
|
|
BottomBarScreen.Settings.isTrue = false
|
|
@@ -1122,7 +1057,6 @@ fun ColumnScope.AddRowSettingsSmart(
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Composable
|
|
@@ -1139,7 +1073,6 @@ fun ColumnScope.AddTextSettings(
|
|
|
style = style,
|
|
|
color = color,
|
|
|
modifier = Modifier.padding(bottom = bottomPadding, start = startPadding)
|
|
|
-
|
|
|
)
|
|
|
}
|
|
|
|