Procházet zdrojové kódy

Remove upgrade subscription screen from account screen on TV & set focus on 1st item on account screen, create any specific screen on TV for smart connect servers list, added AnySpecificScreenTV composable route on Bottom Nav Bar for TV, created SearchServerItemTV for TV layout for server (Row-Layout), initializing servers list all for searching of list on smart connect screen and remove dragHandle from ModalBottomSheet on TV.

Khubaib před 7 měsíci
rodič
revize
dd838aec09

+ 1 - 1
.idea/deploymentTargetSelector.xml

@@ -4,7 +4,7 @@
     <selectionStates>
     <selectionStates>
       <SelectionState runConfigName="app">
       <SelectionState runConfigName="app">
         <option name="selectionMode" value="DROPDOWN" />
         <option name="selectionMode" value="DROPDOWN" />
-        <DropdownSelection timestamp="2024-07-18T15:11:26.301183634Z">
+        <DropdownSelection timestamp="2024-07-18T15:20:53.451269375Z">
           <Target type="DEFAULT_BOOT">
           <Target type="DEFAULT_BOOT">
             <handle>
             <handle>
               <DeviceId pluginId="Default" identifier="serial=192.168.108.28:5555;connection=909aac42" />
               <DeviceId pluginId="Default" identifier="serial=192.168.108.28:5555;connection=909aac42" />

+ 5 - 1
app/src/main/java/com/vpn/fastestvpnservice/customItems/ServerItem.kt

@@ -222,7 +222,11 @@ fun ServerItem(server: Server, navHostController: NavHostController, serverPing:
 }
 }
 
 
 @Composable
 @Composable
-fun FavoriteServerItem(server: Server, navHostController: NavHostController, serverPing: Int) {
+fun FavoriteServerItem(
+    server: Server,
+    navHostController: NavHostController,
+    serverPing: Int
+) {
     val context = LocalContext.current
     val context = LocalContext.current
     val basePreferenceHelper = BasePreferenceHelper(context)
     val basePreferenceHelper = BasePreferenceHelper(context)
 //    val serverListViewModel: ServerListViewModel = viewModel {
 //    val serverListViewModel: ServerListViewModel = viewModel {

+ 126 - 0
app/src/main/java/com/vpn/fastestvpnservice/customItems/ServerItemTV.kt

@@ -58,6 +58,7 @@ import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.navHostController1
 import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.onServer
 import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.onServer
 import com.vpn.fastestvpnservice.screens.serverListViewModelSplash
 import com.vpn.fastestvpnservice.screens.serverListViewModelSplash
 import com.vpn.fastestvpnservice.screensTV.ServerListTV
 import com.vpn.fastestvpnservice.screensTV.ServerListTV
+import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
 import com.vpn.fastestvpnservice.sealedClass.Screen
 import com.vpn.fastestvpnservice.sealedClass.Screen
 import com.vpn.fastestvpnservice.utils.Utils
 import com.vpn.fastestvpnservice.utils.Utils
 import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
 import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
@@ -216,6 +217,131 @@ fun ServerItemTV(
     }
     }
 }
 }
 
 
