Explorar o código

Worked on auto connect UI on android, commenting currently

Khubaib hai 3 meses
pai
achega
785ffb8fab

+ 3 - 3
app/src/main/java/com/vpn/fastestvpnservice/MainActivity.kt

@@ -53,9 +53,9 @@ import de.blinkt.openvpn.core.App
 
 open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityReceiverListener {
 
-    lateinit var wifiManager: WifiManager
-    lateinit var wifiScanReceiver: WifiScanReceiver
-    lateinit var intentFilter: IntentFilter
+//    lateinit var wifiManager: WifiManager
+//    lateinit var wifiScanReceiver: WifiScanReceiver
+//    lateinit var intentFilter: IntentFilter
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)

+ 45 - 40
app/src/main/java/com/vpn/fastestvpnservice/fcm/NetworkJobService.java

@@ -82,22 +82,25 @@ public class NetworkJobService extends JobService {
             // for ActivityCompat#requestPermissions for more details.
           return;
         }
-        List<ScanResult> scanResults = wifiManager.getScanResults();
-        Log.d("NetworkJobService", "Job scanResults + " + scanResults.size());
 
-        List<ScanResult> nonZeroList = new ArrayList<>();
-
-        if (scanResults.size() > 0) {
-            Log.d("nonZeroList_test 1", scanResults.size() + "");
-
-            nonZeroList.addAll(scanResults);
-        }
-        else {
-//            Log.d("nonZeroList test 2", WiFiMonitorService.scanResultsStatic.size() + "");
-            Log.d("nonZeroList_test 2", WiFiMonitorService.scanResultsStatic.size() + "");
-
-//            nonZeroList.addAll(WiFiMonitorService.scanResultsStatic);
-        }
+        // currently commenting below ...
+
+//        List<ScanResult> scanResults = wifiManager.getScanResults();
+//        Log.d("NetworkJobService", "Job scanResults + " + scanResults.size());
+//
+//        List<ScanResult> nonZeroList = new ArrayList<>();
+//
+//        if (scanResults.size() > 0) {
+//            Log.d("nonZeroList_test 1", scanResults.size() + "");
+//
+//            nonZeroList.addAll(scanResults);
+//        }
+//        else {
+////            Log.d("nonZeroList test 2", WiFiMonitorService.scanResultsStatic.size() + "");
+//            Log.d("nonZeroList_test 2", WiFiMonitorService.scanResultsStatic.size() + "");
+//
+////            nonZeroList.addAll(WiFiMonitorService.scanResultsStatic);
+//        }
 
         Log.d("NetworkJobService Start", "Started");
 
