Skip to content

Commit

Permalink
🔗 :: (#29) 홈 스크린 퍼블리싱
Browse files Browse the repository at this point in the history
🔗 :: (#29) 홈 스크린 퍼블리싱
  • Loading branch information
Tmdhoon2 authored Feb 4, 2024
2 parents ede51db + f4ffe07 commit 32045d9
Show file tree
Hide file tree
Showing 25 changed files with 615 additions and 47 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dependencies {
implementation(project(":feature:landing"))
implementation(project(":feature:signin"))
implementation(project(":feature:signup"))
implementation(project(":feature:home"))

implementation(platform(libs.androidx.compose.bom))
implementation(libs.jobis.design.system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package team.retum.jobisandroidv2.navigation
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.navigation
import team.retum.jobisandroidv2.root.navigateToRoot
import team.retum.landing.NAVIGATION_LANDING
import team.retum.landing.landing
import team.retum.signin.navigateToSignIn
Expand All @@ -12,7 +13,6 @@ import team.retum.signup.navigation.navigateToSettingPassword
import team.retum.signup.navigation.navigateToSignUp
import team.retum.signup.navigation.signUp


const val NAVIGATION_AUTH = "auth"

internal fun NavGraphBuilder.authNavigation(navController: NavController) {
Expand All @@ -24,7 +24,10 @@ internal fun NavGraphBuilder.authNavigation(navController: NavController) {
onSignInClick = navController::navigateToSignIn,
onSignUpClick = navController::navigateToSignUp,
)
signIn(onBackClick = navController::popBackStack)
signIn(
onBackClick = navController::popBackStack,
onSignInSuccess = navController::navigateToRoot,
)
signUp(
onBackClick = navController::popBackStack,
onInputEmailClick = navController::navigateToInputEmail,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package team.retum.jobisandroidv2.navigation

import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import androidx.navigation.navigation
import team.retum.jobisandroidv2.ui.NAVIGATION_ROOT
import team.retum.jobisandroidv2.ui.RootScreen
import team.retum.jobisandroidv2.root.NAVIGATION_ROOT
import team.retum.jobisandroidv2.root.root

const val NAVIGATION_MAIN = "main"

Expand All @@ -13,8 +12,6 @@ fun NavGraphBuilder.mainNavigation() {
route = NAVIGATION_MAIN,
startDestination = NAVIGATION_ROOT,
) {
composable(NAVIGATION_ROOT) {
RootScreen()
}
root()
}
}
17 changes: 17 additions & 0 deletions app/src/main/java/team/retum/jobisandroidv2/root/RootNavigation.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package team.retum.jobisandroidv2.root

import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable

const val NAVIGATION_ROOT = "root"

fun NavGraphBuilder.root() {
composable(NAVIGATION_ROOT) {
Root()
}
}

fun NavController.navigateToRoot() {
navigate(NAVIGATION_ROOT)
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
package team.retum.jobisandroidv2.ui
package team.retum.jobisandroidv2.root

import android.annotation.SuppressLint
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.rememberNavController
import team.retum.jobisandroidv2.navigation.NAVIGATION_HOME
import team.retum.home.navigation.NAVIGATION_HOME
import team.retum.home.navigation.home
import team.retum.jobisandroidv2.ui.BottomNavigationBar

const val NAVIGATION_ROOT = "root"

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
fun RootScreen() {
fun Root() {
val navController = rememberNavController()

RootScreen(navController = navController)
}

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
private fun RootScreen(navController: NavHostController) {
Scaffold(
bottomBar = { BottomNavigationBar(navController = navController) },
) {
NavHost(
modifier = Modifier.padding(it),
navController = navController,
startDestination = NAVIGATION_HOME,
) {
// TODO 내비게이션 바 해당 메뉴 스크린 위치
home()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package team.retum.jobisandroidv2.ui

import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import team.retum.home.navigation.NAVIGATION_HOME
import team.retum.jobisandroidv2.R
import team.retum.jobisandroidv2.navigation.NAVIGATION_HOME

sealed class BottomMenu(
val route: String,
Expand Down
1 change: 1 addition & 0 deletions feature/home/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
20 changes: 20 additions & 0 deletions feature/home/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.kotlin.kapt.get().pluginId)
id(libs.plugins.hilt.android.get().pluginId)
}

apply<CommonGradlePlugin>()
apply<ComposeGradlePlugin>()

android {
namespace = "team.retum.home"
}

dependencies {

implementation(project(":core:common"))
implementation(project(":core:domain"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package team.retum.home

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import junit.framework.TestCase.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("team.retum.home.test", appContext.packageName)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package team.retum.home.navigation

import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import team.retum.home.ui.Home

const val NAVIGATION_HOME = "home"

fun NavGraphBuilder.home() {
composable(NAVIGATION_HOME) {
Home()
}
}
Loading

0 comments on commit 32045d9

Please sign in to comment.