浏览代码

TV, login screen, splash, Navigation etc done..

Khubaib 1 年之前
父节点
当前提交
b1e6f140c7

+ 1 - 1
.idea/deploymentTargetSelector.xml

@@ -4,7 +4,7 @@
     <selectionStates>
       <SelectionState runConfigName="app">
         <option name="selectionMode" value="DROPDOWN" />
-        <DropdownSelection timestamp="2024-06-21T15:07:37.894965434Z">
+        <DropdownSelection timestamp="2024-06-26T09:24:32.136478466Z">
           <Target type="DEFAULT_BOOT">
             <handle>
               <DeviceId pluginId="LocalEmulator" identifier="path=/home/ubuntu/.android/avd/Television_1080p_API_31.avd" />

+ 0 - 1
.idea/gradle.xml

@@ -15,6 +15,5 @@
         <option name="resolveExternalAnnotations" value="false" />
       </GradleProjectSettings>
     </option>
-    <option name="offlineMode" value="true" />
   </component>
 </project>

+ 3 - 1
app/build.gradle.kts

@@ -166,7 +166,9 @@ dependencies {
     debugImplementation("androidx.compose.ui:ui-tooling")
     debugImplementation("androidx.compose.ui:ui-test-manifest")
 
-
+    // TV
+    implementation("androidx.tv:tv-foundation:1.0.0-alpha10")
+    implementation("androidx.tv:tv-material:1.0.0-beta01")
 
     //strongswan
     android{

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

@@ -39,6 +39,7 @@ import com.vpn.fastestvpnservice.interfaces.OnBackPressedOnTV
 import com.vpn.fastestvpnservice.interfaces.UpdateServersOnProtocol
 import com.vpn.fastestvpnservice.interfaces.VPNConnectionCallBacks
 import com.vpn.fastestvpnservice.navigation.SetUpNavGraph
+import com.vpn.fastestvpnservice.navigation.SetUpNavGraphTV
 import com.vpn.fastestvpnservice.screens.helpScreensAll.fileChooserCallback
 import com.vpn.fastestvpnservice.ui.theme.FastestVPNTheme
 import com.vpn.fastestvpnservice.utils.StaticMethods
@@ -95,9 +96,15 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
 
                 if (StaticMethods.isTV(baseContext)) {
                     Log.d("test_platform_android", "TV")
-                    val intent = Intent(context, SplashActivity::class.java)
-                    context.startActivity(intent)
-                    finish()
+//                    val intent = Intent(context, SplashActivity::class.java)
+//                    context.startActivity(intent)
+//                    finish()
+
+                    FastestVPNTheme(isDarkTheme.value) {
+//                        window.statusBarColor = colorResource(id = R.color.blue_text).toArgb()
+                        val navController = rememberNavController()
+                        SetUpNavGraphTV(navHostController = navController)
+                    }
                 } else {
                     Log.d("test_platform_android", "Mobile")
                     FastestVPNTheme(isDarkTheme.value) {

+ 48 - 0
app/src/main/java/com/vpn/fastestvpnservice/navigation/NavGraphTV.kt

@@ -0,0 +1,48 @@
+package com.vpn.fastestvpnservice.navigation
+
+import androidx.compose.animation.AnimatedContentTransitionScope
+import androidx.compose.animation.EnterTransition
+import androidx.compose.animation.ExitTransition
+import androidx.compose.animation.core.tween
+import androidx.compose.animation.fadeIn
+import androidx.compose.animation.fadeOut
+import androidx.compose.runtime.Composable
+import androidx.navigation.NavBackStackEntry
+import androidx.navigation.NavHostController
+import androidx.navigation.compose.NavHost
+import androidx.navigation.compose.composable
+import com.vpn.fastestvpnservice.screens.Splash
+import com.vpn.fastestvpnservice.screens.helpScreensAll.TermsAndConditions
+import com.vpn.fastestvpnservice.screensTV.LoginTV
+import com.vpn.fastestvpnservice.screensTV.SplashTV
+import com.vpn.fastestvpnservice.sealedClass.ScreenTV
+
+@Composable
+fun SetUpNavGraphTV(navHostController: NavHostController) {
+    val noEnterTransition : AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = {
+        fadeIn(
+            animationSpec = tween(durationMillis = 0),
+            initialAlpha = 1f
+        )
+    }
+    val noExitTransition : AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = {
+        fadeOut(
+            animationSpec = tween(durationMillis = 0),
+            targetAlpha = 1f
+        )
+    }
+
+    NavHost(
+        navController = navHostController,
+        startDestination = ScreenTV.SplashTV.route,
+        enterTransition = noEnterTransition,
+        exitTransition = noExitTransition
+    ) {
+        composable(route = ScreenTV.SplashTV.route) {
+            SplashTV(navHostController = navHostController)
+        }
+        composable(route = ScreenTV.LoginTV.route) {
+            LoginTV(navHostController = navHostController)
+        }
+    }
+}

+ 3 - 18
app/src/main/java/com/vpn/fastestvpnservice/screens/BottomBarMainScreen.kt

@@ -4,23 +4,13 @@ import android.app.Activity
 import android.content.res.Configuration
 import android.util.Log
 import androidx.activity.ComponentActivity
-import androidx.compose.animation.AnimatedVisibility
 import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.RowScope
-import androidx.compose.foundation.layout.Spacer
-import androidx.compose.foundation.layout.WindowInsets
-import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.size
-import androidx.compose.foundation.layout.systemBars
-import androidx.compose.foundation.layout.width
-import androidx.compose.foundation.layout.windowInsetsPadding
 import androidx.compose.material.BottomNavigation
 import androidx.compose.material.BottomNavigationItem
-import androidx.compose.material.ContentAlpha
-import androidx.compose.material.LocalContentColor
 import androidx.compose.material3.Icon
 import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.Scaffold
@@ -37,27 +27,21 @@ import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.toArgb
 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.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
-import androidx.lifecycle.viewmodel.compose.viewModel
 import androidx.navigation.NavDestination
 import androidx.navigation.NavDestination.Companion.hierarchy
 import androidx.navigation.NavGraph.Companion.findStartDestination
 import androidx.navigation.NavHostController
 import androidx.navigation.compose.currentBackStackEntryAsState
 import androidx.navigation.compose.rememberNavController
-import com.vpn.fastestvpnservice.R
 import com.vpn.fastestvpnservice.navigation.BottomBarNavGraph
-import com.vpn.fastestvpnservice.navigation.navigationAnimation
 import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
 import com.vpn.fastestvpnservice.ui.theme.customTypography2
+import com.vpn.fastestvpnservice.utils.StaticMethods
 import com.vpn.fastestvpnservice.utils.isTablet
-import com.vpn.fastestvpnservice.viewmodels.SearchListViewModel
-import com.vpn.fastestvpnservice.viewmodels.ServerListViewModel
-import com.vpn.fastestvpnservice.viewmodels.SplashViewModel
 
 @Composable
 fun BottomBarMainScreen(navController: NavHostController, activity: ComponentActivity) {
@@ -101,6 +85,7 @@ fun BottomBarMainScreen(navController: NavHostController, activity: ComponentAct
 @Composable
 fun BottomBar(navHostController: NavHostController, screens: List<BottomBarScreen>) {
 
+    val context = LocalContext.current
     val navBackStackEntry = navHostController.currentBackStackEntryAsState()
     val currentDestination = navBackStackEntry.value?.destination
     Log.d("currentRoute -> BB ", currentDestination.toString())
@@ -109,7 +94,7 @@ fun BottomBar(navHostController: NavHostController, screens: List<BottomBarScree
         backgroundColor = MaterialTheme.colorScheme.onBackground,
         elevation = 0.dp,
 //        contentColor = Color.Gray,
-        modifier = Modifier.height(if (isTablet()) 150.dp else 110.dp)
+        modifier = Modifier.height(if (StaticMethods.isTV(context)) 90.dp else if (isTablet()) 150.dp else 110.dp)
     ) {
         screens.forEach { screen ->
             AddItem(

+ 322 - 0
app/src/main/java/com/vpn/fastestvpnservice/screensTV/LoginScreenTV.kt

@@ -0,0 +1,322 @@
+package com.vpn.fastestvpnservice.screensTV
+
+import android.widget.Toast
+import androidx.compose.foundation.BorderStroke
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.background
+import androidx.compose.foundation.border
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.focusable
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ColumnScope
+import androidx.compose.foundation.layout.Spacer
+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.shape.RoundedCornerShape
+import androidx.compose.foundation.text.KeyboardActions
+import androidx.compose.foundation.text.KeyboardOptions
+import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Scaffold
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextField
+import androidx.compose.material3.TextFieldDefaults
+import androidx.compose.runtime.Composable
+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.Modifier
+import androidx.compose.ui.draw.alpha
+import androidx.compose.ui.draw.paint
+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.layout.ContentScale
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalFocusManager
+import androidx.compose.ui.platform.LocalSoftwareKeyboardController
+import androidx.compose.ui.res.colorResource
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.text.input.ImeAction
+import androidx.compose.ui.text.input.KeyboardType
+import androidx.compose.ui.unit.dp
+import androidx.navigation.NavHostController
+import androidx.tv.material3.Border
+import androidx.tv.material3.Button
+import androidx.tv.material3.ButtonDefaults
+import androidx.tv.material3.Surface
+import androidx.tv.material3.SurfaceDefaults
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.beans.isDarkTheme
+import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
+import com.vpn.fastestvpnservice.ui.theme.customTypography
+
+@Composable
+fun LoginTV(navHostController: NavHostController) {
+    val context = LocalContext.current
+    val basePreferenceHelper = BasePreferenceHelper(context)
+    val keyboardController = LocalSoftwareKeyboardController.current
+    val focusManager = LocalFocusManager.current
+    var textChanged by remember { mutableStateOf("") }
+    var passwordChanged by remember { mutableStateOf("") }
+    var showErrorEmail by remember { mutableStateOf(false) }
+    var isTextFieldFocused by remember { mutableStateOf(false) }
+    var isTextFieldFocused2 by remember { mutableStateOf(false) }
+//    val focusRequester = remember { FocusRequester() }
+
+    Scaffold(
+        content = { padding ->
+            Box(
+                modifier = Modifier
+                    .fillMaxSize()
+                    .paint(
+                        painter = painterResource(id = if (isDarkTheme.value) R.drawable.bg_app else R.drawable.bg_app_light),
+                        contentScale = ContentScale.FillBounds
+                    ))
+            {
+                Image(
+                    painter = painterResource(
+                        id = R.drawable.fastestapp_logo3x),
+                    contentDescription = "FastestVPN",
+                    modifier = Modifier
+                        .padding(top = 25.dp)
+                        .size(width = 75.dp, height = 102.dp)
+                        .align(Alignment.TopCenter),
+                )
+
+                Column (
+                    modifier = Modifier
+                        .align(Alignment.Center)
+                        .background(Color.Transparent),
+                    verticalArrangement = Arrangement.Center,
+                    horizontalAlignment = Alignment.CenterHorizontally
+                ) {
+                    TextMsgTV(
+                        text = "Welcome Back!",
+                        color = Color.White,
+                        style = MaterialTheme.typography.displayLarge
+                    )
+                    Spacer(modifier = Modifier.height(20.dp))
+                    TextField(
+                        value = textChanged,
+                        onValueChange = {
+                            textChanged = it
+                        },
+                        textStyle = MaterialTheme.typography.customTypography.bodyMedium,
+                        modifier = Modifier
+                            .padding(start = 0.dp, end = 0.dp)
+                            .align(Alignment.CenterHorizontally)
+                            .fillMaxWidth(fraction = 0.5f)
+                            .height(60.dp)
+                            .border(
+                                2.dp,
+                                color = if (showErrorEmail) colorResource(id = R.color.red)
+                                else if (isTextFieldFocused) colorResource(id = R.color.app_yellow_color)
+                                else colorResource(id = R.color.white),
+                                shape = RoundedCornerShape(16.dp)
+                            )
+                            .background(color = colorResource(id = R.color.transparent))
+//                            .focusRequester(focusRequester)
+//                            .onFocusChanged {
+//                                isTextFieldFocused = it.isFocused
+//                                keyboardController?.show()
+//                            }
+//                            .focusable()
+//                            .clickable() {}
+                        ,
+                        shape = RoundedCornerShape(16.dp),
+                        label = {
+                            Text(text = "Email",
+                                style = MaterialTheme.typography.customTypography.bodyLarge
+                            )
+                        },
+//                        leadingIcon = {
+//                            Icon(
+//                                painter = painterResource(id = R.drawable.sms3x),
+//                                contentDescription = "Email Logo",
+//                                tint = colorResource(id = R.color.white),
+//                                modifier = Modifier
+//                                    .size(24.dp, 24.dp)
+//                            )
+//                        },
+                        maxLines = 1,
+                        colors = TextFieldDefaults.colors(
+                            focusedLabelColor = Color.Blue,
+                            unfocusedContainerColor = colorResource(id = R.color.transparent),
+                            focusedContainerColor = MaterialTheme.colorScheme.secondaryContainer,
+                            focusedIndicatorColor = colorResource(id = R.color.transparent),
+                            disabledIndicatorColor = colorResource(id = R.color.transparent),
+                            unfocusedIndicatorColor = colorResource(id = R.color.transparent),
+                            cursorColor = colorResource(id = R.color.white),
+
+                            ),
+                        keyboardOptions = KeyboardOptions(
+                            keyboardType = KeyboardType.Email,
+                            imeAction = ImeAction.Done
+                        ),
+                        keyboardActions = KeyboardActions(
+                            onDone = {
+                                focusManager.clearFocus()
+                                keyboardController?.hide()
+                            }
+                        ),
+                    )
+                    Spacer(modifier = Modifier.height(20.dp))
+
+                    TextField(
+                        value = passwordChanged,
+                        onValueChange = {
+//                            Log.d("onClick_test", "onValueChange -> ")
+                            passwordChanged = it
+                        },
+                        textStyle = MaterialTheme.typography.customTypography.bodyLarge,
+                        modifier = Modifier
+                            .padding(start = 0.dp, end = 0.dp)
+                            .align(Alignment.CenterHorizontally)
+                            .fillMaxWidth(fraction = 0.5f)
+                            .height(60.dp)
+                            .border(
+                                2.dp,
+                                color = if (isTextFieldFocused2) colorResource(id = R.color.app_yellow_color)
+                                    else colorResource(id = R.color.white),
+                                shape = RoundedCornerShape(16.dp)
+                            )
+//                            .background(color = colorResource(id = R.color.transparent))
+//                            .onFocusChanged {
+//                                isTextFieldFocused2 = it.isFocused
+//                            }
+//                            .focusable()
+//                            .clickable() {}
+                        ,
+
+                        shape = RoundedCornerShape(16.dp),
+                        label = {
+                            Text(text = "Password",
+                                style = MaterialTheme.typography.customTypography.bodyLarge
+                            )
+                        },
+                        maxLines = 1,
+                        colors = TextFieldDefaults.colors(
+                            focusedLabelColor = Color.Blue,
+                            unfocusedContainerColor = colorResource(id = R.color.transparent),
+                            focusedContainerColor = MaterialTheme.colorScheme.secondaryContainer,
+                            focusedIndicatorColor = colorResource(id = R.color.transparent),
+                            disabledIndicatorColor = colorResource(id = R.color.transparent),
+                            unfocusedIndicatorColor = colorResource(id = R.color.transparent),
+                            cursorColor = colorResource(id = R.color.white)
+                        ),
+                        keyboardOptions = KeyboardOptions(
+                            keyboardType = KeyboardType.Password,
+                            imeAction = ImeAction.Done
+                        ),
+                        keyboardActions = KeyboardActions(
+                            onDone = {
+                                focusManager.clearFocus()
+                                keyboardController?.hide()
+                            }
+                        ),
+                    )
+                    Spacer(modifier = Modifier.height(25.dp))
+                    LoginButtonTV()
+                }
+            }
+        }
+    )
+}
+
+@Composable
+fun ColumnScope.LoginButtonTV() {
+    var isButtonFocused by remember { mutableStateOf(false) }
+    val focusRequester = remember { FocusRequester() }
+    val focusManager = LocalFocusManager.current
+    val context = LocalContext.current
+    Button(
+        modifier = Modifier
+            .background(colorResource(id = R.color.transparent))
+            .fillMaxWidth(fraction = 0.5f)
+            .height(60.dp)
+            .focusRequester(focusRequester)
+            .onFocusChanged {
+                isButtonFocused = it.isFocused
+            }
+            .focusable()
+//            .clickable() { }
+        ,
+        onClick = {
+                  focusRequester.requestFocus()
+            Toast.makeText(
+                context, "Test", Toast.LENGTH_SHORT
+            ).show()
+        },
+        shape = ButtonDefaults.shape(
+            shape = RoundedCornerShape(16.dp),
+            focusedShape = RoundedCornerShape(16.dp),
+            focusedDisabledShape = RoundedCornerShape(16.dp),
+            disabledShape = RoundedCornerShape(16.dp),
+            pressedShape = RoundedCornerShape(16.dp),
+            ),
+        colors = ButtonDefaults.colors(
+            contentColor = MaterialTheme.colorScheme.primaryContainer,
+            containerColor = MaterialTheme.colorScheme.onSecondaryContainer,
+            pressedContainerColor = MaterialTheme.colorScheme.onSecondaryContainer,
+            focusedContainerColor = MaterialTheme.colorScheme.onSecondaryContainer,
+            disabledContainerColor = MaterialTheme.colorScheme.onSecondaryContainer,
+        ),
+        border = ButtonDefaults.border(
+            border = Border(
+                border = BorderStroke(
+                    2.dp, if(isButtonFocused) colorResource(id = R.color.app_yellow_color)
+                    else colorResource(id = R.color.transparent)
+                )
+            ),
+        )
+    ) {
+        Surface(
+            modifier = Modifier
+                .fillMaxSize()
+                .align(Alignment.CenterVertically)
+                .background(MaterialTheme.colorScheme.onSecondaryContainer),
+            colors = SurfaceDefaults.colors(
+                contentColor = MaterialTheme.colorScheme.primaryContainer,
+                containerColor = MaterialTheme.colorScheme.onSecondaryContainer,
+            )
+
+        ) {
+            Text(
+                modifier = Modifier
+                    .background(Color.Transparent)
+                    .align(Alignment.Center),
+                text = "Sign In",
+                style = MaterialTheme.typography.titleMedium,
+                color = MaterialTheme.colorScheme.primaryContainer
+//                textAlign = TextAlign.Center
+            )
+        }
+    }
+}
+
+@Composable
+fun ColumnScope.TextMsgTV(
+    text: String,
+    color: Color,
+    style: TextStyle,
+    alpha: Float = 1F
+) {
+    Text(
+        modifier = Modifier
+            .padding(top = 0.dp)
+            .alpha(alpha),
+        style = style,
+        text = text,
+        color = color,
+    )
+}

+ 97 - 0
app/src/main/java/com/vpn/fastestvpnservice/screensTV/SplashScreenTV.kt

@@ -0,0 +1,97 @@
+package com.vpn.fastestvpnservice.screensTV
+
+import android.app.Activity
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.systemBars
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.layout.windowInsetsPadding
+import androidx.compose.runtime.Composable
+import androidx.compose.material3.Button
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.paint
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.toArgb
+import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalView
+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.beans.isDarkTheme
+import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
+import com.vpn.fastestvpnservice.sealedClass.ScreenTV
+import kotlinx.coroutines.delay
+
+@Composable
+fun SplashTV(navHostController: NavHostController) {
+    val context = LocalContext.current
+    val basePreferenceHelper = BasePreferenceHelper(context)
+
+    Box(modifier = Modifier
+        .paint(
+            painter = painterResource(id = if (isDarkTheme.value) R.drawable.bg_app else R.drawable.bg_img3),
+            contentScale = ContentScale.FillBounds
+        )
+        .fillMaxSize(),
+//        .windowInsetsPadding(WindowInsets.systemBars),
+        ) {
+//        val view = LocalView.current
+//        val window = (view.context as Activity).window
+//        window.statusBarColor = Color.Transparent.toArgb()
+//        window.navigationBarColor = Color.Transparent.toArgb()
+        Image(
+            modifier = Modifier
+                .width(146.dp)
+                .height(199.dp)
+                .align(Alignment.Center),
+            painter = painterResource(
+                id = R.drawable.fastestapp_logo3x),
+            contentDescription = "FastestVPN",
+        )
+        Image(
+            modifier = Modifier
+                .align(Alignment.BottomCenter)
+                .padding(bottom = 50.dp)
+                .width(202.dp)
+                .height(28.dp),
+            painter = painterResource(
+                id = R.drawable.fastestvpn_name3),
+            contentDescription = "FastestVPN Name",
+        )
+        Row (
+            modifier = Modifier
+                .align(Alignment.BottomCenter)
+                .padding(50.dp),
+        ){}
+
+        val isLoggedIn = basePreferenceHelper.getLoggedInState()
+        val delay: Long = if (isLoggedIn) 1000 else 2000
+
+        LaunchedEffect(key1 = true) {
+//        splashViewModel.serverDataApi()
+            delay(delay)
+
+            if (isLoggedIn) {
+//                        serverListViewModelSplash.setRecommendedSmartServers()
+//                        serverListViewModelSplash.setCountryData()
+//                        splashViewModel.serverDataApi()
+                navHostController.popBackStack()
+                navHostController.navigate(ScreenTV.LoginTV.route)
+            } else {
+//            Toast.makeText(context, "else $isLoggedIn", Toast.LENGTH_SHORT).show()
+                navHostController.popBackStack()
+                navHostController.navigate(ScreenTV.LoginTV.route)
+            }
+
+        }
+    }
+}

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

@@ -0,0 +1,6 @@
+package com.vpn.fastestvpnservice.sealedClass
+
+sealed class ScreenTV(val route: String) {
+    data object SplashTV : ScreenTV("splash_screen_tv")
+    data object LoginTV : ScreenTV("login_screen_tv")
+}

+ 21 - 0
app/src/main/res/drawable/bg_app_light.xml

@@ -0,0 +1,21 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:aapt="http://schemas.android.com/aapt"
+    android:width="200dp"
+    android:height="200dp"
+    android:viewportWidth="375"
+    android:viewportHeight="812">
+    <path
+        android:pathData="M0,0h375v812H0z">
+        <aapt:attr name="android:fillColor">
+            <gradient
+                android:startY="0"
+                android:startX="375"
+                android:endY="812"
+                android:endX="0"
+                android:type="linear">
+                <item android:offset="0" android:color="#2952c3"/>
+                <item android:offset="1" android:color="#2952c3"/>
+            </gradient>
+        </aapt:attr>
+    </path>
+</vector>