@@ -108,7 +111,7 @@ public class NetworkJobService extends JobService {
 
         if (wifiManager.isWifiEnabled()) {
 
-            Log.d("NetworkJobService res", scanResults.size() + "isWifiEnabled()");
+//            Log.d("NetworkJobService res", scanResults.size() + "isWifiEnabled()");
 
             ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
             NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo();
@@ -122,30 +125,32 @@ public class NetworkJobService extends JobService {
 
                     Log.d("NetworkJobService cssid", connectedSSID);
 
-                    for (ScanResult scanResult : nonZeroList) {
-
-                        Log.d("NetworkJobService list", scanResult.SSID);
-
-                        String ssid = scanResult.SSID;
-
-                        if (scanResult.capabilities != null) {
-                            if (scanResult.capabilities.equals("[ESS]")) {
-                                Log.d("NetworkJobService ESS", "Open wifi detected " + ssid);
-
-                                String targetSSID = ssid;
-                                Log.d("NetworkJobService Conn", "Normal wifi connected " + connectedSSID);
-
-                                if (connectedSSID.equals(targetSSID)) {
-                                    Log.d("NetworkJobService con", "Device is connected to the open Wi-Fi network: " + connectedSSID);
-                                    sendNotification("Your Wi-Fi connection is unsafe", "Connect to VPN to protect your data");
-//                                    jobFinished(jobParameters, false); // now set to true
-                                    return;
-                                } else {
-                                    Log.d("NetworkJobService conn", "Device is connected to the Normal Wi-Fi network: " + connectedSSID);
-                                }
-                            }
-                        }
-                    }
+                    // currently commenting below ...
+
+//                    for (ScanResult scanResult : nonZeroList) {
+//
+//                        Log.d("NetworkJobService list", scanResult.SSID);
+//
+//                        String ssid = scanResult.SSID;
+//
+//                        if (scanResult.capabilities != null) {
+//                            if (scanResult.capabilities.equals("[ESS]")) {
+//                                Log.d("NetworkJobService ESS", "Open wifi detected " + ssid);
+//
+//                                String targetSSID = ssid;
+//                                Log.d("NetworkJobService Conn", "Normal wifi connected " + connectedSSID);
+//
+//                                if (connectedSSID.equals(targetSSID)) {
+//                                    Log.d("NetworkJobService con", "Device is connected to the open Wi-Fi network: " + connectedSSID);
+//                                    sendNotification("Your Wi-Fi connection is unsafe", "Connect to VPN to protect your data");
+////                                    jobFinished(jobParameters, false); // now set to true
+//                                    return;
+//                                } else {
+//                                    Log.d("NetworkJobService conn", "Device is connected to the Normal Wi-Fi network: " + connectedSSID);
+//                                }
+//                            }
+//                        }
+//                    }
                 }
             }
         }

+ 6 - 3
app/src/main/java/com/vpn/fastestvpnservice/fcm/WiFiMonitorService.java

@@ -91,9 +91,12 @@ public class WiFiMonitorService extends Service {
             // for ActivityCompat#requestPermissions for more details.
             return START_STICKY;
         }
-        List<ScanResult> results = wifiManager.getScanResults();
-        scanResultsStatic.addAll(results);
-        Log.d("open wifi rec s results", results.size() + " " + status);
+
+        // currently commenting below ...
+
+//        List<ScanResult> results = wifiManager.getScanResults();
+//        scanResultsStatic.addAll(results);
+//        Log.d("open wifi rec s results", results.size() + " " + status);
 
         return START_STICKY;
     }

+ 4 - 0
app/src/main/java/com/vpn/fastestvpnservice/navigation/BottomBarNavGraph.kt

@@ -29,6 +29,7 @@ import com.vpn.fastestvpnservice.screens.helpScreensAll.EmailUsScreen
 import com.vpn.fastestvpnservice.screens.helpScreensAll.FAQ
 import com.vpn.fastestvpnservice.screens.helpScreensAll.PrivacyPolicy
 import com.vpn.fastestvpnservice.screens.helpScreensAll.TermsAndConditions
+import com.vpn.fastestvpnservice.screens.settingsScreenAll.AutoConnectScreen
 import com.vpn.fastestvpnservice.screens.settingsScreenAll.Notifications
 import com.vpn.fastestvpnservice.screens.settingsScreenAll.SplitTunneling
 import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
