Skip to content

Commit 564017c

Browse files
authored
Merge pull request #2 from YAPP-Github/feature/#1-multi-module-setup
[Feature/#1] 프로젝트 멀티모듈 환경 구축
2 parents a4a4566 + 424ce9a commit 564017c

68 files changed

Lines changed: 901 additions & 144 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/build.gradle.kts

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,22 @@
11
plugins {
2-
alias(libs.plugins.android.application)
3-
alias(libs.plugins.kotlin.android)
4-
alias(libs.plugins.kotlin.compose)
2+
alias(libs.plugins.bitnagil.android.application)
3+
alias(libs.plugins.bitnagil.android.hilt)
4+
alias(libs.plugins.kotlin.serialization)
55
}
66

77
android {
88
namespace = "com.threegap.bitnagil"
9-
compileSdk = 35
109

1110
defaultConfig {
1211
applicationId = "com.threegap.bitnagil"
13-
minSdk = 28
14-
targetSdk = 35
15-
versionCode = 1
16-
versionName = "1.0"
17-
18-
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19-
}
20-
21-
buildTypes {
22-
release {
23-
isMinifyEnabled = false
24-
proguardFiles(
25-
getDefaultProguardFile("proguard-android-optimize.txt"),
26-
"proguard-rules.pro",
27-
)
28-
}
29-
}
30-
compileOptions {
31-
sourceCompatibility = JavaVersion.VERSION_11
32-
targetCompatibility = JavaVersion.VERSION_11
33-
}
34-
kotlinOptions {
35-
jvmTarget = "11"
36-
}
37-
buildFeatures {
38-
compose = true
3912
}
4013
}
4114

4215
dependencies {
43-
44-
implementation(libs.androidx.core.ktx)
45-
implementation(libs.androidx.lifecycle.runtime.ktx)
46-
implementation(libs.androidx.activity.compose)
47-
implementation(platform(libs.androidx.compose.bom))
48-
implementation(libs.androidx.ui)
49-
implementation(libs.androidx.ui.graphics)
50-
implementation(libs.androidx.ui.tooling.preview)
51-
implementation(libs.androidx.material3)
52-
testImplementation(libs.junit)
53-
androidTestImplementation(libs.androidx.junit)
54-
androidTestImplementation(libs.androidx.espresso.core)
55-
androidTestImplementation(platform(libs.androidx.compose.bom))
56-
androidTestImplementation(libs.androidx.ui.test.junit4)
57-
debugImplementation(libs.androidx.ui.tooling)
58-
debugImplementation(libs.androidx.ui.test.manifest)
16+
implementation(projects.core.datastore)
17+
implementation(projects.core.designsystem)
18+
implementation(projects.core.network)
19+
implementation(projects.data)
20+
implementation(projects.domain)
21+
implementation(projects.presentation)
5922
}

app/src/androidTest/java/com/threegap/bitnagil/ExampleInstrumentedTest.kt

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5+
<uses-permission android:name="android.permission.INTERNET" />
6+
57
<application
8+
android:name=".BitnagilApplication"
69
android:allowBackup="true"
710
android:dataExtractionRules="@xml/data_extraction_rules"
811
android:fullBackupContent="@xml/backup_rules"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.threegap.bitnagil
2+
3+
import android.app.Application
4+
import dagger.hilt.android.HiltAndroidApp
5+
6+
@HiltAndroidApp
7+
class BitnagilApplication : Application() {
8+
override fun onCreate() {
9+
super.onCreate()
10+
}
11+
}

app/src/main/java/com/threegap/bitnagil/MainActivity.kt

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,21 @@ import android.os.Bundle
44
import androidx.activity.ComponentActivity
55
import androidx.activity.compose.setContent
66
import androidx.activity.enableEdgeToEdge
7-
import androidx.compose.foundation.layout.fillMaxSize
8-
import androidx.compose.foundation.layout.padding
9-
import androidx.compose.material3.Scaffold
10-
import androidx.compose.material3.Text
11-
import androidx.compose.runtime.Composable
12-
import androidx.compose.ui.Modifier
13-
import androidx.compose.ui.tooling.preview.Preview
14-
import com.threegap.bitnagil.ui.theme.BitnagilTheme
7+
import com.threegap.bitnagil.designsystem.BitnagilTheme
8+
import dagger.hilt.android.AndroidEntryPoint
159

10+
@AndroidEntryPoint
1611
class MainActivity : ComponentActivity() {
1712
override fun onCreate(savedInstanceState: Bundle?) {
1813
super.onCreate(savedInstanceState)
1914
enableEdgeToEdge()
2015
setContent {
16+
val mainNavigator = rememberMainNavigator()
2117
BitnagilTheme {
22-
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
23-
Greeting(
24-
name = "Android",
25-
modifier = Modifier.padding(innerPadding),
26-
)
27-
}
18+
MainScreen(
19+
navigator = mainNavigator,
20+
)
2821
}
2922
}
3023
}
3124
}
32-
33-
@Composable
34-
fun Greeting(
35-
name: String,
36-
modifier: Modifier = Modifier,
37-
) {
38-
Text(
39-
text = "Hello $name!",
40-
modifier = modifier,
41-
)
42-
}
43-
44-
@Preview(showBackground = true)
45-
@Composable
46-
fun GreetingPreview() {
47-
BitnagilTheme {
48-
Greeting("Android")
49-
}
50-
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.threegap.bitnagil
2+
3+
import androidx.compose.runtime.Composable
4+
import androidx.compose.ui.Modifier
5+
import androidx.navigation.compose.NavHost
6+
import androidx.navigation.compose.composable
7+
import com.threegap.bitnagil.presentation.home.HomeScreen
8+
import com.threegap.bitnagil.presentation.login.LoginScreen
9+
10+
@Composable
11+
fun MainNavHost(
12+
navigator: MainNavigator,
13+
modifier: Modifier = Modifier,
14+
) {
15+
NavHost(
16+
navController = navigator.navController,
17+
startDestination = navigator.startDestination,
18+
modifier = modifier,
19+
) {
20+
composable<Route.Login> {
21+
LoginScreen(
22+
onLoginClick = { navigator.navController.navigate(Route.Home) },
23+
)
24+
}
25+
26+
composable<Route.Home> {
27+
HomeScreen()
28+
}
29+
}
30+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.threegap.bitnagil
2+
3+
import androidx.compose.runtime.Composable
4+
import androidx.compose.runtime.remember
5+
import androidx.navigation.NavHostController
6+
import androidx.navigation.compose.rememberNavController
7+
8+
class MainNavigator(
9+
val navController: NavHostController,
10+
) {
11+
val startDestination = Route.Login
12+
}
13+
14+
@Composable
15+
fun rememberMainNavigator(navController: NavHostController = rememberNavController()): MainNavigator =
16+
remember(navController) {
17+
MainNavigator(navController)
18+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.threegap.bitnagil
2+
3+
import androidx.compose.foundation.layout.fillMaxSize
4+
import androidx.compose.foundation.layout.padding
5+
import androidx.compose.material3.Scaffold
6+
import androidx.compose.runtime.Composable
7+
import androidx.compose.ui.Modifier
8+
9+
@Composable
10+
fun MainScreen(
11+
navigator: MainNavigator,
12+
modifier: Modifier = Modifier,
13+
) {
14+
Scaffold(
15+
modifier = modifier.fillMaxSize(),
16+
) { innerPadding ->
17+
MainNavHost(
18+
navigator = navigator,
19+
modifier = Modifier.padding(innerPadding),
20+
)
21+
}
22+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.threegap.bitnagil
2+
3+
import kotlinx.serialization.Serializable
4+
5+
@Serializable
6+
sealed interface Route {
7+
@Serializable
8+
data object Login : Route
9+
10+
@Serializable
11+
data object Home : Route
12+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">Bitnagil</string>
2+
<string name="app_name">빛나길</string>
33
</resources>

0 commit comments

Comments
 (0)