Browse Source

Home Screen bottom navigation done,
Home, Browse, Security and account screen fragment done,
screen edge cutting off from bottom issue resolved

minhaj 1 month ago
parent
commit
2d456b79af
23 changed files with 333 additions and 222 deletions
  1. 1 0
      .idea/gradle.xml
  2. 0 10
      app/src/main/java/com/fastest/pass/BaseFragment.kt
  3. 29 0
      app/src/main/java/com/fastest/pass/MainActivity.kt
  4. 35 0
      app/src/main/java/com/fastest/pass/account/presentation/ui/fragment/AccountFragment.kt
  5. 28 0
      app/src/main/java/com/fastest/pass/browse/presentation/ui/fragment/BrowseFragment.kt
  6. 1 1
      app/src/main/java/com/fastest/pass/home/domain/model/Screen.kt
  7. 99 0
      app/src/main/java/com/fastest/pass/dashboard/presentation/ui/component/BottomTab.kt
  8. 46 0
      app/src/main/java/com/fastest/pass/dashboard/presentation/ui/fragment/DashboardFragment.kt
  9. 0 21
      app/src/main/java/com/fastest/pass/home/di/HomeModule.kt
  10. 0 89
      app/src/main/java/com/fastest/pass/home/presentation/ui/component/HomeScreen.kt
  11. 2 28
      app/src/main/java/com/fastest/pass/home/presentation/ui/fragment/HomeFragment.kt
  12. 0 17
      app/src/main/java/com/fastest/pass/home/presentation/viewmodel/HomeViewModel.kt
  13. 0 28
      app/src/main/java/com/fastest/pass/home/utils/HomeNavigation.kt
  14. 0 10
      app/src/main/java/com/fastest/pass/home/utils/HomeNavigationRoute.kt
  15. 1 1
      app/src/main/java/com/fastest/pass/masterlogin/presentation/ui/MasterLoginFragment.kt
  16. 15 2
      app/src/main/java/com/fastest/pass/masterlogin/utils/MasterLoginNavigation.kt
  17. 1 1
      app/src/main/java/com/fastest/pass/masterlogin/utils/MasterLoginRoute.kt
  18. 35 0
      app/src/main/java/com/fastest/pass/security/presentation/ui/fragment/SecurityFragment.kt
  19. 1 1
      app/src/main/java/com/fastest/pass/welcome/presentation/ui/component/WelcomeScreen.kt
  20. 26 10
      app/src/main/java/com/fastest/pass/welcome/presentation/ui/fragment/WelcomeFragment.kt
  21. 7 0
      app/src/main/res/layout/activity_home.xml
  22. 1 2
      app/src/main/res/layout/activity_main.xml
  23. 5 1
      app/src/main/res/navigation/nav_graph.xml

+ 1 - 0
.idea/gradle.xml

@@ -4,6 +4,7 @@
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
+        <option name="testRunner" value="CHOOSE_PER_TEST" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
         <option name="modules">

+ 0 - 10
app/src/main/java/com/fastest/pass/BaseFragment.kt

@@ -7,17 +7,7 @@ import android.view.View
 import android.view.ViewGroup
 import androidx.compose.ui.platform.ComposeView
 import androidx.fragment.app.Fragment
-import androidx.fragment.app.viewModels
-import com.fastest.pass.home.presentation.ui.component.HomeScreen
-import com.fastest.pass.ui.theme.FastestPassTheme
-import com.fastest.pass.welcome.presentation.ui.component.ClickType.LOGIN_CLICK
-import com.fastest.pass.welcome.presentation.ui.component.ClickType.SIGNUP_CLICK
-import com.fastest.pass.welcome.presentation.ui.component.WelcomeTutorial
-import com.fastest.pass.welcome.presentation.viewmodel.WelcomeViewModel
-import com.fastest.pass.welcome.utils.WelcomeNavigation
-import com.fastest.pass.welcome.utils.WelcomeNavigationRoute
 import dagger.hilt.android.AndroidEntryPoint
