Browse Source

fonsts added on login, signup, started, home screens..

Khubaib 11 months ago
parent
commit
eb09763ef3

+ 4 - 2
app/src/main/java/com/vpn/fastestvpnservice/customItems/SubscriptionPackageItem.kt

@@ -4,6 +4,7 @@ import android.app.Activity
 import android.content.res.Configuration
 import android.util.Log
 import android.widget.Toast
+import androidx.activity.ComponentActivity
 import androidx.compose.foundation.BorderStroke
 import androidx.compose.foundation.background
 import androidx.compose.foundation.border
@@ -41,7 +42,6 @@ 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.core.app.ComponentActivity
 import androidx.lifecycle.viewmodel.compose.viewModel
 import androidx.navigation.compose.rememberNavController
 import com.vpn.fastestvpnservice.R
@@ -55,7 +55,9 @@ import kotlin.coroutines.coroutineContext
 var getPosition: Int = 0
 
 @Composable
-fun SubscriptionPackageItem(item: SubscriptionPackageList, position: Int, activity: ComponentActivity) {
+fun SubscriptionPackageItem(item: SubscriptionPackageList, position: Int,
+                            activity: ComponentActivity
+) {
     Log.d("test_plan_product", "SPI[$position] -> ${item.packageDuration} ${item.isSelected.value}")
 
     val context = LocalContext.current

+ 54 - 52
app/src/main/java/com/vpn/fastestvpnservice/navigation/BottomBarNavGraph.kt

@@ -1,7 +1,8 @@
 package com.vpn.fastestvpnservice.navigation
 
+import androidx.activity.ComponentActivity
+import androidx.compose.material.Surface
 import androidx.compose.runtime.Composable
-import androidx.core.app.ComponentActivity
 import androidx.navigation.NavHostController
 import androidx.navigation.compose.NavHost
 import androidx.navigation.compose.composable
@@ -28,61 +29,62 @@ import com.vpn.fastestvpnservice.sealedClass.Screen
 @Composable
 fun BottomBarNavGraph(navHostController: NavHostController,
                       settingsNavHostController: NavHostController,
-                      activity: ComponentActivity) {
-    NavHost(navController = navHostController,
-        startDestination = BottomBarScreen.Home.route) {
+                      activity: ComponentActivity
+) {
+        NavHost(navController = navHostController,
+            startDestination = BottomBarScreen.Home.route) {
 
-        composable(route = BottomBarScreen.Home.route) {
-            Home(navHostController = navHostController, activity)
-        }
-        composable(route = BottomBarScreen.Settings.route) {
-            Settings(navHostController = navHostController)
-        }
-        composable(route = BottomBarScreen.Help.route) { entry ->
-            Help(navHostController = navHostController)
-        }
-        composable(route = BottomBarScreen.Account.route) {
-            Account(navHostController = navHostController,
-                settingsNavHostController = settingsNavHostController)
-        }
-        composable(route = Screen.FAQ.route) {
-            FAQ(navHostController = navHostController)
-        }
-        composable(route = Screen.PrivacyPolicy.route) {
-            PrivacyPolicy(navHostController = navHostController)
-        }
-        composable(route = Screen.TermsAndConditions.route) {
-            TermsAndConditions(navHostController = navHostController, false)
-        }
-        composable(route = Screen.About.route) {
-            About(navHostController = navHostController)
-        }
-        composable(route = Screen.ChangePassword.route) {
-            ChangePassword(navHostController = navHostController)
-        }
-        composable(route = Screen.ServerList.route) {
-            ServerList(navHostController = navHostController, false)
-        }
-        composable(route = Screen.Notifications.route) {
-            Notifications(navHostController = navHostController)
-        }
-        composable(route = Screen.SplitTunneling.route) {
-            SplitTunneling(navHostController = navHostController)
-        }
-        composable(route = Screen.FavoriteServers.route) {
-            FavoriteServers(navHostController = navHostController)
-        }
-        composable(route = Screen.Subscription.route) {
+            composable(route = BottomBarScreen.Home.route) {
+                Home(navHostController = navHostController, activity)
+            }
+            composable(route = BottomBarScreen.Settings.route) {
+                Settings(navHostController = navHostController)
+            }
+            composable(route = BottomBarScreen.Help.route) { entry ->
+                Help(navHostController = navHostController)
+            }
+            composable(route = BottomBarScreen.Account.route) {
+                Account(navHostController = navHostController,
+                    settingsNavHostController = settingsNavHostController)
+            }
+            composable(route = Screen.FAQ.route) {
+                FAQ(navHostController = navHostController)
+            }
+            composable(route = Screen.PrivacyPolicy.route) {
+                PrivacyPolicy(navHostController = navHostController)
+            }
+            composable(route = Screen.TermsAndConditions.route) {
+                TermsAndConditions(navHostController = navHostController, false)
+            }
+            composable(route = Screen.About.route) {
+                About(navHostController = navHostController)
+            }
+            composable(route = Screen.ChangePassword.route) {
+                ChangePassword(navHostController = navHostController)
+            }
+            composable(route = Screen.ServerList.route) {
+                ServerList(navHostController = navHostController, false)
+            }
+            composable(route = Screen.Notifications.route) {
+                Notifications(navHostController = navHostController)
+            }
+            composable(route = Screen.SplitTunneling.route) {
+                SplitTunneling(navHostController = navHostController)
+            }
+            composable(route = Screen.FavoriteServers.route) {
+                FavoriteServers(navHostController = navHostController)
+            }
+            composable(route = Screen.Subscription.route) {
 //            SubscriptionScreenFragment(navHostController = navHostController)
-            SubscriptionScreen(navHostController, activity)
-        }
-        composable(route = Screen.CustomerSupport.route) {
-            CustomerSupport(navHostController = navHostController)
-        }
+                SubscriptionScreen(navHostController, activity)
+            }
+            composable(route = Screen.CustomerSupport.route) {
+                CustomerSupport(navHostController = navHostController)
+            }
 
-        /* Again declare for login because of different -> navHostController */
+            /* Again declare for login because of different -> navHostController */
 //        composable(route = Screen.Login.route) {
 //            Login(navHostController = navHostController)
 //        }
-    }
+        }
 }

+ 4 - 2
app/src/main/java/com/vpn/fastestvpnservice/navigation/NavGraph.kt

@@ -1,7 +1,7 @@
 package com.vpn.fastestvpnservice.navigation
 
+import androidx.activity.ComponentActivity
 import androidx.compose.runtime.Composable
-import androidx.core.app.ComponentActivity
 import androidx.lifecycle.viewmodel.compose.viewModel
 import androidx.navigation.NavHostController
 import androidx.navigation.compose.NavHost
@@ -17,7 +17,9 @@ import com.vpn.fastestvpnservice.screens.helpScreensAll.TermsAndConditions
 import com.vpn.fastestvpnservice.sealedClass.Screen
 
 @Composable
-fun SetUpNavGraph(navHostController: NavHostController, activity: ComponentActivity) {
+fun SetUpNavGraph(navHostController: NavHostController,
+                  activity: ComponentActivity
+) {
     NavHost(navController = navHostController,
         startDestination = Screen.Splash.route,
         ) {

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

@@ -3,6 +3,7 @@ package com.vpn.fastestvpnservice.screens
 import android.app.Activity
 import android.content.res.Configuration
 import android.util.Log
+import androidx.activity.ComponentActivity
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.RowScope
@@ -31,7 +32,6 @@ 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.core.app.ComponentActivity
 import androidx.navigation.NavDestination
 import androidx.navigation.NavDestination.Companion.hierarchy
 import androidx.navigation.NavGraph.Companion.findStartDestination

+ 10 - 21
app/src/main/java/com/vpn/fastestvpnservice/screens/ForgotPassword.kt

@@ -33,6 +33,7 @@ import androidx.compose.material3.Button
 import androidx.compose.material3.ButtonDefaults
 import androidx.compose.material3.Icon
 import androidx.compose.material3.IconButton
+import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.Text
 import androidx.compose.material3.TextField
 import androidx.compose.material3.TextFieldDefaults
@@ -44,6 +45,7 @@ import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.ExperimentalComposeUiApi
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.alpha
 import androidx.compose.ui.draw.paint
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.input.pointer.pointerInput
@@ -68,6 +70,7 @@ import androidx.navigation.NavHostController
 import androidx.navigation.compose.rememberNavController
 import com.vpn.fastestvpnservice.R
 import com.vpn.fastestvpnservice.sealedClass.Screen
+import com.vpn.fastestvpnservice.ui.theme.customTypography
 
 @OptIn(ExperimentalComposeUiApi::class)
 @Composable
@@ -141,19 +144,17 @@ fun ForgotPassword(navHostController: NavHostController) {
                     .padding(start = 16.dp)
                     .align(Alignment.Start)
                 ,
-                fontSize = 28.sp,
-                fontWeight = FontWeight.Medium,
+                style = MaterialTheme.typography.displayLarge,
                 text = "Forgot Password!",
                 color = Color.White,
             )
             Text(
                 modifier = Modifier
                     .padding(start = 16.dp)
-                    .align(Alignment.Start),
-                fontSize = 14.sp,
-                fontWeight = FontWeight.Normal,
+                    .align(Alignment.Start)
+                    .alpha(0.6F),
+                style = MaterialTheme.typography.customTypography.labelLarge,
                 text = "Enter the email address associated with your account.",
-                color = colorResource(id = R.color.light_grey),
                 maxLines = 2,
             )
             Spacer(modifier = Modifier.height(20.dp))
@@ -167,11 +168,7 @@ fun ForgotPassword(navHostController: NavHostController) {
                     textChanged = it
                 },
 
-                textStyle = TextStyle(
-                    fontSize = 14.sp,
-                    color = colorResource(id = R.color.white),
-
-                    ),
+                textStyle = MaterialTheme.typography.customTypography.bodyMedium,
                 modifier = Modifier
                     .padding(start = 16.dp, end = 15.dp)
                     .align(Alignment.Start)
@@ -191,10 +188,7 @@ fun ForgotPassword(navHostController: NavHostController) {
 //                },
                 label = {
                     Text(text = "Email",
-                        style = TextStyle(
-                            colorResource(id = R.color.white),
-                            fontSize = 12.sp
-                        )
+                        style = MaterialTheme.typography.customTypography.bodySmall
                     )
                 },
                 leadingIcon = {
@@ -249,12 +243,7 @@ fun ForgotPassword(navHostController: NavHostController) {
             )
             {
                 Text(text = "Send Code",
-                    style = TextStyle(
-                        fontSize = 18.sp,
-                        fontFamily = FontFamily.Default,
-                        fontWeight = FontWeight.Medium,
-                        color = colorResource(id = R.color.blue_text)
-                    )
+                    style = MaterialTheme.typography.titleMedium
                 )
                 Log.d("test_button", "RowScope")
             }

+ 15 - 58
app/src/main/java/com/vpn/fastestvpnservice/screens/LoginScreen.kt

@@ -114,6 +114,7 @@ import com.vpn.fastestvpnservice.beans.themesList
 import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
 import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.AddText
 import com.vpn.fastestvpnservice.sealedClass.Screen
+import com.vpn.fastestvpnservice.ui.theme.customTypography
 import com.vpn.fastestvpnservice.ui.theme.outfitFontFamily
 import com.vpn.fastestvpnservice.viewmodels.LoginViewModel
 import com.vpn.fastestvpnservice.views.CustomValidation
@@ -194,13 +195,9 @@ fun Login(navHostController: NavHostController) {
                     Spacer(modifier = Modifier.height(8.dp))
                     TextMsg(
                         text = "Please login to your account.",
-                        color = colorResource(id = R.color.light_grey),
-                        style = TextStyle(
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            fontSize = 14.sp,
-                            lineHeight = 30.sp,
-                        )
+                        color = colorResource(id = R.color.white),
+                        style = MaterialTheme.typography.customTypography.labelLarge,
+                        alpha = 0.6F
                     )
 
                     Spacer(modifier = Modifier.height(20.dp))
@@ -212,14 +209,7 @@ fun Login(navHostController: NavHostController) {
                             textChanged = it
                         },
                         readOnly = readOnly!!,
-                        textStyle = TextStyle(
-                            color = colorResource(id = R.color.white),
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            fontSize = 14.sp,
-                            lineHeight = 22.sp,
-                            letterSpacing = 0.21.sp
-                        ),
+                        textStyle = MaterialTheme.typography.customTypography.bodyMedium,
                         modifier = Modifier
                             .padding(start = 15.dp, end = 15.dp)
                             .align(Alignment.Start)
@@ -239,11 +229,7 @@ fun Login(navHostController: NavHostController) {
 //                },
                         label = {
                             Text(text = "Email",
-                                style = TextStyle(
-                                    colorResource(id = R.color.white)),
-                                fontFamily = outfitFontFamily,
-                                fontWeight = FontWeight.Medium,
-                                fontSize = 12.sp,
+                                style = MaterialTheme.typography.customTypography.bodySmall
                             )
                         },
                         leadingIcon = {
@@ -302,14 +288,7 @@ fun Login(navHostController: NavHostController) {
                         },
                         readOnly = readOnly,
 
-                        textStyle = TextStyle(
-                            color = colorResource(id = R.color.white),
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            fontSize = 14.sp,
-                            lineHeight = 22.sp,
-                            letterSpacing = 0.21.sp
-                        ),
+                        textStyle = MaterialTheme.typography.customTypography.bodyLarge,
                         modifier = Modifier
                             .padding(start = 15.dp, end = 15.dp)
                             .align(Alignment.Start)
@@ -330,11 +309,7 @@ fun Login(navHostController: NavHostController) {
 //                },
                         label = {
                             Text(text = "Password",
-                                style = TextStyle(
-                                    colorResource(id = R.color.white)),
-                                fontFamily = outfitFontFamily,
-                                fontWeight = FontWeight.Normal,
-                                fontSize = 16.sp,
+                                style = MaterialTheme.typography.customTypography.bodyLarge
                             )
                         },
                         leadingIcon = {
@@ -423,13 +398,7 @@ fun Login(navHostController: NavHostController) {
                         modifier = Modifier
                             .padding(end = 15.dp)
                             .align(Alignment.End),
-                        style = TextStyle(
-                            fontSize = 16.sp,
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            textAlign = TextAlign.Right,
-                            color = colorResource(id = R.color.yellow_text),
-                        ),
+                        style = MaterialTheme.typography.customTypography.titleSmall,
                         text = AnnotatedString("Forgot Password"),
                     )
 
@@ -505,14 +474,7 @@ fun RowScope.TextMsgSignUp(
             modifier = Modifier
                 .padding(0.dp),
             text = "Don't have an account? ",
-            style = TextStyle(
-                color = Color.White,
-                fontSize = 14.sp,
-                fontFamily = outfitFontFamily,
-                fontWeight = FontWeight.Normal,
-                lineHeight = 30.sp,
-                textAlign = TextAlign.Right
-            ),
+            style = MaterialTheme.typography.customTypography.labelLarge,
         )
         ClickableText(
             onClick = {
@@ -522,14 +484,7 @@ fun RowScope.TextMsgSignUp(
             },
             modifier = Modifier
                 .padding(0.dp),
-            style = TextStyle(
-                color = colorResource(id = R.color.yellow_text),
-                fontSize = 14.sp,
-                fontFamily = outfitFontFamily,
-                fontWeight = FontWeight.Normal,
-                lineHeight = 30.sp,
-                textAlign = TextAlign.Right
-            ),
+            style = MaterialTheme.typography.customTypography.titleMedium,
             text = AnnotatedString(" Sign Up"),
         )
 
@@ -717,12 +672,14 @@ fun BoxScope.SignInButton(
 fun ColumnScope.TextMsg(
     text: String,
     color: Color,
-    style: TextStyle
+    style: TextStyle,
+    alpha: Float = 1F
 ) {
     Text(
         modifier = Modifier
             .padding(start = 15.dp)
-            .align(Alignment.Start),
+            .align(Alignment.Start)
+            .alpha(alpha),
         style = style,
         text = text,
         color = color,

+ 13 - 62
app/src/main/java/com/vpn/fastestvpnservice/screens/SignUpScreen.kt

@@ -90,6 +90,7 @@ import androidx.navigation.compose.rememberNavController
 import com.vpn.fastestvpnservice.R
 import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
 import com.vpn.fastestvpnservice.sealedClass.Screen
+import com.vpn.fastestvpnservice.ui.theme.customTypography
 import com.vpn.fastestvpnservice.ui.theme.outfitFontFamily
 import com.vpn.fastestvpnservice.viewmodels.LoginViewModel
 import com.vpn.fastestvpnservice.viewmodels.SignUpViewModel
@@ -194,15 +195,11 @@ fun SignUp(navHostController: NavHostController) {
                     Text(
                         modifier = Modifier
                             .padding(start = 15.dp)
-                            .align(Alignment.Start),
-                        style = TextStyle(
-                            fontSize = 14.sp,
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            lineHeight = 30.sp
-                        ),
+                            .align(Alignment.Start)
+                            .alpha(0.6F),
+                        style = MaterialTheme.typography.customTypography.labelLarge,
                         text = "Please register your account.",
-                        color = colorResource(id = R.color.light_grey),
+                        color = colorResource(id = R.color.white),
                     )
                     Spacer(modifier = Modifier.height(20.dp))
 
@@ -218,14 +215,7 @@ fun SignUp(navHostController: NavHostController) {
                             textChanged = it
                         },
                         readOnly = isSignUpEnabled,
-                        textStyle = TextStyle(
-                            color = colorResource(id = R.color.white),
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            fontSize = 14.sp,
-                            lineHeight = 22.sp,
-                            letterSpacing = 0.21.sp
-                        ),
+                        textStyle = MaterialTheme.typography.customTypography.bodyMedium,
                         modifier = Modifier
                             .padding(start = 15.dp, end = 15.dp, top = 10.dp)
                             .align(Alignment.Start)
@@ -245,12 +235,7 @@ fun SignUp(navHostController: NavHostController) {
 //                },
                         label = {
                             Text(text = "Email",
-                                style = TextStyle(
-                                    colorResource(id = R.color.white),
-                                    fontFamily = outfitFontFamily,
-                                    fontWeight = FontWeight.Medium,
-                                    fontSize = 12.sp,
-                                )
+                                style = MaterialTheme.typography.customTypography.bodySmall
                             )
                         },
                         leadingIcon = {
@@ -306,14 +291,7 @@ fun SignUp(navHostController: NavHostController) {
                             passwordChanged = it
                         },
                         readOnly = isSignUpEnabled,
-                        textStyle = TextStyle(
-                            color = colorResource(id = R.color.white),
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            fontSize = 14.sp,
-                            lineHeight = 22.sp,
-                            letterSpacing = 0.21.sp
-                        ),
+                        textStyle = MaterialTheme.typography.customTypography.bodyMedium,
                         modifier = Modifier
                             .padding(start = 15.dp, end = 15.dp)
                             .align(Alignment.Start)
@@ -333,12 +311,7 @@ fun SignUp(navHostController: NavHostController) {
 //                },
                         label = {
                             Text(text = "Password",
-                                style = TextStyle(
-                                    colorResource(id = R.color.white),
-                                    fontFamily = outfitFontFamily,
-                                    fontWeight = FontWeight.Normal,
-                                    fontSize = 16.sp
-                                )
+                                style = MaterialTheme.typography.customTypography.bodyLarge
                             )
                         },
                         leadingIcon = {
@@ -439,11 +412,7 @@ fun SignUp(navHostController: NavHostController) {
                         Text(
                             modifier = Modifier
                                 .padding(start = 15.dp),
-                            style = TextStyle(
-                                fontFamily = outfitFontFamily,
-                                fontWeight = FontWeight.Normal,
-                                fontSize = 16.sp,
-                            ),
+                            style = MaterialTheme.typography.customTypography.bodyLarge,
                             text = "By creating your account, you agree to",
                             color = colorResource(id = R.color.white),
                         )
@@ -474,12 +443,7 @@ fun SignUp(navHostController: NavHostController) {
                             modifier = Modifier
                                 .padding(start = 15.dp),
                             text = AnnotatedString("Terms & Conditions"),
-                            style = TextStyle(
-                                fontFamily = outfitFontFamily,
-                                fontWeight = FontWeight.Normal,
-                                fontSize = 16.sp,
-                                color = colorResource(id = R.color.yellow_text)
-                            )
+                            style = MaterialTheme.typography.customTypography.titleLarge
                         )
                     }
 
@@ -517,13 +481,7 @@ fun SignUp(navHostController: NavHostController) {
                     Text(
                         modifier = Modifier
                             .padding(0.dp),
-                        style = TextStyle(
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            fontSize = 14.sp,
-                            textAlign = TextAlign.Right,
-                            lineHeight = 30.sp
-                        ),
+                        style = MaterialTheme.typography.customTypography.labelLarge,
                         text = "Already have an account? ",
                         color = Color.White,
                     )
@@ -549,14 +507,7 @@ fun SignUp(navHostController: NavHostController) {
                         },
                         modifier = Modifier
                             .padding(0.dp),
-                        style = TextStyle(
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Normal,
-                            fontSize = 14.sp,
-                            textAlign = TextAlign.Right,
-                            lineHeight = 30.sp,
-                            color = colorResource(id = R.color.yellow),
-                        ),
+                        style = MaterialTheme.typography.customTypography.titleMedium,
                         text = AnnotatedString(" Sign In"),
                     )
                 }

+ 21 - 34
app/src/main/java/com/vpn/fastestvpnservice/screens/StartedScreen.kt

@@ -27,6 +27,7 @@ import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 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.graphics.Color
 import androidx.compose.ui.layout.ContentScale
@@ -47,6 +48,7 @@ import androidx.navigation.NavHostController
 import androidx.navigation.compose.rememberNavController
 import com.vpn.fastestvpnservice.R
 import com.vpn.fastestvpnservice.sealedClass.Screen
+import com.vpn.fastestvpnservice.ui.theme.customTypography
 import com.vpn.fastestvpnservice.ui.theme.outfitFontFamily
 
 @Composable
@@ -60,7 +62,8 @@ fun Started(navHostController: NavHostController) {
             .fillMaxSize()
             .paint(
                 painter = painterResource(id = R.drawable.bg_img3),
-                contentScale = ContentScale.FillBounds)
+                contentScale = ContentScale.FillBounds
+            )
 //            .background(
 //                if (isSystemInDarkTheme()) Color.Black
 //                else Color.Transparent
@@ -91,34 +94,27 @@ fun Started(navHostController: NavHostController) {
                 )
                 Text(
                     modifier = Modifier
-                        .padding(start = 0.dp),
+                        .padding(start = 0.dp)
+                        .alpha(0.8F),
                     text = "Top-notch security, blazing speed,",
-                    style = TextStyle(
-                        fontSize = 14.sp,
-                        fontWeight = FontWeight.Normal,
-                        color = colorResource(id = R.color.light_grey),
-                    ),
+                    style = MaterialTheme.typography.customTypography.labelSmall,
                 )
                 Text(
                     modifier = Modifier
-                        .padding(start = 0.dp),
+                        .padding(start = 0.dp)
+                        .alpha(0.8F),
                     text = "Unwavering stability. Your digital world,",
-                    style = TextStyle(
-                        fontSize = 14.sp,
-                        fontWeight = FontWeight.Normal,
-                        color = colorResource(id = R.color.light_grey),
-                        ),
+                    style = MaterialTheme.typography.customTypography.labelSmall,
+
+//
                 )
                 Text(
                     modifier = Modifier
-                        .padding(start = 0.dp),
+                        .padding(start = 0.dp)
+                        .alpha(0.8F),
                     text = "Protected.",
-                    style = TextStyle(
-                        fontSize = 14.sp,
-                        fontWeight = FontWeight.Normal,
-                        color = colorResource(id = R.color.light_grey),
+                    style = MaterialTheme.typography.customTypography.labelSmall,
                     )
-                )
             }
 
             Row (
@@ -151,13 +147,8 @@ fun Started(navHostController: NavHostController) {
                 )
                 {
                     Text(text = "Sign In",
-                        style = TextStyle(
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Medium,
-                            fontSize = 16.sp,
-                            textAlign = TextAlign.Center
+                        style = MaterialTheme.typography.customTypography.labelMedium,
                         )
-                    )
                     Log.d("test_button", "RowScope")
                 }
 
@@ -186,13 +177,7 @@ fun Started(navHostController: NavHostController) {
                 )
                 {
                     Text(text = "Sign Up",
-                        style = TextStyle(
-                            fontFamily = outfitFontFamily,
-                            fontWeight = FontWeight.Medium,
-                            fontSize = 16.sp,
-                            textAlign = TextAlign.Center
-                        )
-                    )
+                        style = MaterialTheme.typography.customTypography.labelMedium,)
                     Log.d("test_button", "RowScope")
                 }
             }
@@ -217,8 +202,10 @@ fun Started(navHostController: NavHostController) {
             .background(Color.Transparent)
             .width(screenWidth)
             .height(screenHeight)
-            .padding(top = 123.dp, start = 27.dp,
-                end = 27.dp)
+            .padding(
+                top = 123.dp, start = 27.dp,
+                end = 27.dp
+            )
         ,
         alignment = Alignment.TopCenter
     )

+ 1 - 1
app/src/main/java/com/vpn/fastestvpnservice/screens/accountScreensAll/SubscriptionScreen.kt

@@ -9,6 +9,7 @@ import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.Toast
+import androidx.activity.ComponentActivity
 import androidx.compose.foundation.ExperimentalFoundationApi
 import androidx.compose.foundation.LocalOverscrollConfiguration
 import androidx.compose.foundation.background
@@ -63,7 +64,6 @@ import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.core.app.ActivityCompat
-import androidx.core.app.ComponentActivity
 import androidx.fragment.app.Fragment
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.LifecycleEventObserver

+ 50 - 73
app/src/main/java/com/vpn/fastestvpnservice/screens/bottomNavBarScreens/HomeScreen.kt

@@ -4,6 +4,7 @@ import android.content.Context
 import android.content.res.Configuration
 import android.util.Log
 import android.widget.Toast
+import androidx.activity.ComponentActivity
 import androidx.compose.foundation.BorderStroke
 import androidx.compose.foundation.ExperimentalFoundationApi
 import androidx.compose.foundation.Image
@@ -76,12 +77,12 @@ import androidx.compose.runtime.livedata.observeAsState
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.rememberCoroutineScope
 import androidx.compose.runtime.rememberUpdatedState
+import androidx.compose.ui.draw.alpha
 import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.painter.Painter
 import androidx.compose.ui.input.pointer.pointerInput
 import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.platform.LocalLifecycleOwner
-import androidx.core.app.ComponentActivity
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.LifecycleEventObserver
 import androidx.lifecycle.LifecycleOwner
@@ -95,6 +96,8 @@ import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
 import com.vpn.fastestvpnservice.interfaces.ServerCallbacks
 import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
 import com.vpn.fastestvpnservice.ui.theme.FastestVPNTheme
+import com.vpn.fastestvpnservice.ui.theme.customTypography
+import com.vpn.fastestvpnservice.ui.theme.customTypography2
 import com.vpn.fastestvpnservice.utils.Utils
 import com.vpn.fastestvpnservice.utils.WireGuardConnection
 import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
@@ -326,7 +329,8 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
             AddText(
                 text = "$ipInfo",
                 size = 18.sp,
-                color = MaterialTheme.colorScheme.primary
+                color = MaterialTheme.colorScheme.primary,
+                style = MaterialTheme.typography.customTypography.headlineLarge
             )
             Row(
             ) {
@@ -347,9 +351,9 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                         )
                     }
                     AddText(
-                        text = "${serverObj?.server_name}, ${serverObj?.country}",
+                        text = "${serverObj?.server_name ?: ""}, ${serverObj?.country ?: ""}",
                         size = 16.sp,
-                        color = MaterialTheme.colorScheme.primary
+                        color = MaterialTheme.colorScheme.primary,
                     )
                 } else {
                     val image = Utils.getDrawable(context, serverDis?.countryCode)
@@ -369,7 +373,7 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                         )
                     }
                     AddText(
-                        text = "${serverDis?.city}, ${serverDis?.country}",
+                        text = "${serverDis?.city ?: ""}, ${serverDis?.country ?: ""}",
                         size = 16.sp,
                         color = MaterialTheme.colorScheme.primary
                     )
@@ -379,13 +383,15 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                 AddText(
                     text = "Connected",
                     size = 18.sp,
-                    color = colorResource(id = R.color.light_blue_2)
+                    color = colorResource(id = R.color.light_blue_2),
+                    style = MaterialTheme.typography.customTypography.displaySmall
                 )
             } else {
                 AddText(
                     text = "Disconnected",
                     size = 18.sp,
-                    color = colorResource(id = R.color.maroon_text)
+                    color = colorResource(id = R.color.maroon_text),
+                    style = MaterialTheme.typography.customTypography.displaySmall
                 )
             }
         }
@@ -447,10 +453,8 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                                     )
                                     Text(
                                         text = "Download",
-                                        style = TextStyle(
-                                            color = colorResource(id = R.color.text_color_dark_gray),
-                                            fontSize = 14.sp
-                                        )
+                                        style = MaterialTheme.typography.customTypography.displayMedium,
+                                        modifier = Modifier.alpha(0.6F)
                                     )
                                     Row(
                                         horizontalArrangement = Arrangement.SpaceAround,
@@ -458,19 +462,12 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                                     ) {
                                         Text(
                                             text = "30.68",
-                                            style = TextStyle(
-                                                color = colorResource(id = R.color.black),
-                                                fontSize = 18.sp,
-                                                textAlign = TextAlign.Right
-                                            )
+                                            style = MaterialTheme.typography.customTypography.displayLarge
                                         )
                                         Text(
                                             text = "  MB/S",
-                                            style = TextStyle(
-                                                color = colorResource(id = R.color.text_color_dark_gray),
-                                                fontSize = 12.sp,
-                                                fontWeight = FontWeight.Medium
-                                            )
+                                            style = MaterialTheme.typography.customTypography2.labelSmall,
+                                            modifier = Modifier.alpha(0.5F)
                                         )
                                     }
                                 }
@@ -497,10 +494,8 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                                     )
                                     Text(
                                         text = "Upload",
-                                        style = TextStyle(
-                                            color = colorResource(id = R.color.text_color_dark_gray),
-                                            fontSize = 14.sp
-                                        )
+                                        style = MaterialTheme.typography.customTypography.displayMedium,
+                                        modifier = Modifier.alpha(0.6F)
                                     )
                                     Row(
                                         horizontalArrangement = Arrangement.SpaceAround,
@@ -508,19 +503,13 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                                     ) {
                                         Text(
                                             text = "12.11",
-                                            style = TextStyle(
-                                                color = colorResource(id = R.color.black),
-                                                fontSize = 18.sp,
-                                                textAlign = TextAlign.Right
-                                            )
+                                            style = MaterialTheme.typography.customTypography.displayLarge
+
                                         )
                                         Text(
                                             text = "  MB/S",
-                                            style = TextStyle(
-                                                color = colorResource(id = R.color.text_color_dark_gray),
-                                                fontSize = 12.sp,
-                                                fontWeight = FontWeight.Medium
-                                            )
+                                            style = MaterialTheme.typography.customTypography2.labelSmall,
+                                            modifier = Modifier.alpha(0.5F)
                                         )
                                     }
                                 }
@@ -569,9 +558,7 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
                         ) {
                             Text(
                                 text = "Smart Connect",
-                                fontSize = 14.sp,
-                                fontWeight = FontWeight.Medium,
-                                fontStyle = FontStyle.Normal,
+                                style = MaterialTheme.typography.customTypography.labelLarge,
                                 modifier = Modifier.background(Color.Transparent)
                             )
                         }
@@ -640,18 +627,19 @@ fun OnLifecycleEvent(onEvent: (
 }
 
 @Composable
-fun ColumnScope.ColumnText(text: String, color: Color, size: TextUnit) {
+fun ColumnScope.ColumnText(
+    text: String,
+    color: Color,
+    size: TextUnit,
+    style: TextStyle
+) {
     Surface(
         modifier = Modifier.padding(start = 0.dp),
         color = Color.Transparent
     ) {
         Text(text = text,
-            style = TextStyle(
-                color = color,
-                fontSize = size,
-                fontStyle = FontStyle.Normal,
-                fontWeight = FontWeight.Medium
-            ),
+            style = style,
+            color = color,
             maxLines = 1,
             modifier = Modifier
                 .padding(start = 0.dp, end = 0.dp)
@@ -691,12 +679,14 @@ fun BoxScope.AddRowSmart(navHostController: NavHostController) {
             ColumnText(
                 text = "Fastest Location",
                 color = colorResource(id = R.color.blue_text),
-                size = 12.sp
+                size = 12.sp,
+                style = MaterialTheme.typography.customTypography.headlineSmall
             )
             ColumnText(
                 text = "United Arab Emirates",
                 color = colorResource(id = R.color.dark_blue_gray_text),
-                size = 16.sp
+                size = 16.sp,
+                style = MaterialTheme.typography.labelMedium
             )
         }
         Spacer(modifier = Modifier.weight(1F))
@@ -706,11 +696,7 @@ fun BoxScope.AddRowSmart(navHostController: NavHostController) {
         ) {
             ClickableText(
                 text = AnnotatedString("Change"),
-                style = TextStyle(
-                    color = colorResource(id = R.color.light_blue_2),
-                    fontSize = 14.sp,
-                    textAlign = TextAlign.Right
-                ),
+                style = MaterialTheme.typography.customTypography.headlineMedium,
                 onClick = {
                     navHostController.navigate(
                         Screen.ServerList.route
@@ -765,12 +751,8 @@ fun BoxScope.AddRowSelectServer(navHostController: NavHostController) {
             color = Color.Transparent
         ) {
             Text(text = "See All Locations",
-                style = TextStyle(
-                    color = colorResource(id = R.color.dark_blue_gray_text),
-                    fontSize = 16.sp,
-                    fontStyle = FontStyle.Normal,
-                    fontWeight = FontWeight.Medium
-                ),
+                style = MaterialTheme.typography.labelMedium,
+                color = colorResource(id = R.color.dark_blue_gray_text),
                 maxLines = 2,
                 modifier = Modifier
                     .padding(start = 12.dp, end = 0.dp)
@@ -797,16 +779,16 @@ fun BoxScope.AddRowSelectServer(navHostController: NavHostController) {
 }
 
 @Composable
-fun ColumnScope.AddText(text: String, size: TextUnit, color: Color) {
+fun ColumnScope.AddText(
+    text: String,
+    size: TextUnit,
+    color: Color,
+    style: TextStyle
+) {
     Text(
         text = text,
-        style = TextStyle(
-            fontSize = size,
-            color = color,
-            textAlign = TextAlign.Center,
-            fontStyle = FontStyle.Normal,
-            fontWeight = FontWeight.Medium
-        )
+        style = style,
+        color = color
     )
 }
 
@@ -814,13 +796,8 @@ fun ColumnScope.AddText(text: String, size: TextUnit, color: Color) {
 fun RowScope.AddText(text: String, size: TextUnit, color: Color) {
     Text(
         text = text,
-        style = TextStyle(
-            fontSize = size,
-            color = color,
-            textAlign = TextAlign.Center,
-            fontStyle = FontStyle.Normal,
-            fontWeight = FontWeight.Medium
-        )
+        style = MaterialTheme.typography.labelMedium,
+        color = color
     )
 }
 

+ 122 - 2
app/src/main/java/com/vpn/fastestvpnservice/ui/theme/Type.kt

@@ -1,6 +1,8 @@
 package com.vpn.fastestvpnservice.ui.theme
 
 import androidx.compose.material3.Typography
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.res.colorResource
 import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
@@ -24,7 +26,6 @@ val outfitFontFamily = FontFamily(
 )
 
 val Typography = Typography(
-
     displaySmall = TextStyle(
         fontFamily = outfitFontFamily,
         fontWeight = FontWeight.Normal,
@@ -114,4 +115,123 @@ val Typography = Typography(
         fontSize = 18.sp,
         textAlign = TextAlign.Center
     )
-)
+)
+
+val Typography.customTypography: Typography
+    @Composable
+    get() = Typography(
+        displaySmall = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 18.sp,
+            lineHeight = 30.sp,
+        ),
+        displayMedium = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 14.sp,
+            textAlign = TextAlign.Center,
+            color = colorResource(id = R.color.text_color_dark_gray),
+        ),
+        displayLarge = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.SemiBold,
+            fontSize = 18.sp,
+            textAlign = TextAlign.Right,
+            color = colorResource(id = R.color.dark_blue_gray_text),
+        ),
+        headlineSmall = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 12.sp,
+            lineHeight = 30.sp,
+            color = colorResource(id = R.color.blue_text)
+        ),
+        headlineMedium = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 14.sp,
+            textAlign = TextAlign.Right,
+            color = colorResource(id = R.color.light_blue_2)
+        ),
+        headlineLarge = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 18.sp,
+            textAlign = TextAlign.Center,
+        ),
+        titleSmall = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 16.sp,
+            textAlign = TextAlign.Right,
+            color = colorResource(id = R.color.appYellow)
+        ),
+        titleMedium = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 14.sp,
+            textAlign = TextAlign.Right,
+            color = colorResource(id = R.color.appYellow)
+        ),
+        titleLarge = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 16.sp,
+            color = colorResource(id = R.color.appYellow)
+        )
+        ,
+        bodySmall = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Medium,
+            fontSize = 12.sp,
+            color = colorResource(id = R.color.white)
+        ),
+        bodyMedium = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 14.sp,
+            lineHeight = 22.sp,
+            letterSpacing = 0.21.sp,
+            color = colorResource(id = R.color.white)
+        ),
+        bodyLarge = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 16.sp,
+            color = colorResource(id = R.color.white)
+        ),
+        labelSmall = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 14.sp,
+            textAlign = TextAlign.Center,
+            lineHeight = 22.sp,
+            letterSpacing = 0.21.sp,
+            color = colorResource(id = R.color.white)
+        ),
+        labelMedium = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Medium,
+            fontSize = 16.sp,
+            textAlign = TextAlign.Center
+        ),
+        labelLarge = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Normal,
+            fontSize = 14.sp,
+            lineHeight = 30.sp,
+            color = colorResource(id = R.color.white)
+        ),
+    )
+
+val Typography.customTypography2: Typography
+    @Composable
+    get() = Typography(
+        labelSmall = TextStyle(
+            fontFamily = outfitFontFamily,
+            fontWeight = FontWeight.Medium,
+            fontSize = 12.sp,
+            color = colorResource(id = R.color.dark_blue_gray_text)
+        ),
+    )

+ 1 - 1
app/src/main/java/com/vpn/fastestvpnservice/utils/WireGuardConnection.kt

@@ -4,7 +4,7 @@ import android.content.Context
 import android.content.Intent
 import android.os.AsyncTask
 import android.util.Log
-import androidx.core.app.ComponentActivity
+import androidx.activity.ComponentActivity
 import androidx.lifecycle.viewmodel.compose.viewModel
 import com.google.gson.Gson
 import com.google.gson.reflect.TypeToken

+ 1 - 1
app/src/main/java/com/vpn/fastestvpnservice/viewmodels/SubscriptionViewModel.kt

@@ -4,9 +4,9 @@ import android.app.Activity
 import android.content.Context
 import android.util.Base64
 import android.util.Log
+import androidx.activity.ComponentActivity
 import androidx.compose.runtime.livedata.observeAsState
 import androidx.compose.runtime.mutableStateOf
-import androidx.core.app.ComponentActivity
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.ViewModel

+ 2 - 0
app/src/main/res/values/colors.xml

@@ -12,7 +12,9 @@
     <color name="light_blue_2">#4071fb</color>
     <color name="blue_text">#2952c3</color>
     <color name="dark_blue_icon">#294DB4</color>
+    <color name="lightish_blue">#4776fb</color>
     <color name="yellow">#FEC32D</color>
+    <color name="appYellow">#fec32b</color>
     <color name="light_grey">#ACBDED</color>
     <color name="transparent">#00000000</color>
     <color name="grey_password_field">#738CD2</color>

+ 1 - 2
app/src/main/res/values/themes.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-
-    <style name="Theme.FastestVPN" parent="android:Theme.Material.Light.NoActionBar" >
+    <style name="Theme.FastestVPN" parent="android:Theme.Material.NoActionBar" >
         <item name="android:windowDisablePreview">true</item>
         <item name="android:windowBackground">@color/light_blue</item>
     </style>