| 
					
				 | 
			
			
				@@ -1,7 +1,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.vpn.fastestvpnservice.screens.accountScreensAll 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import android.content.res.Configuration 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import android.util.Log 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import android.os.Handler 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import android.os.Looper 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.foundation.ExperimentalFoundationApi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.foundation.LocalOverscrollConfiguration 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.foundation.background 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -24,10 +25,10 @@ import androidx.compose.material3.MaterialTheme 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.runtime.Composable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.runtime.CompositionLocalProvider 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.runtime.getValue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import androidx.compose.runtime.key 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 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.mutableIntStateOf 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import androidx.compose.runtime.saveable.rememberSaveable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.runtime.setValue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.ui.Alignment 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.compose.ui.Modifier 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -35,24 +36,18 @@ 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.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.dp 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import androidx.compose.ui.unit.sp 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.lifecycle.viewmodel.compose.viewModel 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.navigation.NavHostController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import androidx.navigation.compose.rememberNavController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.stealthcopter.networktools.Ping 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.stealthcopter.networktools.ping.PingResult 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.stealthcopter.networktools.ping.PingStats 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.vpn.fastestvpnservice.R 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.vpn.fastestvpnservice.beans.favList 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.vpn.fastestvpnservice.beans.Server 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.vpn.fastestvpnservice.customItems.FavoriteServerItem 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.vpn.fastestvpnservice.customItems.ServerItem 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.onServer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.vpn.fastestvpnservice.sealedClass.Screen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.vpn.fastestvpnservice.viewmodels.HomeViewModel 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.vpn.fastestvpnservice.viewmodels.ServerListViewModel 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @OptIn(ExperimentalFoundationApi::class) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -84,6 +79,7 @@ fun FavoriteServers(navHostController: NavHostController) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .background(Color.Transparent) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             val favoriteServers = serverListViewModel.liveDataGetFavList.observeAsState().value 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            var ping by rememberSaveable { mutableIntStateOf(0) } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             CompositionLocalProvider( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 LocalOverscrollConfiguration provides null 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -103,7 +99,11 @@ fun FavoriteServers(navHostController: NavHostController) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     favoriteServers?.let { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         items(items = favoriteServers) {server -> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            FavoriteServerItem(server = server, navHostController) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            calPing(server) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                                server.ping = it 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+////                                if (server.ping != 0) ping = it 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            FavoriteServerItem(server = server, navHostController, server.ping) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -113,6 +113,23 @@ fun FavoriteServers(navHostController: NavHostController) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+fun calPing(server: Server, updatePing: (Int) -> Unit) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    Ping.onAddress(server.ip as String).setTimeOutMillis(1000).doPing( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        object : Ping.PingListener{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            override fun onResult(pingResult: PingResult?) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Handler(Looper.getMainLooper()).post { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    pingResult?.let { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        updatePing(it.timeTaken.toInt()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            override fun onError(e: Exception?) {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            override fun onFinished(pingStats: PingStats?) {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Composable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 fun BoxScope.HeaderRowFS( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     navHostController: NavHostController) { 
			 |