-import javax.inject.Inject
 
 @AndroidEntryPoint
 open class BaseFragment : Fragment() {

+ 29 - 0
app/src/main/java/com/fastest/pass/MainActivity.kt

@@ -1,9 +1,11 @@
 package com.fastest.pass
 
+import android.app.AlertDialog
 import android.os.Bundle
 import androidx.activity.enableEdgeToEdge
 import androidx.fragment.app.FragmentActivity
 import androidx.navigation.NavController
+import androidx.navigation.Navigation.findNavController
 import androidx.navigation.fragment.NavHostFragment
 import dagger.hilt.android.AndroidEntryPoint
 
@@ -24,4 +26,31 @@ open class MainActivity : FragmentActivity() {
         graph.setStartDestination(R.id.splashFragment)
         navController.setGraph(graph, intent.extras)
     }
+
+    @Deprecated("This method has been deprecated in favor of using the\n      {@link OnBackPressedDispatcher} via {@link #getOnBackPressedDispatcher()}.\n      The OnBackPressedDispatcher controls how back button events are dispatched\n      to one or more {@link OnBackPressedCallback} objects.")
+    override fun onBackPressed() {
+        // Check if the back stack is empty
+        if (navController.previousBackStackEntry == null) {
+            // Show an alert dialog if there are no fragments in the back stack
+            showExitConfirmationDialog()
+        } else {
+            // If there are fragments, navigate back as usual
+            super.onBackPressed()
+        }
+    }
+
+    fun showExitConfirmationDialog() {
+        AlertDialog.Builder(this)
+            .setMessage("Are you sure you want to exit?")
+            .setCancelable(false) // Prevent closing without an action
+            .setPositiveButton("Yes") { dialog, _ ->
+                // Handle exit, e.g., finish the activity
+                finish()
+            }
+            .setNegativeButton("No") { dialog, _ ->
+                dialog.dismiss()
+            }
+            .show()
+    }
+
 }

+ 35 - 0
app/src/main/java/com/fastest/pass/account/presentation/ui/fragment/AccountFragment.kt

@@ -0,0 +1,35 @@
+package com.fastest.pass.account.presentation.ui.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.compose.material.Text
+import androidx.compose.ui.platform.ComposeView
+import androidx.fragment.app.viewModels
+import com.fastest.pass.BaseFragment
+import com.fastest.pass.ui.theme.FastestPassTheme
+import dagger.hilt.android.AndroidEntryPoint
+import javax.inject.Inject
+
+@AndroidEntryPoint
+class AccountFragment : BaseFragment() {
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View {
+        return ComposeView(requireActivity()).apply {
+            setContent {
+                FastestPassTheme {
+                    Text("Account Fragment")
+                }
+            }
+        }
+    }
+}

+ 28 - 0
app/src/main/java/com/fastest/pass/browse/presentation/ui/fragment/BrowseFragment.kt

@@ -0,0 +1,28 @@
+package com.fastest.pass.home.presentation.ui.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.compose.material.Text
+import androidx.compose.ui.platform.ComposeView
+import com.fastest.pass.BaseFragment
+import com.fastest.pass.ui.theme.FastestPassTheme
+import dagger.hilt.android.AndroidEntryPoint
+
+@AndroidEntryPoint
+class BrowseFragment : BaseFragment() {
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View {
+        return ComposeView(requireActivity()).apply {
+            setContent {
+                FastestPassTheme {
+                    Text("Browse Fragment")
+                }
+            }
+        }
+    }
+}

+ 1 - 1
app/src/main/java/com/fastest/pass/home/domain/model/Screen.kt

@@ -1,4 +1,4 @@
-package com.fastest.pass.home.domain.model
+package com.fastest.pass.dashboard.domain.model
 
 import com.fastest.pass.R
 

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