+@Composable
+fun SearchServerItemTV(
+    server: Server,
+    navHostController: NavHostController,
+    serverPing: Int
+) {
+    val context = LocalContext.current
+    val basePreferenceHelper = BasePreferenceHelper(context)
+    val scope = rememberCoroutineScope()
+    val homeViewModel: HomeViewModel = viewModel {
+        HomeViewModel(context, scope)
+    }
+    var isFavorite by remember { mutableStateOf(server.isFavourited) }
+    val isServerFavourited: Boolean = server.isFavourited == true
+    Log.d("test-server_fav_d", "$isFavorite")
+    var isItemFocused by remember { mutableStateOf(false) }
+    var isFavServerClicked by remember { mutableStateOf(false) }
+    if (isFavServerClicked) {
+        Log.d("ServerCallbacks", "isServerClicked $isFavServerClicked")
+//        onServer.onServerSelected(
+//            context,
+//            homeViewModel,
+//            onClick = { isFavServerClicked = false },
+//            true,
+//            server
+//        )
+//        navHostController.popBackStack(BottomBarScreen.Home.route, false)
+    }
+
+    Box(
+        modifier = Modifier
+            .fillMaxWidth()
+            .background(if (isItemFocused) Color.LightGray else Color.Transparent)
+            .padding(bottom = 1.dp)
+    ) {
+        Row(
+            verticalAlignment = Alignment.Top,
+            horizontalArrangement = Arrangement.Start,
+            modifier = Modifier
+                .fillMaxWidth()
+                .padding(start = 12.dp, end = 7.dp, top = 12.dp)
+                .onFocusChanged {
+                    isItemFocused = it.isFocused
+                }
+                .focusable()
+                .clickable(
+                    indication = null,
+                    interactionSource = remember { MutableInteractionSource() }
+                ) {
+                    if (server.enable == 1) {
+                        basePreferenceHelper.saveSmartList(smartConnect[2])
+                        basePreferenceHelper.setSmartServerObject(server)
+                        navHostController.popBackStack()
+//                        isFavServerClicked = true
+                    } else {
+//                        basePreferenceHelper.setSubscriptionServerObject(server)
+//                        Screen.Subscription.isTrue = true
+//                        navHostController.navigate(
+//                            Screen.Subscription.route
+//                        )
+                    }
+                }
+        ) {
+            val icon = if (server.enable == 1) Utils.getDrawable(context, server.iso)
+            else Utils.getDrawableGray(context, server.iso)
+            Icon(
+                painter = painterResource(id = icon),
+                contentDescription = "Server Logo",
+                tint = Color.Unspecified,
+                modifier = Modifier
+                    .padding(bottom = 16.dp)
+                    .size(24.dp)
+                    .clip(CircleShape)
+                    .border(1.dp, colorResource(id = R.color.gray_opac_04), CircleShape)
+                    .paint(
+                        painter = painterResource(id = icon),
+                        contentScale = ContentScale.FillBounds
+                    )
+            )
+            Text(text = server.server_name!!,
+                color = MaterialTheme.colorScheme.primary,
+                style = MaterialTheme.typography.labelMedium,
+                modifier = Modifier
+                    .padding(start = 16.dp, bottom = 18.dp)
+                    .align(Alignment.CenterVertically)
+            )
+            Spacer(modifier = Modifier.weight(1F))
+            Text(text = "$serverPing ms",
+                color = colorResource(id = R.color.blue_text),
+                style = MaterialTheme.typography.displayMedium,
+                modifier = Modifier
+                    .padding(end = 30.dp, bottom = 18.dp)
+                    .align(Alignment.CenterVertically)
+            )
+            IconButton(
+                onClick = {
+                    isFavorite = !isFavorite!!
+                    serverListViewModelSplash.favAndUnFav(server)
+                },
+                modifier = Modifier
+                    .padding(bottom = 18.dp, end = 0.dp)
+                    .size(25.dp)
+            ) {
+                Icon(
+                    painter = if (isServerFavourited) painterResource(
+                        id = R.drawable.fav_server3x) else painterResource(
+                        id = R.drawable.unfav_server3x),
+                    contentDescription = "Server Logo",
+                    tint = Color.Unspecified,
+                    modifier = Modifier.size(22.dp, 21.dp)
+                )
+            }
+        }
+        Surface(
+            modifier = Modifier
+                .padding(start = 0.dp, end = 0.dp)
+                .height(1.dp)
+                .fillMaxWidth()
+                .alpha(0.6F)
+                .align(Alignment.BottomCenter),
+            color = colorResource(id = R.color.gray_icon)
+        ) {}
+    }
+}
+
 @Preview
 @Preview
 @Composable
 @Composable
 fun ServerListTVPreview() {
 fun ServerListTVPreview() {

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

@@ -23,6 +23,7 @@ import com.vpn.fastestvpnservice.screensTV.helpScreensAll.AboutTV
 import com.vpn.fastestvpnservice.screensTV.helpScreensAll.FaqTV
 import com.vpn.fastestvpnservice.screensTV.helpScreensAll.FaqTV
 import com.vpn.fastestvpnservice.screensTV.helpScreensAll.PrivacyPolicyTV
 import com.vpn.fastestvpnservice.screensTV.helpScreensAll.PrivacyPolicyTV
 import com.vpn.fastestvpnservice.screensTV.helpScreensAll.TermsAndConditionsTV
 import com.vpn.fastestvpnservice.screensTV.helpScreensAll.TermsAndConditionsTV
+import com.vpn.fastestvpnservice.screensTV.settingsScreenAll.AnySpecificScreenTV
 import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
 import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
 import com.vpn.fastestvpnservice.sealedClass.ScreenTV
 import com.vpn.fastestvpnservice.sealedClass.ScreenTV
 
 
@@ -84,6 +85,9 @@ fun BottomBarNavGraphTV(navHostController: NavHostController,
         composable(route = ScreenTV.AboutTV.route) {
         composable(route = ScreenTV.AboutTV.route) {
             AboutTV(navHostController = navHostController)
             AboutTV(navHostController = navHostController)
         }
         }
+        composable(route = ScreenTV.AnySpecificScreenTV.route) {
+            AnySpecificScreenTV(navHostController = navHostController)
+        }
 
 
         /* Again declare for login because of different -> navHostController */
         /* Again declare for login because of different -> navHostController */
 //        composable(route = Screen.Login.route) {
 //        composable(route = Screen.Login.route) {

+ 12 - 11
app/src/main/java/com/vpn/fastestvpnservice/screensTV/AccountScreenTV.kt

@@ -169,16 +169,16 @@ fun AccountTV(navHostController: NavHostController,
 
 
                 Spacer(modifier = Modifier.height(22.dp))
                 Spacer(modifier = Modifier.height(22.dp))
 
 
-                AddRowAccountIconTV(
-                    icon = painterResource(id = R.drawable.subscription3x),
-                    text = "Upgrade Subscription",
-                    onClick = {
-                        navHostController.navigate(
-                            Screen.Subscription.route
-                        )
-                    },
-                    focusRequester1
-                )
+//                AddRowAccountIconTV(
+//                    icon = painterResource(id = R.drawable.subscription3x),
+//                    text = "Upgrade Subscription",
+//                    onClick = {
+//                        navHostController.navigate(
+//                            Screen.Subscription.route
+//                        )
+//                    },
+//                    focusRequester1
+//                )
                 AddRowAccountIconTV(
                 AddRowAccountIconTV(
                     icon = painterResource(id = R.drawable.fav3x),
                     icon = painterResource(id = R.drawable.fav3x),
                     text = "Favorite Servers",
                     text = "Favorite Servers",
@@ -186,7 +186,8 @@ fun AccountTV(navHostController: NavHostController,
                         navHostController.navigate(
                         navHostController.navigate(
                             Screen.FavoriteServers.route
                             Screen.FavoriteServers.route
                         )
                         )
-                    }
+                    },
+                    focusRequester1
                 )
                 )
                 AddRowAccountIconTV(
                 AddRowAccountIconTV(
                     icon = painterResource(id = R.drawable.lock3x),
                     icon = painterResource(id = R.drawable.lock3x),

+ 5 - 22
app/src/main/java/com/vpn/fastestvpnservice/screensTV/ServerListScreenTV.kt

@@ -1,50 +1,31 @@
 package com.vpn.fastestvpnservice.screensTV
 package com.vpn.fastestvpnservice.screensTV
 
 
-import android.util.Log
-import android.widget.Toast
 import androidx.compose.foundation.background
 import androidx.compose.foundation.background
-import androidx.compose.foundation.clickable
 import androidx.compose.foundation.focusable
 import androidx.compose.foundation.focusable
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.fillMaxHeight
 import androidx.compose.foundation.layout.fillMaxHeight
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.size
 import androidx.compose.foundation.lazy.LazyRow
 import androidx.compose.foundation.lazy.LazyRow
 import androidx.compose.foundation.lazy.itemsIndexed
 import androidx.compose.foundation.lazy.itemsIndexed
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.verticalScroll
 import androidx.compose.foundation.verticalScroll
-import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.automirrored.filled.ArrowBack
-import androidx.compose.material3.Icon
-import androidx.compose.material3.IconButton
 import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.Surface
 import androidx.compose.material3.Surface
 import androidx.compose.material3.Text
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.Composable
-import androidx.compose.runtime.LaunchedEffect
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.focus.FocusRequester
-import androidx.compose.ui.focus.focusRequester
-import androidx.compose.ui.focus.onFocusChanged
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.res.colorResource
 import androidx.compose.ui.res.colorResource
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.dp
 import androidx.navigation.NavHostController
 import androidx.navigation.NavHostController
 import com.vpn.fastestvpnservice.R
 import com.vpn.fastestvpnservice.R
-import com.vpn.fastestvpnservice.beans.Server
 import com.vpn.fastestvpnservice.customItems.ServerItemTV
 import com.vpn.fastestvpnservice.customItems.ServerItemTV
-import com.vpn.fastestvpnservice.screens.serverListViewModelSplash
 
 
 @Composable
 @Composable
 fun ServerListTV(navHostController: NavHostController) {
 fun ServerListTV(navHostController: NavHostController) {
@@ -58,7 +39,7 @@ fun ServerListTV(navHostController: NavHostController) {
             .padding(bottom = 0.dp)
             .padding(bottom = 0.dp)
 
 
     ) {
     ) {
-        HeaderRowSL(navHostController = navHostController)
+        HeaderRowSL(navHostController = navHostController, title = "Locations")
 
 
 //        var locations by remember { mutableStateOf(ArrayList<Server>()) }
 //        var locations by remember { mutableStateOf(ArrayList<Server>()) }
 //        var dedicatedIP by remember { mutableStateOf(ArrayList<Server>()) }
 //        var dedicatedIP by remember { mutableStateOf(ArrayList<Server>()) }
@@ -205,7 +186,9 @@ fun ServerListTV(navHostController: NavHostController) {
 
 
 @Composable
 @Composable
 fun BoxScope.HeaderRowSL(
 fun BoxScope.HeaderRowSL(
-    navHostController: NavHostController) {
+    navHostController: NavHostController,
+    title: String
+) {
 //    val focusRequester1 = remember { FocusRequester() }
 //    val focusRequester1 = remember { FocusRequester() }
 //    var isButtonFocused by remember { mutableStateOf(false) }
 //    var isButtonFocused by remember { mutableStateOf(false) }
 //    LaunchedEffect(key1 = Unit) {
 //    LaunchedEffect(key1 = Unit) {
@@ -247,7 +230,7 @@ fun BoxScope.HeaderRowSL(
             .padding(5.dp),
             .padding(5.dp),
         color = colorResource(id = R.color.transparent)
         color = colorResource(id = R.color.transparent)
     ) {
     ) {
-        Text(text = "Locations",
+        Text(text = title,
             style = MaterialTheme.typography.bodyMedium,
             style = MaterialTheme.typography.bodyMedium,
 //            color = MaterialTheme.colorScheme.primary,
 //            color = MaterialTheme.colorScheme.primary,
             color = colorResource(id = R.color.dark_blue_gray_text),
             color = colorResource(id = R.color.dark_blue_gray_text),

+ 21 - 17
app/src/main/java/com/vpn/fastestvpnservice/screensTV/SettingsScreenTV.kt

@@ -637,13 +637,14 @@ fun ColumnScope.AddRowSettingsColumnTV(
                 sheetState = sheetState,
                 sheetState = sheetState,
 //                containerColor = MaterialTheme.colorScheme.onBackground
 //                containerColor = MaterialTheme.colorScheme.onBackground
                 containerColor = Color.White,
                 containerColor = Color.White,
+                dragHandle = {}
             ) {
             ) {
                 var isProtocolFocused by remember { mutableStateOf(false) }
                 var isProtocolFocused by remember { mutableStateOf(false) }
                 Box(modifier = Modifier
                 Box(modifier = Modifier
                     .background(Color.Transparent)
                     .background(Color.Transparent)
                     .fillMaxWidth()
                     .fillMaxWidth()
                     .height(340.dp)
                     .height(340.dp)
-                    .padding(start = 0.dp, top = 5.dp)
+                    .padding(start = 0.dp, top = 25.dp)
                     ,
                     ,
                 ) {
                 ) {
                     Column(
                     Column(
@@ -712,7 +713,7 @@ fun ColumnScope.AddRowSettingsColumnTV(
                                         )
                                         )
                                 )
                                 )
                                 Text(
                                 Text(
-                                    text = "$protocol $isProtocolFocused",
+                                    text = "$protocol",
                                     modifier = Modifier.padding(start = 12.dp),
                                     modifier = Modifier.padding(start = 12.dp),
                                     color = MaterialTheme.colorScheme.inversePrimary,
                                     color = MaterialTheme.colorScheme.inversePrimary,
                                     style = MaterialTheme.typography.bodySmall
                                     style = MaterialTheme.typography.bodySmall
@@ -887,13 +888,14 @@ fun ColumnScope.AddRowSettingsSmartTV(
                 BottomBarScreen.Settings.isTrue = false
                 BottomBarScreen.Settings.isTrue = false
             },
             },
             sheetState = sheetState,
             sheetState = sheetState,
-            containerColor = Color.White
+            containerColor = Color.White,
+            dragHandle = {}
         ) {
         ) {
             Box(modifier = Modifier
             Box(modifier = Modifier
                 .background(Color.Transparent)
                 .background(Color.Transparent)
                 .fillMaxWidth()
                 .fillMaxWidth()
                 .height(250.dp)
                 .height(250.dp)
-                .padding(start = 0.dp, top = 10.dp),
+                .padding(start = 0.dp, top = 25.dp),
             ) {
             ) {
                 val selectedSmartList = basePreferenceHelper.getSmartList()
                 val selectedSmartList = basePreferenceHelper.getSmartList()
                 val smartServer = basePreferenceHelper.getSmartServerObject() ?: basePreferenceHelper.getRecommendedServerObject()
                 val smartServer = basePreferenceHelper.getSmartServerObject() ?: basePreferenceHelper.getRecommendedServerObject()
@@ -930,11 +932,13 @@ fun ColumnScope.AddRowSettingsSmartTV(
                                         basePreferenceHelper.saveSmartList(smart)
                                         basePreferenceHelper.saveSmartList(smart)
                                         isSmartSheetOpen = false
                                         isSmartSheetOpen = false
 
 
-                                        if (smart == smartConnect[2]) {
-                                            Log.d("smartLocationList Row", smart)
-                                            isAnySpecificSheetOpen = true
-                                        }
-
+                                        navHostController.navigate(
+                                            ScreenTV.AnySpecificScreenTV.route
+                                        )
+//                                        if (smart == smartConnect[2]) {
+//                                            Log.d("smartLocationList Row", smart)
+//                                            isAnySpecificSheetOpen = true
+//                                        }
                                     },
                                     },
                                 )
                                 )
 //                                    .indication(
 //                                    .indication(
@@ -948,14 +952,14 @@ fun ColumnScope.AddRowSettingsSmartTV(
                         ) {
                         ) {
                             RadioButton(selected = smart == selectedSmartConnect,
                             RadioButton(selected = smart == selectedSmartConnect,
                                 onClick = {
                                 onClick = {
-                                    selectedSmartConnect = smart
-                                    basePreferenceHelper.saveSmartList(smart)
-                                    isSmartSheetOpen = false
-
-                                    if (smart == smartConnect[2]) {
-                                        Log.d("smartLocationList RB", smart)
-                                        isAnySpecificSheetOpen = true
-                                    }
+//                                    selectedSmartConnect = smart
+//                                    basePreferenceHelper.saveSmartList(smart)
+//                                    isSmartSheetOpen = false
+
+//                                    if (smart == smartConnect[2]) {
+//                                        Log.d("smartLocationList RB", smart)
+//                                        isAnySpecificSheetOpen = true
+//                                    }
                                 },
                                 },
                                 colors = RadioButtonDefaults.colors(
                                 colors = RadioButtonDefaults.colors(
                                     selectedColor = colorResource(id = R.color.radio_button_blue),
                                     selectedColor = colorResource(id = R.color.radio_button_blue),

+ 145 - 0
app/src/main/java/com/vpn/fastestvpnservice/screensTV/settingsScreenAll/AnySpecificScreenTV.kt

@@ -0,0 +1,145 @@
+package com.vpn.fastestvpnservice.screensTV.settingsScreenAll
+
+import android.util.Log
+import android.widget.Toast
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+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.lazy.LazyColumn
+import androidx.compose.foundation.lazy.LazyRow
+import androidx.compose.foundation.lazy.itemsIndexed
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material3.DockedSearchBar
+import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.SearchBarDefaults
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextFieldDefaults
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.livedata.observeAsState
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.res.colorResource
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.unit.dp
+import androidx.navigation.NavHostController
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.customItems.SearchServerItemTV
+import com.vpn.fastestvpnservice.customItems.ServerItemTV
+import com.vpn.fastestvpnservice.screens.searchListViewModelSplash
+import com.vpn.fastestvpnservice.screens.serverListViewModelSplash
+import com.vpn.fastestvpnservice.screensTV.HeaderRowSL
+import com.vpn.fastestvpnservice.screensTV.locations
+import kotlinx.coroutines.launch
+
+@OptIn(ExperimentalMaterial3Api::class)
+@Composable
+fun AnySpecificScreenTV(navHostController: NavHostController) {
+    val context = LocalContext.current
+//    val searchListViewModel = searchListViewModelSplash
+//    var searchText1 by remember { mutableStateOf("") }
+//    val isActive = searchListViewModel.isActive.observeAsState().value
+//    val scope = rememberCoroutineScope()
+
+    Box(
+        modifier = Modifier
+            .fillMaxSize()
+            .background(
+                color = colorResource(id = R.color.background_color_gray)
+            )
+            .padding(bottom = 0.dp)
+
+    ) {
+        HeaderRowSL(navHostController = navHostController, title = "All Locations")
+
+//        DockedSearchBar(
+//            query = searchText1,
+//            onQueryChange = {
+//                searchText1 = it
+////                                scope.launch {
+////                                    searchListViewModel.searchTextChange(it)
+////                                }
+//            },
+//            onSearch = {
+//                scope.launch {
+//                    searchListViewModel.isActiveChange(state = false, true)
+//                }
+////                                keyboardController?.hide()
+//            },
+//            active = isActive!!,
+//            onActiveChange = {
+//                scope.launch {
+//                    searchListViewModel.isActiveChange(it, isFromSettings = true)
+//                }
+//            },
+//            placeholder = {
+//                Text(
+//                    text = "Search Location",
+//                    style = MaterialTheme.typography.displaySmall,
+//                    color = colorResource(id = R.color.dark_blue_gray_text)
+//                )
+//            },
+//            leadingIcon = {
+//                Icon(
+//                    painter = painterResource(id = R.drawable.search3x),
+//                    contentDescription = "Search Icon",
+//
+//                    modifier = Modifier
+//                        .size(21.dp)
+//                )
+//            },
+//            colors = SearchBarDefaults.colors(
+//                containerColor = colorResource(id = R.color.white),
+//                dividerColor = Color.Transparent,
+//                inputFieldColors = TextFieldDefaults.colors(
+//                    focusedTextColor = colorResource(id = R.color.dark_blue_gray_text),
+//                    unfocusedTextColor = colorResource(id = R.color.dark_blue_gray_text),
+//                    unfocusedIndicatorColor = colorResource(id = R.color.dark_blue_gray_text),
+//                    focusedIndicatorColor = colorResource(id = R.color.dark_blue_gray_text),
+//                    disabledIndicatorColor = colorResource(id = R.color.dark_blue_gray_text),
+//                    cursorColor = colorResource(id = R.color.dark_blue_gray_text),
+//                )
+//            ),
+//            modifier = Modifier
+//                .fillMaxWidth()
+//                .height(50.dp)
+//                .padding(horizontal = 10.dp)
+//                .padding(top = 60.dp)
+//                .background(Color.Transparent)
+//        ) {}
+
+        val listAll = serverListViewModelSplash.liveDataAllServers.observeAsState().value
+        Column(
+            modifier = Modifier
+                .fillMaxSize()
+                .padding(top = 80.dp, start = 24.dp, end = 24.dp, bottom = 24.dp)
+//                .verticalScroll(rememberScrollState())
+                .background(Color.Transparent)
+        ) {
+            LazyColumn(
+                modifier = Modifier
+                    .padding(top = 10.dp, start = 0.dp, end = 0.dp)
+                    .background(Color.Transparent)
+            ) {
+                listAll?.let {
+                    itemsIndexed(items = listAll, itemContent = { index, server ->
+                        SearchServerItemTV(server = server, navHostController = navHostController, serverPing = server.ping)
+                    })
+                }
+            }
+        }
+    }
+}

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

@@ -12,4 +12,5 @@ sealed class ScreenTV(val route: String) {
     data object PrivacyPolicyTV : ScreenTV("privacy_policy_tv")
     data object PrivacyPolicyTV : ScreenTV("privacy_policy_tv")
     data object TermsAndConditionsTV : ScreenTV("terms_and_conditions_tv")
     data object TermsAndConditionsTV : ScreenTV("terms_and_conditions_tv")
     data object AboutTV : ScreenTV("about_tv")
     data object AboutTV : ScreenTV("about_tv")
+    data object AnySpecificScreenTV : ScreenTV("any_specific_screen_tv")
 }
 }

+ 12 - 12
app/src/main/java/com/vpn/fastestvpnservice/viewmodels/ServerListViewModel.kt

@@ -212,7 +212,7 @@ class ServerListViewModel(context: Context): ViewModel() {
         val data = preferencesHelper.getServerData()
         val data = preferencesHelper.getServerData()
 
 
         serversListGlobalTV.clear()
         serversListGlobalTV.clear()
-//        serversListAllGlobal.clear()
+        serversListAllGlobal.clear()
 //        serversGroupListGlobal.clear()
 //        serversGroupListGlobal.clear()
 
 
         data.forEachIndexed { index, serverData ->
         data.forEachIndexed { index, serverData ->
@@ -222,9 +222,9 @@ class ServerListViewModel(context: Context): ViewModel() {
                     val servers = serverListViewModelSplash.filterServersWithTvCountries(it)
                     val servers = serverListViewModelSplash.filterServersWithTvCountries(it)
                     serversListGlobalTV.add(index, ServerDataGlobal(serverData.name, servers))
                     serversListGlobalTV.add(index, ServerDataGlobal(serverData.name, servers))
 
 
-//                    servers.forEachIndexed { index, server ->
-//                        getServerGroupList(server, it, index)
-//                    }
+                    servers.forEachIndexed { index, server ->
+                        getServerGroupList(server, it, index)
+                    }
                 }
                 }
             } else {
             } else {
                 data[index].servers?.let {
                 data[index].servers?.let {
@@ -235,16 +235,16 @@ class ServerListViewModel(context: Context): ViewModel() {
         }
         }
 
 
 //        serversListFinalGlobal = serversListGlobal
 //        serversListFinalGlobal = serversListGlobal
-//        serversListGlobal.forEachIndexed { index, serverData ->
-//            serverData?.servers?.let { serversListAllGlobal.addAll(it) }
-//        }
-//
-//        serversGroupListGlobal.forEachIndexed { index, serverDataGlobal ->
-//            serverDataGlobal?.servers?.let { serversListAllGlobal.addAll(it) }
-//        }
+        serversListGlobalTV.forEachIndexed { index, serverData ->
+            serverData?.servers?.let { serversListAllGlobal.addAll(it) }
+        }
+
+        serversGroupListGlobal.forEachIndexed { index, serverDataGlobal ->
+            serverDataGlobal?.servers?.let { serversListAllGlobal.addAll(it) }
+        }
 
 
         _mutableLiveDataGetServersGlobal.value = serversListGlobalTV
         _mutableLiveDataGetServersGlobal.value = serversListGlobalTV
-//        mutableLiveDataAllServers.value = serversListAllGlobal
+        mutableLiveDataAllServers.value = serversListAllGlobal
     }
     }
 
 
     fun calculatePing(server: Server, onPingResult: (Int) -> Unit) {
     fun calculatePing(server: Server, onPingResult: (Int) -> Unit) {