Browse Source

Commented forgot password screens, master login, master signup, security fragment from bottom nav bar for now

Khubaib 4 months ago
parent
commit
9f45f5ca4a

+ 77 - 0
app/src/main/java/com/fastest/pass/account/presentation/ui/components/AccountScreen.kt

@@ -55,6 +55,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
 import androidx.navigation.NavHostController
 import com.fastest.pass.R
 import com.fastest.pass.home.presentation.ui.components.GapLine
+import com.fastest.pass.security.presentation.ui.components.AddFeaturesRow
 
 enum class ClickType {
     OPEN_LOGIN_SCREEN
@@ -99,6 +100,8 @@ fun AccountScreen(clickType: (ClickType) -> Unit) {
                         .padding(bottom = 20.dp)
                 ) {
                     Spacer(modifier = Modifier.height(50.dp))
+                    AddFeaturesRow(R.drawable.generate_password, R.string.generate_password, R.string.generate_robust)
+                    Spacer(modifier = Modifier.height(20.dp))
                     AddFeaturesRowAS(icon = R.drawable.about, title = R.string.about) {}
                     Spacer(modifier = Modifier.height(20.dp))
                     AddFeaturesRowAS(icon = R.drawable.help, title = R.string.helpandsupport) {}
@@ -327,3 +330,77 @@ fun BoxScope.LogoutDialog(
 
     }
 }
+
+@Composable
+fun ColumnScope.AddFeaturesRowAS(icon: Int, title: Int, desc: Int) {
+    Row(
+        modifier = Modifier
+            .border(
+                border = BorderStroke(1.dp, colorResource(id = R.color.white)),
+                shape = RoundedCornerShape(15.dp)
+            )
+            .clip(RoundedCornerShape(15.dp))
+            .background(colorResource(id = R.color.white))
+            .padding(vertical = 15.dp)
+            .fillMaxWidth(),
+        horizontalArrangement = Arrangement.Start,
+        verticalAlignment = Alignment.CenterVertically
+    ) {
+        Surface(
+            modifier = Modifier.padding(start = 10.dp),
+            color = Color.Transparent
+        ) {
+            Image(
+                painter = painterResource(id = icon),
+                contentDescription = "Icon",
+                modifier = Modifier
+                    .padding(start = 0.dp)
+                    .size(34.dp)
+                    .weight(1f),
+                colorFilter = ColorFilter.tint(colorResource(id = R.color.gray_splash)),
+            )
+        }
+
+        Surface(
+            modifier = Modifier.padding(start = 15.dp, end = 5.dp),
+            color = Color.Transparent
+        ) {
+            Column {
+                Text(
+                    text = stringResource(id = title),
+                    style = MaterialTheme.typography.displayMedium,
+                    color = colorResource(id = R.color.gray_splash),
+                    maxLines = 1,
+                    modifier = Modifier
+//                        .weight(1F)
+                )
+                Spacer(modifier = Modifier.height(1.dp))
+                Text(
+                    text = stringResource(id = desc),
+                    style = MaterialTheme.typography.displaySmall,
+                    color = colorResource(id = R.color.gray_text),
+                    modifier = Modifier
+//                        .weight(1F)
+                )
+            }
+        }
+
+        Spacer(modifier = Modifier.weight(1f))
+
+        Surface(
+            modifier = Modifier
+                .padding(end = 15.dp)
+                .align(Alignment.CenterVertically),
+            color = Color.Transparent
+        ) {
+            Image(
+                painter = painterResource(id = R.drawable.crown_premium),
+                contentDescription = "Front_Arrow",
+                modifier = Modifier
+                    .padding(start = 0.dp, end = 0.dp)
+                    .size(24.dp)
+                    .weight(1f),
+            )
+        }
+    }
+}

+ 3 - 2
app/src/main/java/com/fastest/pass/dashboard/presentation/ui/component/BottomTab.kt

@@ -77,10 +77,11 @@ fun BottomTab() {
 
 @Composable
 fun BottomNavigationBar(selectedTab: Screen, onTabSelected: (Screen) -> Unit) {
-    val items = listOf(Screen.Home, Screen.Browse, Screen.Security, Screen.Account)
+//    val items = listOf(Screen.Home, Screen.Browse, Screen.Security, Screen.Account)
+    val items = listOf(Screen.Home, Screen.Browse, Screen.Account)
 
     BottomNavigation(
-        backgroundColor = Gray_Splash,
+        backgroundColor = colorResource(id = R.color.blue_login),
         contentColor = colorResource(id = R.color.gray_text),
         modifier = Modifier
             .fillMaxWidth()

+ 22 - 11
app/src/main/java/com/fastest/pass/dashboard/presentation/ui/fragment/DashboardFragment.kt

@@ -5,6 +5,7 @@ import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import androidx.compose.foundation.background
+import androidx.compose.foundation.border
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.navigationBarsPadding
@@ -31,17 +32,27 @@ class DashboardFragment : BaseFragment() {
         return ComposeView(requireActivity()).apply {
             setContent {
                 FastestPassTheme {
-                    Scaffold(
-                        modifier = Modifier.fillMaxSize(),
-                    ) { paddingValues ->
-                        Box(
-                            modifier = Modifier
-                                .fillMaxSize()
-                                .background(color = colorResource(id = R.color.home_background_color))
-                                .padding(bottom = paddingValues.calculateBottomPadding()) // Apply padding to respect system bottom inset
-                        ) {
-                            BottomTab()
-                        }
+//                    Scaffold(
+//                        modifier = Modifier.fillMaxSize(),
+//                    ) { paddingValues ->
+//                        Box(
+//                            modifier = Modifier
+//                                .fillMaxSize()
+//                                .background(color = colorResource(id = R.color.home_background_color))
+//                                .padding(bottom = paddingValues.calculateBottomPadding()) // Apply padding to respect system bottom inset
+//                        ) {
+//                            BottomTab()
+//                        }
+//                    }
+
+                    Box(
+                        modifier = Modifier
+                            .fillMaxSize()
+                            .background(color = colorResource(id = R.color.blue_login))
+                            .navigationBarsPadding()
+                    ) // Apply padding to respect system bottom inset
+                     {
+                        BottomTab()
                     }
                 }
             }

+ 1 - 1
app/src/main/java/com/fastest/pass/forgotpassword/presentation/ui/components/ForgotPasswordScreen.kt

@@ -240,7 +240,7 @@ fun ColumnScope.SendCodeButton(buttonText: Int, clickType: (ClickType) -> Unit)
             .height(60.dp)
             .clickable() {},
         onClick = {
-            clickType.invoke(ClickType.OPEN_FORGOT_VERIFY)
+//            clickType.invoke(ClickType.OPEN_FORGOT_VERIFY)
         },
         shape = RoundedCornerShape(15.dp),
 //            border = BorderStroke(25.dp, colorResource(id = R.color.black)),

+ 3 - 0
app/src/main/java/com/fastest/pass/login/presentation/ui/LoginFragment.kt

@@ -68,6 +68,9 @@ class LoginFragment : BaseFragment() {
                                     ClickType.MASTER_LOGIN -> {
                                         viewmodel.navigateTo(LoginRoute.OpenMasterLoginScreen)
                                     }
+                                    ClickType.HOME_SCREEN -> {
+                                        viewmodel.navigateTo(LoginRoute.OpenDashBoardScreen)
+                                    }
                                 }
                             }
                         }

+ 3 - 2
app/src/main/java/com/fastest/pass/login/presentation/ui/components/LoginScreen.kt

@@ -60,7 +60,8 @@ enum class ClickType {
     SIGNUP_CLICK,
     FORGOT_PASSWORD_CLICK,
     GO_BACK,
-    MASTER_LOGIN
+    MASTER_LOGIN,
+    HOME_SCREEN
 }
 
 @Composable
@@ -352,7 +353,7 @@ fun ColumnScope.LoginButton(buttonText: Int, clickType: (ClickType) -> Unit) {
             .height(60.dp)
             .clickable() { },
         onClick = {
-            clickType.invoke(ClickType.MASTER_LOGIN)
+            clickType.invoke(ClickType.HOME_SCREEN)
         },
         shape = RoundedCornerShape(15.dp),
 //            border = BorderStroke(25.dp, colorResource(id = R.color.black)),

+ 14 - 0
app/src/main/java/com/fastest/pass/login/utils/LoginNavigation.kt

@@ -2,8 +2,10 @@ package com.fastest.pass.login.utils
 
 import androidx.lifecycle.lifecycleScope
 import androidx.navigation.fragment.findNavController
+import androidx.navigation.navOptions
 import com.fastest.pass.R
 import com.fastest.pass.login.presentation.ui.LoginFragment
+import kotlin.math.log
 
 class LoginNavigation {
 
@@ -24,6 +26,18 @@ class LoginNavigation {
                     LoginRoute.OpenMasterLoginScreen -> {
                         loginFragment.findNavController().navigate(R.id.masterLoginFragment)
                     }
+                    LoginRoute.OpenDashBoardScreen -> {
+                        loginFragment.findNavController().navigate(
+                            R.id.dashboardFragment,
+                            null,
+                            navOptions {
+                                popUpTo(loginFragment.findNavController().graph.id) {
+                                    inclusive = true
+                                }
+                                launchSingleTop = true
+                            }
+                        )
+                    }
                 }
 
                 loginFragment.viewmodel.navigateTo(LoginRoute.OpenNoneScreen)

+ 3 - 0
app/src/main/java/com/fastest/pass/login/utils/LoginRoute.kt

@@ -1,9 +1,12 @@
 package com.fastest.pass.login.utils
 
+import com.fastest.pass.masterlogin.utils.MasterLoginRoute
+
 sealed class LoginRoute {
     data object OpenSignUp : LoginRoute()
     data object OpenForgotPassword : LoginRoute()
     data object OpenNoneScreen : LoginRoute()
     data object GoBack : LoginRoute()
     data object OpenMasterLoginScreen : LoginRoute()
+    data object OpenDashBoardScreen : LoginRoute()
 }

+ 17 - 17
app/src/main/java/com/fastest/pass/security/presentation/ui/components/SecurityScreen.kt

@@ -257,22 +257,22 @@ fun ColumnScope.AddFeaturesRow(icon: Int, title: Int, desc: Int) {
             }
         }
 
-        Spacer(modifier = Modifier.weight(1f))
-
-        Surface(
-            modifier = Modifier
-                .padding(end = 15.dp)
-                .align(Alignment.CenterVertically),
-            color = Color.Transparent
-        ) {
-            Image(
-                painter = painterResource(id = R.drawable.crown_premium),
-                contentDescription = "Front_Arrow",
-                modifier = Modifier
-                    .padding(start = 0.dp, end = 0.dp)
-                    .size(24.dp)
-                    .weight(1f),
-            )
-        }
+//        Spacer(modifier = Modifier.weight(1f))
+//
+//        Surface(
+//            modifier = Modifier
+//                .padding(end = 15.dp)
+//                .align(Alignment.CenterVertically),
+//            color = Color.Transparent
+//        ) {
+//            Image(
+//                painter = painterResource(id = R.drawable.crown_premium),
+//                contentDescription = "Front_Arrow",
+//                modifier = Modifier
+//                    .padding(start = 0.dp, end = 0.dp)
+//                    .size(24.dp)
+//                    .weight(1f),
+//            )
+//        }
     }
 }

+ 1 - 1
app/src/main/java/com/fastest/pass/signup/presentation/ui/components/SignUpScreen.kt

@@ -344,7 +344,7 @@ fun ColumnScope.SignUpButton(buttonText: Int, clickType: (ClickType) -> Unit) {
             .height(60.dp)
             .clickable() { },
         onClick = {
-            clickType.invoke(ClickType.GO_TO_MASTER_SIGNUP)
+//            clickType.invoke(ClickType.GO_TO_MASTER_SIGNUP)
         },
         shape = RoundedCornerShape(15.dp),
 //            border = BorderStroke(25.dp, colorResource(id = R.color.black)),