@@ -0,0 +1,99 @@
+package com.fastest.pass.dashboard.presentation.ui.component
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material.BottomNavigation
+import androidx.compose.material.BottomNavigationItem
+import androidx.compose.material3.Icon
+import androidx.compose.material3.Scaffold
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.fragment.app.FragmentActivity
+import androidx.fragment.app.FragmentContainerView
+import com.fastest.pass.R
+import com.fastest.pass.account.presentation.ui.fragment.AccountFragment
+import com.fastest.pass.dashboard.domain.model.Screen
+import com.fastest.pass.home.presentation.ui.fragment.BrowseFragment
+import com.fastest.pass.home.presentation.ui.fragment.HomeFragment
+import com.fastest.pass.security.presentation.ui.fragment.SecurityFragment
+import com.fastest.pass.ui.theme.Gray_Splash
+
+@Composable
+fun BottomTab() {
+
+    val activity = LocalContext.current as FragmentActivity
+    var selectedTab = remember { mutableStateOf<Screen>(Screen.Home) }
+
+    Scaffold(
+        bottomBar = {
+            BottomNavigationBar(
+                selectedTab = selectedTab.value,
+                onTabSelected = { screen ->
+                    selectedTab.value = screen
+                }
+            )
+        }
+    ) { paddingValues ->
+        Box(modifier = Modifier.padding(paddingValues)) {
+            // Add a container for hosting fragments
+            AndroidView(
+                factory = { context ->
+                    FragmentContainerView(context).apply {
+                        id = R.id.fragment_container_view
+                    }
+                },
+                modifier = Modifier.fillMaxSize()
+            )
+
+            // Handle fragment replacement when the selected tab changes
+            LaunchedEffect(selectedTab.value) {
+                loadFragment(activity, selectedTab.value)
+            }
+        }
+    }
+}
+
+@Composable
+fun BottomNavigationBar(selectedTab: Screen, onTabSelected: (Screen) -> Unit) {
+    val items = listOf(Screen.Home, Screen.Browse, Screen.Security, Screen.Account)
+
+    BottomNavigation(
+        backgroundColor = Gray_Splash
+    ) {
+        items.forEach { screen ->
+            BottomNavigationItem(
+                icon = { Icon(painterResource(id = screen.icon), contentDescription = null) },
+                label = { Text(screen.title) },
+                selected = selectedTab == screen,
+                onClick = { onTabSelected(screen) },
+                selectedContentColor = Color.Red, // You can customize selected item color
+                unselectedContentColor = Color.Gray
+            )
+        }
+    }
+}
+
+
+fun loadFragment(activity: FragmentActivity, screen: Screen) {
+    val fragment = when (screen) {
+        Screen.Home -> HomeFragment()// Replace with your actual fragments
+        Screen.Browse -> BrowseFragment()
+        Screen.Security -> SecurityFragment()
+        Screen.Account -> AccountFragment()
+    }
+
+    activity.supportFragmentManager.beginTransaction()
+        .replace(R.id.fragment_container_view, fragment)
+        .commit()
+}
+
+

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

@@ -0,0 +1,46 @@
+package com.fastest.pass.dashboard.presentation.ui.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Scaffold
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.ComposeView
+import com.fastest.pass.BaseFragment
+import com.fastest.pass.dashboard.presentation.ui.component.BottomTab
+import com.fastest.pass.ui.theme.FastestPassTheme
+import com.fastest.pass.welcome.presentation.ui.component.ClickType.LOGIN_CLICK
+import com.fastest.pass.welcome.presentation.ui.component.ClickType.SIGNUP_CLICK
+import com.fastest.pass.welcome.presentation.ui.component.WelcomeTutorial
+import com.fastest.pass.welcome.utils.WelcomeNavigationRoute
+
+class DashboardFragment : BaseFragment() {
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View {
+        return ComposeView(requireActivity()).apply {
+            setContent {
+                FastestPassTheme {
+                    Scaffold(
+                        modifier = Modifier.fillMaxSize(),
+                    ) { paddingValues ->
+                        Box(
+                            modifier = Modifier
+                                .fillMaxSize()
+                                .padding(bottom = paddingValues.calculateBottomPadding()) // Apply padding to respect system bottom inset
+                        ) {
+                            BottomTab()
+                        }
+                    }
+
+                }
+            }
+        }
+    }
+}