@@ -109,6 +110,9 @@ fun BottomBarNavGraph(navHostController: NavHostController,
             composable(route = Screen.EmailUs.route) {
                 EmailUsScreen(navHostController = navHostController)
             }
+            composable(route = Screen.AutoConnect.route) {
+                AutoConnectScreen(navHostController = navHostController)
+            }
 
             /* Again declare for login because of different -> navHostController */
 //        composable(route = Screen.Login.route) {

+ 17 - 10
app/src/main/java/com/vpn/fastestvpnservice/screens/bottomNavBarScreens/SettingsScreen.kt

@@ -119,6 +119,7 @@ import com.vpn.fastestvpnservice.screens.isServerModelInitialized
 import com.vpn.fastestvpnservice.screens.isSplashModelInitialized
 import com.vpn.fastestvpnservice.screens.searchListViewModelSplash
 import com.vpn.fastestvpnservice.screens.serverListViewModelSplash
+import com.vpn.fastestvpnservice.screens.settingsScreenAll.selectedSmart
 import com.vpn.fastestvpnservice.screens.splashViewModelSplash
 import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
 import com.vpn.fastestvpnservice.sealedClass.Screen
@@ -154,7 +155,8 @@ fun Settings(navHostController: NavHostController, activity: ComponentActivity)
             modifier = Modifier
                 .background(MaterialTheme.colorScheme.background)
                 .fillMaxSize()
-                .padding(vertical = 10.dp),
+                .padding(vertical = 10.dp)
+                .padding(bottom = 0.dp),
         ) {
             val view = LocalView.current
             val window = (view.context as Activity).window
@@ -165,7 +167,7 @@ fun Settings(navHostController: NavHostController, activity: ComponentActivity)
                 verticalArrangement = Arrangement.Top,
                 horizontalAlignment = Alignment.Start,
                 modifier = Modifier
-                    .padding(start = 16.dp, end = 0.dp)
+                    .padding(start = 16.dp, bottom = 15.dp)
                     .fillMaxSize()
                     .verticalScroll(rememberScrollState())
                     .background(Color.Transparent)
@@ -204,12 +206,6 @@ fun Settings(navHostController: NavHostController, activity: ComponentActivity)
 //                    text = "Auto Connect"
 //                )
 
-//            AddRowSettings(
-//                icon = R.drawable.autoconnect3x,
-//                text = "Auto Connect",
-//                onClick = {}
-//            )
-
                 AddRowSettingsSmart(
                     icon = R.drawable.smart_connect3x,
                     text = context.getString(R.string.smart_connect),
@@ -261,6 +257,14 @@ fun Settings(navHostController: NavHostController, activity: ComponentActivity)
                     settingsString = it
                 }
 
+//                AddRowSettings(
+//                    icon = R.drawable.autoconnect3x,
+//                    text = "Auto Connect",
+//                    onClick = {
+//                        navHostController.navigate(Screen.AutoConnect.route)
+//                    }
+//                )
+
                 if (isLaunched) {
                     AlertDialog(
                         onDismissRequest = { isLaunched = false },
@@ -1371,7 +1375,8 @@ fun ColumnScope.AddRowSettingsSmart(
     text: String,
     isRowShown: Boolean,
     isSheetShown: Boolean,
-    navHostController: NavHostController
+    navHostController: NavHostController,
+    topPadding: Dp = 40.dp
 ) {
     var isSmartSheetOpen by remember { mutableStateOf(false) }
     var isAnySpecificSheetOpen by remember { mutableStateOf(false) }
@@ -1384,7 +1389,7 @@ fun ColumnScope.AddRowSettingsSmart(
     Row(
         modifier = Modifier
             .fillMaxWidth()
-            .padding(top = 40.dp, end = 27.dp)
+            .padding(top = topPadding, end = 27.dp)
             .background(Color.Transparent)
             .pointerInput(Unit) {
                 detectTapGestures {
@@ -1508,6 +1513,7 @@ fun ColumnScope.AddRowSettingsSmart(
                                         selectedSmartConnect = smart
                                         basePreferenceHelper.saveSmartList(smart)
                                         isSmartSheetOpen = false
+                                        selectedSmart.value = smart
 
                                         if (smart == smartConnect[2]) {
                                             Log.d("smartLocationList Row", smart)
@@ -1530,6 +1536,7 @@ fun ColumnScope.AddRowSettingsSmart(
                                     selectedSmartConnect = smart
                                     basePreferenceHelper.saveSmartList(smart)
                                     isSmartSheetOpen = false
+                                    selectedSmart.value = smart
 
                                     if (smart == smartConnect[2]) {
                                         Log.d("smartLocationList RB", smart)

+ 391 - 0
app/src/main/java/com/vpn/fastestvpnservice/screens/settingsScreenAll/AutoConnectScreen.kt

@@ -0,0 +1,391 @@
+package com.vpn.fastestvpnservice.screens.settingsScreenAll
+
+import android.app.Activity
+import android.util.Log
+import androidx.compose.foundation.BorderStroke
+import androidx.compose.foundation.background
+import androidx.compose.foundation.border
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.gestures.detectTapGestures
+import androidx.compose.foundation.interaction.MutableInteractionSource
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.BoxScope
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.foundation.layout.fillMaxSize
+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.shape.CircleShape
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material.Icon
+import androidx.compose.material.IconButton
+import androidx.compose.material.Surface
+import androidx.compose.material.Text
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Add
+import androidx.compose.material.icons.filled.Minimize
+import androidx.compose.material.icons.filled.NetworkCell
+import androidx.compose.material.icons.filled.Wifi
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.MutableState
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.alpha
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.draw.paint
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.toArgb
+import androidx.compose.ui.input.pointer.pointerInput
+import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalView
+import androidx.compose.ui.res.colorResource
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.text.style.TextOverflow
+import androidx.compose.ui.unit.dp
+import androidx.navigation.NavHostController
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.beans.toChangeServer
+import com.vpn.fastestvpnservice.constants.smartConnect
+import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
+import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.AddRowSettingsSmart
+import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.onServer
+import com.vpn.fastestvpnservice.screens.serverListViewModelSplash
+import com.vpn.fastestvpnservice.sealedClass.Screen
+import com.vpn.fastestvpnservice.utils.Utils
+
+var selectedSmart: MutableState<String> = mutableStateOf("")
+
+@Composable
+fun AutoConnectScreen(navHostController: NavHostController) {
+    val context = LocalContext.current
+    val basePreferenceHelper = BasePreferenceHelper(context)
+    selectedSmart.value = basePreferenceHelper.getSmartList()
+    var isAdded by rememberSaveable { mutableStateOf(false) }
+    var isAddedWifi by rememberSaveable { mutableStateOf(false) }
+
+    Box(
+        modifier = Modifier
+            .fillMaxSize()
+            .background(
+                color = MaterialTheme.colorScheme.background
+            )
+    ) {
+        val view = LocalView.current
+        val window = (view.context as Activity).window
+        window.statusBarColor = Color.Transparent.toArgb()
+        window.navigationBarColor = Color.Transparent.toArgb()
+
+        HeaderRowACS(navHostController = navHostController)
+
+        Column(
+            verticalArrangement = Arrangement.Top,
+            horizontalAlignment = Alignment.Start,
+            modifier = Modifier
+                .padding(top = 120.dp, start = 16.dp, end = 0.dp)
+                .fillMaxSize()
+                .background(Color.Transparent)
+        ) {
+            Text(
+                text = context.getString(R.string.preferred_location),
+                color = MaterialTheme.colorScheme.primary,
+                style = MaterialTheme.typography.titleSmall,
+                modifier = Modifier
+                    .padding(end = 27.dp)
+            )
+
+            Text(
+                text = context.getString(R.string.auto_connect_location),
+                color = colorResource(id = R.color.gray_icon),
+                style = MaterialTheme.typography.displaySmall,
+                modifier = Modifier
+                    .padding(top = 5.dp, end = 27.dp)
+                    .alpha(1f)
+            )
+
+            AddRowSettingsSmart(
+                icon = R.drawable.smart_connect3x,
+                text = selectedSmart.value,
+                isRowShown = true,
+                isSheetShown = false,
+                navHostController = navHostController,
+                topPadding = 20.dp
+            )
+
+            Box(
+                modifier = Modifier
+                    .wrapContentHeight()
+                    .fillMaxWidth()
+                    .padding(top = 20.dp, end = 27.dp)
+                    .border(
+                        border = BorderStroke(1.dp, colorResource(id = R.color.graywidget)),
+                        shape = RoundedCornerShape(14.dp)
+                    )
+                    .background(
+                        shape = RoundedCornerShape(14.dp),
+                        color = MaterialTheme.colorScheme.onBackground
+                    )
+            ) {
+                Text(
+                    text = context.getString(R.string.auto_connect_functionality),
+                    color = colorResource(id = R.color.gray_icon),
+                    style = MaterialTheme.typography.displaySmall,
+                    modifier = Modifier
+                        .padding(all = 10.dp)
+                        .alpha(1f)
+                )
+            }
+
+            Surface(
+                modifier = Modifier
+                    .padding(top = 20.dp, end = 27.dp)
+                    .height(1.dp)
+                    .fillMaxWidth()
+                    .alpha(0.5F),
+                color = colorResource(id = R.color.gray_icon)
+            ) {}
+
+            Text(
+                text = context.getString(R.string.trusted_network),
+                color = MaterialTheme.colorScheme.primary,
+                style = MaterialTheme.typography.titleSmall,
+                modifier = Modifier.padding(top = 20.dp)
+            )
+
+            Text(
+                text = context.getString(R.string.trusted_network_disconnected),
+                color = colorResource(id = R.color.gray_icon),
+                style = MaterialTheme.typography.displaySmall,
+                modifier = Modifier
+                    .padding(top = 15.dp, end = 27.dp)
+                    .alpha(1f)
+            )
+
+            Text(
+                text = context.getString(R.string.trusted_network_reconnected),
+                color = colorResource(id = R.color.gray_icon),
+                style = MaterialTheme.typography.displaySmall,
+                modifier = Modifier
+                    .padding(top = 5.dp, end = 27.dp)
+                    .alpha(1f)
+            )
+
+            Box(
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .padding(start = 0.dp, end = 27.dp, top = 20.dp)
+                    .background(Color.Transparent)
+                    .clickable(
+                        indication = null,
+                        interactionSource = remember { MutableInteractionSource() }
+                    ) {},
+                contentAlignment = Alignment.CenterStart
+            ) {
+                Icon(
+                    painter = painterResource(id = R.drawable.cellular_alt_24),
+                    contentDescription = "Mobile Network",
+                    tint = colorResource(id = R.color.gray_icon),
+                    modifier = Modifier
+                        .padding(top = 0.dp, bottom = 0.dp)
+                        .size(20.dp)
+                        .align(Alignment.CenterStart)
+                )
+
+                Surface(
+                    modifier = Modifier
+                        .padding(start = 40.dp, bottom = 0.dp, end = 110.dp)
+                        .align(Alignment.CenterStart)
+                        .background(Color.Transparent),
+                    color = Color.Transparent
+                ) {
+                    Text(
+                        text = "Mobile network",
+                        style = MaterialTheme.typography.labelMedium,
+                        color = colorResource(id = R.color.gray_icon),
+                        maxLines = 1,
+                        overflow = TextOverflow.Ellipsis,
+                        modifier = Modifier
+                            .align(Alignment.CenterStart)
+                    )
+                }
+                val isAddedText = if (isAdded) "Remove" else "Add"
+                val isAddedColor = if (isAdded) colorResource(id = R.color.Red) else colorResource(id = R.color.LightSeaGreen)
+
+                Row(
+                    modifier = Modifier
+                        .padding(bottom = 0.dp, end = 0.dp)
+                        .align(Alignment.CenterEnd)
+                        .background(Color.Transparent)
+                        .pointerInput(Unit) {
+                            detectTapGestures {
+                                isAdded = !isAdded
+                            }
+                        },
+                    verticalAlignment = Alignment.CenterVertically
+                ) {
+                    Text(
+                        text = isAddedText,
+                        style = MaterialTheme.typography.displayMedium,
+                        color = isAddedColor,
+                        modifier = Modifier
+                            .padding(end = 8.dp, bottom = 0.dp)
+
+                    )
+                    IconButton(
+                        modifier = Modifier
+                            .size(20.dp),
+                        onClick = {
+                            isAdded = !isAdded
+                        }
+                    ) {
+                        Icon(
+                            painter = if (isAdded) painterResource(id = R.drawable.remove_circle_outline_24)
+                            else painterResource(id = R.drawable.add_circle_outline_24),
+                            contentDescription = "Server Logo",
+                            tint = isAddedColor,
+                            modifier = Modifier.size(20.dp)
+                        )
+                    }
+                }
+            }
+
+            Surface(
+                modifier = Modifier
+                    .padding(top = 20.dp, end = 27.dp)
+                    .height(1.dp)
+                    .fillMaxWidth()
+                    .alpha(0.6F),
+                color = colorResource(id = R.color.gray_icon)
+            ) {}
+
+            Box(
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .padding(start = 0.dp, end = 27.dp, top = 20.dp)
+                    .background(Color.Transparent)
+                    .clickable(
+                        indication = null,
+                        interactionSource = remember { MutableInteractionSource() }
+                    ) {},
+                contentAlignment = Alignment.CenterStart
+            ) {
+                Icon(
+                    imageVector = Icons.Default.Wifi,
+                    contentDescription = "Mobile Network",
+                    tint = colorResource(id = R.color.gray_icon),
+                    modifier = Modifier
+                        .padding(top = 0.dp, bottom = 0.dp)
+                        .size(20.dp)
+                        .align(Alignment.CenterStart)
+                )
+
+                Surface(
+                    modifier = Modifier
+                        .padding(start = 40.dp, bottom = 0.dp, end = 110.dp)
+                        .align(Alignment.CenterStart)
+                        .background(Color.Transparent),
+                    color = Color.Transparent
+                ) {
+                    Text(
+                        text = "Wifi",
+                        style = MaterialTheme.typography.labelMedium,
+                        color = colorResource(id = R.color.gray_icon),
+                        maxLines = 1,
+                        overflow = TextOverflow.Ellipsis,
+                        modifier = Modifier
+                            .align(Alignment.CenterStart)
+                    )
+                }
+                val isAddedText = if (isAddedWifi) "Remove" else "Add"
+                val isAddedColor = if (isAddedWifi) colorResource(id = R.color.Red) else colorResource(id = R.color.LightSeaGreen)
+
+                Row(
+                    modifier = Modifier
+                        .padding(bottom = 0.dp, end = 0.dp)
+                        .align(Alignment.CenterEnd)
+                        .background(Color.Transparent)
+                        .pointerInput(Unit) {
+                            detectTapGestures {
+                                isAddedWifi = !isAddedWifi
+                            }
+                        },
+                    verticalAlignment = Alignment.CenterVertically
+                ) {
+                    Text(
+                        text = isAddedText,
+                        style = MaterialTheme.typography.displayMedium,
+                        color = isAddedColor,
+                        modifier = Modifier
+                            .padding(end = 8.dp, bottom = 0.dp)
+
+                    )
+                    IconButton(
+                        modifier = Modifier
+                            .size(20.dp),
+                        onClick = {
+                            isAddedWifi = !isAddedWifi
+                        }
+                    ) {
+                        Icon(
+                            painter = if (isAddedWifi) painterResource(id = R.drawable.remove_circle_outline_24)
+                            else painterResource(id = R.drawable.add_circle_outline_24),
+                            contentDescription = "Server Logo",
+                            tint = isAddedColor,
+                            modifier = Modifier.size(20.dp)
+                        )
+                    }
+                }
+            }
+        }
+    }
+}
+
+@Composable
+fun BoxScope.HeaderRowACS(navHostController: NavHostController) {
+    val context = LocalContext.current
+    IconButton(
+        onClick = {
+            navHostController.popBackStack()
+//                    navHostController.navigate(BottomBarScreen.Help.route)
+        },
+        modifier = Modifier
+            .align(Alignment.TopStart)
+            .padding(top = 50.dp)
+            .padding(start = 16.dp)
+            .size(30.dp, 32.dp)
+    ) {
+        Icon(
+            painter = painterResource(id = R.drawable.backarrow3x),
+            contentDescription = "Arrow-Back",
+            tint = MaterialTheme.colorScheme.primary,
+            modifier = Modifier.size(18.dp, 12.dp)
+        )
+    }
+    Surface(
+        modifier = Modifier
+            .padding(top = 50.dp)
+            .height(32.dp)
+            .align(Alignment.TopCenter)
+            .padding(5.dp),
+        color = colorResource(id = R.color.transparent)
+    ) {
+        Text(text = context.getString(R.string.auto_connect),
+            color = MaterialTheme.colorScheme.primary,
+            style = MaterialTheme.typography.bodyMedium,
+            modifier = Modifier.fillMaxHeight()
+
+        )
+    }
+}

+ 2 - 2
app/src/main/java/com/vpn/fastestvpnservice/screens/settingsScreenAll/NotificationsScreen.kt

@@ -124,11 +124,11 @@ fun BoxScope.HeaderRowNS(navHostController: NavHostController) {
             .padding(5.dp),
         color = colorResource(id = R.color.transparent)
     ) {
-        Text(text = context.getString(R.string.notifcation),
+        Text(
+            text = context.getString(R.string.notifcation),
             color = MaterialTheme.colorScheme.primary,
             style = MaterialTheme.typography.bodyMedium,
             modifier = Modifier.fillMaxHeight()
-
         )
     }
 }

+ 1 - 0
app/src/main/java/com/vpn/fastestvpnservice/sealedClass/Screen.kt

@@ -19,5 +19,6 @@ sealed class Screen(val route: String, var isTrue: Boolean = false) {
     data object SplitTunneling : Screen("split_tunneling_screen")
     data object FavoriteServers : Screen("favorite_servers_screen")
     data object Subscription : Screen("subscription_screen")
+    data object AutoConnect : Screen("auto_connect_screen")
 
 }

BIN=BIN
app/src/main/res/drawable/add_circle.png


+ 5 - 0
app/src/main/res/drawable/add_circle_outline_24.xml

@@ -0,0 +1,5 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
+      
+    <path android:fillColor="@android:color/white" android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
+    
+</vector>

+ 5 - 0
app/src/main/res/drawable/cellular_alt_24.xml

@@ -0,0 +1,5 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
+      
+    <path android:fillColor="@android:color/white" android:pathData="M17,4h3v16h-3zM5,14h3v6L5,20zM11,9h3v11h-3z"/>
+    
+</vector>

BIN=BIN
app/src/main/res/drawable/remove_circle.png


+ 5 - 0
app/src/main/res/drawable/remove_circle_outline_24.xml

@@ -0,0 +1,5 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
+      
+    <path android:fillColor="@android:color/white" android:pathData="M7,11v2h10v-2L7,11zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
+    
+</vector>

+ 6 - 0
app/src/main/res/values/strings.xml

@@ -562,6 +562,12 @@
     <string name="only_selected_apps_not_use_vpn">Do not allow selected apps to use the VPN</string>
     <string name="select_language">Select Language</string>
     <string name="details">Details</string>
+    <string name="preferred_location">Preferred location</string>
+    <string name="auto_connect_location">When untrusted network is listed it will connect to:</string>
+    <string name="auto_connect_functionality">If you disconnect from VPN while Auto-connect is ON, you\'ll be automatically reconnected if you switch networks or restart the app.</string>
+    <string name="trusted_network">Trusted networks</string>
+    <string name="trusted_network_disconnected">Stay disconnected from VPN while on a network you trust.</string>
+    <string name="trusted_network_reconnected">You\'ll be reconnected to VPN after leaving the trusted network.</string>
 
     <!-- Help Screen -->
     <string name="help">Help</string>