Skip to content

Commit

Permalink
[Android] feat: 멀티 모듈화 및 컴포즈 네비게이션 적용 (#15) (#17)
Browse files Browse the repository at this point in the history
* feat: domain Module 정의

(cherry picked from commit a00af41)

* feat: multi module 정의 및 의존성 부여

(cherry picked from commit e5266f4)

* feat: multi module 정의 및 의존성 부여

(cherry picked from commit 2106d9f)

* feat: Main Activity 에서 Navigation 정의

(cherry picked from commit 94a90f6)

* feat: HomeScreen 임시 구현 및 네비게이션 정의

(cherry picked from commit 030a0e2)

* feat(navigation): 홈, 레시피 추천, 레시피 상세로 이동할 수 있다

(cherry picked from commit b61ffdf)

* chore: 앱 모듈 패키지 정리

(cherry picked from commit b38f3b6)

* feat: 레시피 추천 저장소 정의

(cherry picked from commit 2861a87)

* feat: 레시피 네비게이션 정의

(cherry picked from commit 1665b95)
  • Loading branch information
SeongHoonC authored Jun 2, 2024
1 parent 0978581 commit d994800
Show file tree
Hide file tree
Showing 72 changed files with 981 additions and 54 deletions.
3 changes: 3 additions & 0 deletions Android/.idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Android/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ android {

dependencies {

// feature
implementation(project(":feature:main"))
implementation(project(":feature:reciperecommend"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
Expand Down
11 changes: 0 additions & 11 deletions Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@
android:supportsRtl="true"
android:theme="@style/Theme.Banchango"
tools:targetApi="34">
<activity
android:name=".presentation.reciperecommend.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Banchango">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

This file was deleted.

3 changes: 2 additions & 1 deletion Android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">banchango</string>
</resources>
<string name="title_dynamicfeature">Module Title</string>
</resources>
3 changes: 3 additions & 0 deletions Android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ plugins {
alias(libs.plugins.org.jetbrains.kotlin.kapt) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.ktlint) apply true
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.serialization) apply true
}

buildscript {
Expand Down
1 change: 1 addition & 0 deletions Android/core/data-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
43 changes: 43 additions & 0 deletions Android/core/data-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
}

android {
namespace = "com.sundaegukbap.banchango.core.data.repository.api"
compileSdk = 34

defaultConfig {
minSdk = 28

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}

dependencies {
implementation(project(":core:model"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
Empty file.
21 changes: 21 additions & 0 deletions Android/core/data-api/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions Android/core/data-api/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.sundaegukbap.banchango.core.data.repository.api

import com.sundaegukbap.banchango.Recipe

interface RecipeRepository {
fun getRecipeRecommendation(): List<Recipe>
}
1 change: 1 addition & 0 deletions Android/core/designsystem/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
55 changes: 55 additions & 0 deletions Android/core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.org.jetbrains.kotlin.kapt)
}

android {
namespace = "com.sundaegukbap.banchango.core"
compileSdk = 34

defaultConfig {
minSdk = 28

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.material3.android)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.glide.compose)
}
Empty file.
21 changes: 21 additions & 0 deletions Android/core/designsystem/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Empty file.
2 changes: 2 additions & 0 deletions Android/core/designsystem/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package com.sundaegukbap.banchango.core.designsystem
package com.sundaegukbap.banchango.core.designsystem.component

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.ColorPainter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.tooling.preview.Preview
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
import com.bumptech.glide.integration.compose.GlideImage
import com.bumptech.glide.integration.compose.placeholder
import com.sundaegukbap.banchango.core.designsystem.theme.BanchangoTheme

@OptIn(ExperimentalGlideComposeApi::class)
@Composable
Expand All @@ -23,3 +25,13 @@ fun NetworkImage(modifier: Modifier, url: String) {
)
}

@Preview(showBackground = true)
@Composable
fun PreviewNetworkImage() {
BanchangoTheme {
NetworkImage(
modifier = Modifier.fillMaxSize(),
url = "https://www.example.com/image.jpg",
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sundaegukbap.banchango.ui.theme
package com.sundaegukbap.banchango.core.designsystem.theme

import androidx.compose.ui.graphics.Color

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sundaegukbap.banchango.ui.theme
package com.sundaegukbap.banchango.core.designsystem.theme

import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
Expand Down Expand Up @@ -51,7 +51,7 @@ fun BanchangoTheme(

MaterialTheme(
colorScheme = colorScheme,
content = content,
typography = Typography,
content = content
)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sundaegukbap.banchango.ui.theme
package com.sundaegukbap.banchango.core.designsystem.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
Expand Down
Empty file.
1 change: 1 addition & 0 deletions Android/core/domain/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
9 changes: 9 additions & 0 deletions Android/core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("java-library")
alias(libs.plugins.jetbrains.kotlin.jvm)
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Empty file.
1 change: 1 addition & 0 deletions Android/core/model/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
9 changes: 9 additions & 0 deletions Android/core/model/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("java-library")
alias(libs.plugins.jetbrains.kotlin.jvm)
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sundaegukbap.banchango.model
package com.sundaegukbap.banchango

data class Recipe(
val id: Long,
Expand Down
1 change: 1 addition & 0 deletions Android/core/navigation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
45 changes: 45 additions & 0 deletions Android/core/navigation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.kotlin.serialization)
}

android {
namespace = "com.sundaegukbap.banchango.navigation"
compileSdk = 34

defaultConfig {
minSdk = 28

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
implementation(libs.kotlinx.serialization.json)
}
Empty file.
Loading

0 comments on commit d994800

Please sign in to comment.