+ 0 - 21
app/src/main/java/com/fastest/pass/home/di/HomeModule.kt

@@ -1,21 +0,0 @@
-package com.fastest.pass.home.di
-
-import com.fastest.pass.home.utils.HomeNavigation
-import com.fastest.pass.welcome.utils.WelcomeNavigation
-import dagger.Module
-import dagger.Provides
-import dagger.hilt.InstallIn
-import dagger.hilt.components.SingletonComponent
-import javax.inject.Singleton
-
-@Module
-@InstallIn(SingletonComponent::class)
-object HomeModule {
-
-    @Provides
-    @Singleton
-    fun provideNavigation(): HomeNavigation {
-        return HomeNavigation()
-    }
-
-}

+ 0 - 89
app/src/main/java/com/fastest/pass/home/presentation/ui/component/HomeScreen.kt

@@ -1,89 +0,0 @@
-package com.fastest.pass.home.presentation.ui.component
-
-import androidx.compose.foundation.layout.padding
-import androidx.compose.material.BottomNavigation
-import androidx.compose.material.BottomNavigationItem
-import androidx.compose.material.Icon
-import androidx.compose.material.Scaffold
-import androidx.compose.material.Text
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.res.painterResource
-import androidx.navigation.NavController
-import androidx.navigation.compose.NavHost
-import androidx.navigation.compose.composable
-import androidx.navigation.compose.currentBackStackEntryAsState
-import androidx.navigation.compose.rememberNavController
-import com.fastest.pass.home.domain.model.Screen
-import com.fastest.pass.welcome.presentation.ui.fragment.WelcomeFragment
-
-enum class HomeClickType {
-    HOME,
-    BROWSE,
-    SECURITY,
-    ACCOUNT
-}
-
-@Composable
-fun HomeScreen() {
-
-}
-
-@Composable
-fun BottomTabNavigation(onClick: (homeClick: HomeClickType) -> Unit) {
-    val navController = rememberNavController()
-
-    Scaffold(
-        bottomBar = {
-            BottomNavigationBar(navController = navController)
-        }
-    ) { paddingValues ->
-        // Host Fragments instead of Composables
-        NavHost(
-            navController = navController,
-            startDestination = Screen.Home.route,
-            modifier = Modifier.padding(paddingValues) // Using paddingValues from Scaffold
-        ) {
-            composable(Screen.Home.route) {
-                // Fragment or content for Home
-                WelcomeFragment()
-            }
-            composable(Screen.Browse.route) {
-                // Fragment or content for Browse
-            }
-            composable(Screen.Security.route) {
-                // Fragment or content for Security
-            }
-            composable(Screen.Account.route) {
-                // Fragment or content for Account
-            }
-        }
-    }
-
-}
-@Composable
-fun BottomNavigationBar(navController: NavController) {
-    val items = listOf(Screen.Home, Screen.Browse, Screen.Security, Screen.Account)
-    val currentBackStackEntry = navController.currentBackStackEntryAsState()
-    val currentRoute = currentBackStackEntry.value?.destination?.route
-
-    BottomNavigation {
-        items.forEach { screen ->
-            BottomNavigationItem(
-                icon = { Icon(painterResource(id = screen.icon), contentDescription = null) },
-                label = { Text(screen.title) },
-                selected = currentRoute == screen.route,
-                onClick = {
-                    navController.navigate(screen.route) {
-                        // Avoid multiple copies of the same destination
-                        popUpTo(navController.graph.startDestinationId) {
-                            saveState = true
-                        }
-                        launchSingleTop = true
-                        restoreState = true
-                    }
-                }
-            )
-        }
-    }
-}

+ 2 - 28
app/src/main/java/com/fastest/pass/home/presentation/ui/fragment/HomeFragment.kt

@@ -4,14 +4,10 @@ import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import androidx.compose.material.Text
 import androidx.compose.ui.platform.ComposeView
 import androidx.fragment.app.viewModels
 import com.fastest.pass.BaseFragment
-import com.fastest.pass.home.presentation.ui.component.BottomTabNavigation
-import com.fastest.pass.home.presentation.ui.component.HomeClickType
-import com.fastest.pass.home.presentation.viewmodel.HomeViewModel
-import com.fastest.pass.home.utils.HomeNavigation
-import com.fastest.pass.home.utils.HomeNavigationRoute
 import com.fastest.pass.ui.theme.FastestPassTheme
 import dagger.hilt.android.AndroidEntryPoint
 import javax.inject.Inject
@@ -19,14 +15,9 @@ import javax.inject.Inject
 @AndroidEntryPoint
 class HomeFragment : BaseFragment() {
 
-    val viewModel: HomeViewModel by viewModels()
-
-    @Inject
-    lateinit var navigation: HomeNavigation
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
-        navigation.navigate(this)
     }
 
     override fun onCreateView(
@@ -36,24 +27,7 @@ class HomeFragment : BaseFragment() {
         return ComposeView(requireActivity()).apply {
             setContent {
                 FastestPassTheme {
-                    BottomTabNavigation {
-                        when (it) {
-                            HomeClickType.HOME -> {
-                                viewModel.navigateTo(HomeNavigationRoute.OpenHome)
-                            }
-
-                            HomeClickType.BROWSE -> {
-                                viewModel.navigateTo(HomeNavigationRoute.OpenBrowse)
-                            }
-
-                            HomeClickType.SECURITY -> {
-                            }
-
-                            HomeClickType.ACCOUNT -> {
-                            }
-                            else -> {}
-                        }
-                    }
+                    Text("Home Fragment")
                 }
             }
         }

+ 0 - 17
app/src/main/java/com/fastest/pass/home/presentation/viewmodel/HomeViewModel.kt

@@ -1,17 +0,0 @@
-package com.fastest.pass.home.presentation.viewmodel
-
-import androidx.lifecycle.ViewModel
-import com.fastest.pass.home.utils.HomeNavigationRoute
-import dagger.hilt.android.lifecycle.HiltViewModel
-import kotlinx.coroutines.flow.MutableStateFlow
-
-class HomeViewModel : ViewModel() {
-
-    private val _router = MutableStateFlow<HomeNavigationRoute>(HomeNavigationRoute.NoneScreen)
-    val router: MutableStateFlow<HomeNavigationRoute> = _router
-
-    fun navigateTo(splashRoute: HomeNavigationRoute) {
-        _router.value = splashRoute
-    }
-
-}

+ 0 - 28
app/src/main/java/com/fastest/pass/home/utils/HomeNavigation.kt

@@ -1,28 +0,0 @@
-package com.fastest.pass.home.utils
-
-import androidx.lifecycle.lifecycleScope
-import androidx.navigation.fragment.findNavController
-import com.fastest.pass.R
-import com.fastest.pass.home.presentation.ui.fragment.HomeFragment
-
-class HomeNavigation {
-
-    fun navigate(source:HomeFragment){
-        source.lifecycleScope.launchWhenStarted {
-            source.viewModel.router.collect{ route ->
-
-                when(route){
-                    is HomeNavigationRoute.OpenHome -> {
-                        source.findNavController().navigate(R.id.welcomeFragment)
-                    }
-                    is HomeNavigationRoute.OpenBrowse ->{
-                        source.findNavController().navigate(R.id.loginFragment)
-                    }
-
-                    else -> {}
-                }
-            }
-        }
-    }
-
-}

+ 0 - 10
app/src/main/java/com/fastest/pass/home/utils/HomeNavigationRoute.kt

@@ -1,10 +0,0 @@
-package com.fastest.pass.home.utils
-
-sealed class HomeNavigationRoute {
-
-    object OpenHome : HomeNavigationRoute()
-    object OpenBrowse : HomeNavigationRoute()
-    object OpenSecurity : HomeNavigationRoute()
-    object OpenAccount : HomeNavigationRoute()
-    object NoneScreen : HomeNavigationRoute()
-}

+ 1 - 1
app/src/main/java/com/fastest/pass/masterlogin/presentation/ui/MasterLoginFragment.kt

@@ -44,7 +44,7 @@ class MasterLoginFragment : BaseFragment() {
                                 viewmodel.navigateTo(MasterLoginRoute.GoBackToLoginScreen)
                             }
                             ClickType.HOME_SCREEN -> {
-                                viewmodel.navigateTo(MasterLoginRoute.OpenHomeScreen)
+                                viewmodel.navigateTo(MasterLoginRoute.OpenDashBoardScreen)
                             }
                         }
                     }

+ 15 - 2
app/src/main/java/com/fastest/pass/masterlogin/utils/MasterLoginNavigation.kt

@@ -2,6 +2,7 @@ package com.fastest.pass.masterlogin.utils
 
 import androidx.lifecycle.lifecycleScope
 import androidx.navigation.fragment.findNavController
+import androidx.navigation.navOptions
 import com.fastest.pass.R
 import com.fastest.pass.masterlogin.presentation.ui.MasterLoginFragment
 
@@ -12,8 +13,20 @@ class MasterLoginNavigation {
             masterLoginFragment.viewmodel.router.collect { router ->
                 when (router) {
                     MasterLoginRoute.OpenNoneScreen -> {}
-                    MasterLoginRoute.OpenHomeScreen -> {
-                        masterLoginFragment.findNavController().navigate(R.id.homeFragment)
+
+                    MasterLoginRoute.OpenDashBoardScreen -> {
+
+                        masterLoginFragment.findNavController().navigate(
+                            R.id.dashboardFragment,
+                            null,
+                            navOptions {
+                                // Clear the entire back stack before navigating to DashboardFragment
+                                popUpTo(masterLoginFragment.findNavController().graph.id) {
+                                    inclusive = true // This will pop all fragments in the stack
+                                }
+                                launchSingleTop = true // Ensures DashboardFragment is the only one on the back stack
+                            }
+                        )
                     }
                     MasterLoginRoute.GoBackToLoginScreen -> {
                         masterLoginFragment.findNavController().popBackStack()

+ 1 - 1
app/src/main/java/com/fastest/pass/masterlogin/utils/MasterLoginRoute.kt

@@ -1,7 +1,7 @@
 package com.fastest.pass.masterlogin.utils
 
 sealed class MasterLoginRoute {
-    data object OpenHomeScreen : MasterLoginRoute()
+    data object OpenDashBoardScreen : MasterLoginRoute()
     data object GoBackToLoginScreen : MasterLoginRoute()
     data object OpenNoneScreen : MasterLoginRoute()
 }

+ 35 - 0
app/src/main/java/com/fastest/pass/security/presentation/ui/fragment/SecurityFragment.kt

@@ -0,0 +1,35 @@
+package com.fastest.pass.security.presentation.ui.fragment
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.compose.material.Text
+import androidx.compose.ui.platform.ComposeView
+import androidx.fragment.app.viewModels
+import com.fastest.pass.BaseFragment
+import com.fastest.pass.ui.theme.FastestPassTheme
+import dagger.hilt.android.AndroidEntryPoint
+import javax.inject.Inject
+
+@AndroidEntryPoint
+class SecurityFragment : BaseFragment() {
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View {
+        return ComposeView(requireActivity()).apply {
+            setContent {
+                FastestPassTheme {
+                    Text("Security Fragment")
+                }
+            }
+        }
+    }
+}

+ 1 - 1
app/src/main/java/com/fastest/pass/welcome/presentation/ui/component/WelcomeScreen.kt

@@ -76,7 +76,7 @@ fun WelcomeTutorial(onClick: (ClickType) -> Unit) {
 
         Box(modifier = Modifier
             .fillMaxSize()
-            .padding(bottom = 50.dp)) {
+            .padding(bottom = 0.dp)) {
 
             HorizontalPager(
                 count = pages.size,

+ 26 - 10
app/src/main/java/com/fastest/pass/welcome/presentation/ui/fragment/WelcomeFragment.kt

@@ -4,8 +4,12 @@ import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Scaffold
+import androidx.compose.ui.Modifier
 import androidx.compose.ui.platform.ComposeView
-import androidx.fragment.app.Fragment
 import androidx.fragment.app.viewModels
 import com.fastest.pass.BaseFragment
 import com.fastest.pass.ui.theme.FastestPassTheme
@@ -21,10 +25,10 @@ import javax.inject.Inject
 @AndroidEntryPoint
 class WelcomeFragment : BaseFragment() {
 
-    val viewModel : WelcomeViewModel by viewModels()
+    val viewModel: WelcomeViewModel by viewModels()
 
     @Inject
-    lateinit var navigation : WelcomeNavigation
+    lateinit var navigation: WelcomeNavigation
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -38,15 +42,27 @@ class WelcomeFragment : BaseFragment() {
         return ComposeView(requireActivity()).apply {
             setContent {
                 FastestPassTheme {
-                    WelcomeTutorial { clickType ->
+                    Scaffold(
+                        modifier = Modifier.fillMaxSize(),
+                        ) { paddingValues ->
+                        // Make sure to use paddingValues to ensure content does not overlap with system bottom navigation bar
+                        Box(
+                            modifier = Modifier
+                                .fillMaxSize()
+                                .padding(bottom = paddingValues.calculateBottomPadding()) // Apply padding to respect system bottom inset
+                        ) {
+                            // Your main content goes here
+                            WelcomeTutorial { clickType ->
 
-                        when (clickType) {
-                            LOGIN_CLICK -> {
-                                viewModel.navigateTo(WelcomeNavigationRoute.OpenLogin)
-                            }
+                                when (clickType) {
+                                    LOGIN_CLICK -> {
+                                        viewModel.navigateTo(WelcomeNavigationRoute.OpenLogin)
+                                    }
 
-                            SIGNUP_CLICK -> {
-                                viewModel.navigateTo(WelcomeNavigationRoute.OpenSignup)
+                                    SIGNUP_CLICK -> {
+                                        viewModel.navigateTo(WelcomeNavigationRoute.OpenSignup)
+                                    }
+                                }
                             }
                         }
                     }

+ 7 - 0
app/src/main/res/layout/activity_home.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.fragment.app.FragmentContainerView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/fragment_container_view"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" />
+

+ 1 - 2
app/src/main/res/layout/activity_main.xml

@@ -6,6 +6,5 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     app:defaultNavHost="true"
-    app:navGraph="@navigation/nav_graph"
-    />
+    app:navGraph="@navigation/nav_graph" />
 

+ 5 - 1
app/src/main/res/navigation/nav_graph.xml

@@ -43,12 +43,16 @@
         android:label="ForgotPasswordVerifyFragment" />
     <fragment
         android:id="@+id/homeFragment"
-        android:name="com.fastest.pass.home.presentation.ui.fragment.HomeFragment"
+        android:name="com.fastest.pass.home.presentation.ui.fragment.BrowseFragment"
         android:label="HomeFragment" />
 
     <fragment
         android:id="@+id/forgotPasswordConfirmFragment"
         android:name="com.fastest.pass.forgotpassword.presentation.ui.ForgotPasswordConfirmFragment"
         android:label="ForgotPasswordConfirmFragment" />
+    <fragment
+        android:id="@+id/dashboardFragment"
+        android:name="com.fastest.pass.dashboard.presentation.ui.fragment.DashboardFragment"
+        android:label="DashboardFragment" />
 
 </navigation>