diff --git a/.gitignore b/.gitignore index 70db1fa..13a624f 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ build/ # Local configuration file (sdk path, etc) local.properties +**/local.properties # Log/OS Files *.log diff --git a/AGENTS.md b/AGENTS.md index 55c9e36..a8088ef 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,7 +36,5 @@ ## Tooling Reminder - Use **Figma MCP** for UI work. Use **android-pilot** MCP (see `.cursor/mcp.json`) for Gradle build/lint and device checks once an app module exists. +- The Gradle project root is **`android/`**. Run builds from there (`cd android && ./gradlew assembleDebug`). Open that folder in Android Studio. - Do not use android-pilot scaffolding tools to invent a project layout that conflicts with `docs/rules/architecture.md` or ADRs. Details: `docs/rules/tooling.md`. - -## Out of Scope (until decided otherwise) -- Gradle/app scaffolding is tracked in a separate issue from agent tooling setup. diff --git a/README.md b/README.md index 43ed245..39f640d 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,12 @@ Livith iOS의 안드로이드 버전 저장소다. -현재는 **기초 문서**(협업 규칙, ADR, 에이전트 안내) 단계이며, 앱/Gradle 스캐폴드는 별도 이슈에서 진행한다. - - 에이전트·기여자 진입점: [AGENTS.md](./AGENTS.md) - 결정 기록: [docs/adr/](./docs/adr/) - 실행 규칙: [docs/rules/](./docs/rules/) - 에이전트 MCP: [docs/rules/tooling.md](./docs/rules/tooling.md), [`.cursor/mcp.json`](./.cursor/mcp.json) +- 앱(Gradle 루트): [android/](./android/) — Android Studio는 이 폴더를 연다. + +```bash +cd android && ./gradlew assembleDebug +``` diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/android/app/.gitignore b/android/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/android/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..0cb69c5 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,76 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.compose) + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.ksp) + alias(libs.plugins.hilt) +} + +android { + namespace = "com.youz2me.livith" + compileSdk { + version = release(37) + } + + defaultConfig { + applicationId = "com.youz2me.livith" + minSdk = 26 + targetSdk = 36 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + debug { + buildConfigField("String", "BASE_URL", "\"https://dev-api.livith.com/\"") + } + release { + buildConfigField("String", "BASE_URL", "\"https://api.livith.com/\"") + optimization { + enable = false + } + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + buildFeatures { + compose = true + buildConfig = true + } +} + +dependencies { + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.graphics) + implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.lifecycle.runtime.compose) + implementation(libs.androidx.lifecycle.viewmodel.compose) + implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.datastore.preferences) + implementation(libs.hilt.android) + implementation(libs.hilt.navigation.compose) + implementation(libs.retrofit) + implementation(libs.retrofit.kotlinx.serialization) + implementation(libs.okhttp) + implementation(libs.okhttp.logging) + implementation(libs.kotlinx.serialization.json) + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.coroutines.core) + ksp(libs.hilt.compiler) + testImplementation(libs.junit) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.compose.ui.test.junit4) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(libs.androidx.junit) + debugImplementation(libs.androidx.compose.ui.test.manifest) + debugImplementation(libs.androidx.compose.ui.tooling) +} diff --git a/android/app/src/androidTest/java/com/youz2me/livith/ExampleInstrumentedTest.kt b/android/app/src/androidTest/java/com/youz2me/livith/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..61abf40 --- /dev/null +++ b/android/app/src/androidTest/java/com/youz2me/livith/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.youz2me.livith + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * 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("com.youz2me.livith", appContext.packageName) + } +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c0f42ce --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/java/com/youz2me/livith/LivithApplication.kt b/android/app/src/main/java/com/youz2me/livith/LivithApplication.kt new file mode 100644 index 0000000..bb7c41c --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/LivithApplication.kt @@ -0,0 +1,7 @@ +package com.youz2me.livith + +import android.app.Application +import dagger.hilt.android.HiltAndroidApp + +@HiltAndroidApp +class LivithApplication : Application() diff --git a/android/app/src/main/java/com/youz2me/livith/core/di/NetworkModule.kt b/android/app/src/main/java/com/youz2me/livith/core/di/NetworkModule.kt new file mode 100644 index 0000000..d0d55a3 --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/core/di/NetworkModule.kt @@ -0,0 +1,55 @@ +package com.youz2me.livith.core.di + +import com.youz2me.livith.BuildConfig +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton +import kotlinx.serialization.json.Json +import okhttp3.MediaType.Companion.toMediaType +import okhttp3.OkHttpClient +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory + +@Module +@InstallIn(SingletonComponent::class) +object NetworkModule { + + @Provides + @Singleton + fun provideJson(): Json = Json { + ignoreUnknownKeys = true + explicitNulls = false + } + + @Provides + @Singleton + fun provideOkHttpClient(): OkHttpClient { + val logging = HttpLoggingInterceptor().apply { + level = if (BuildConfig.DEBUG) { + HttpLoggingInterceptor.Level.BASIC + } else { + HttpLoggingInterceptor.Level.NONE + } + } + return OkHttpClient.Builder() + .addInterceptor(logging) + .build() + } + + @Provides + @Singleton + fun provideRetrofit( + okHttpClient: OkHttpClient, + json: Json, + ): Retrofit { + val contentType = "application/json".toMediaType() + return Retrofit.Builder() + .baseUrl(BuildConfig.BASE_URL) + .client(okHttpClient) + .addConverterFactory(json.asConverterFactory(contentType)) + .build() + } +} diff --git a/android/app/src/main/java/com/youz2me/livith/data/DataLayer.kt b/android/app/src/main/java/com/youz2me/livith/data/DataLayer.kt new file mode 100644 index 0000000..eb0b4ec --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/data/DataLayer.kt @@ -0,0 +1,6 @@ +package com.youz2me.livith.data + +/** + * Data layer root: repository implementations, data sources, DTOs, and mappers live here. + */ +object DataLayer diff --git a/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Color.kt b/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Color.kt new file mode 100644 index 0000000..933f8b6 --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Color.kt @@ -0,0 +1,11 @@ +package com.youz2me.livith.designsystem.theme + +import androidx.compose.ui.graphics.Color + +val Purple80 = Color(0xFFD0BCFF) +val PurpleGrey80 = Color(0xFFCCC2DC) +val Pink80 = Color(0xFFEFB8C8) + +val Purple40 = Color(0xFF6650a4) +val PurpleGrey40 = Color(0xFF625b71) +val Pink40 = Color(0xFF7D5260) diff --git a/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Theme.kt b/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Theme.kt new file mode 100644 index 0000000..1ef1dd7 --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Theme.kt @@ -0,0 +1,46 @@ +package com.youz2me.livith.designsystem.theme + +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalContext + +private val DarkColorScheme = darkColorScheme( + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 +) + +private val LightColorScheme = lightColorScheme( + primary = Purple40, + secondary = PurpleGrey40, + tertiary = Pink40 +) + +@Composable +fun LivithTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + dynamicColor: Boolean = true, + content: @Composable () -> Unit +) { + val colorScheme = when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + + darkTheme -> DarkColorScheme + else -> LightColorScheme + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} diff --git a/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Type.kt b/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Type.kt new file mode 100644 index 0000000..bbf0cb9 --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/designsystem/theme/Type.kt @@ -0,0 +1,17 @@ +package com.youz2me.livith.designsystem.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ) +) diff --git a/android/app/src/main/java/com/youz2me/livith/domain/DomainLayer.kt b/android/app/src/main/java/com/youz2me/livith/domain/DomainLayer.kt new file mode 100644 index 0000000..3471864 --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/domain/DomainLayer.kt @@ -0,0 +1,6 @@ +package com.youz2me.livith.domain + +/** + * Domain layer root: entities, repository interfaces, and use cases live here. + */ +object DomainLayer diff --git a/android/app/src/main/java/com/youz2me/livith/presentation/MainActivity.kt b/android/app/src/main/java/com/youz2me/livith/presentation/MainActivity.kt new file mode 100644 index 0000000..3d89b3e --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/presentation/MainActivity.kt @@ -0,0 +1,27 @@ +package com.youz2me.livith.presentation + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.Surface +import androidx.compose.ui.Modifier +import com.youz2me.livith.designsystem.theme.LivithTheme +import com.youz2me.livith.presentation.navigation.LivithNavHost +import dagger.hilt.android.AndroidEntryPoint + +@AndroidEntryPoint +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + LivithTheme { + Surface(modifier = Modifier.fillMaxSize()) { + LivithNavHost() + } + } + } + } +} diff --git a/android/app/src/main/java/com/youz2me/livith/presentation/navigation/LivithNavHost.kt b/android/app/src/main/java/com/youz2me/livith/presentation/navigation/LivithNavHost.kt new file mode 100644 index 0000000..9fbd00e --- /dev/null +++ b/android/app/src/main/java/com/youz2me/livith/presentation/navigation/LivithNavHost.kt @@ -0,0 +1,31 @@ +package com.youz2me.livith.presentation.navigation + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController + +private const val START_ROUTE = "start" + +@Composable +fun LivithNavHost() { + val navController = rememberNavController() + NavHost( + navController = navController, + startDestination = START_ROUTE, + ) { + composable(START_ROUTE) { + Box( + modifier = Modifier.fillMaxSize(), + contentAlignment = Alignment.Center, + ) { + Text(text = "Livith") + } + } + } +} diff --git a/android/app/src/main/keepRules/rules.keep b/android/app/src/main/keepRules/rules.keep new file mode 100644 index 0000000..d7e081a --- /dev/null +++ b/android/app/src/main/keepRules/rules.keep @@ -0,0 +1,12 @@ +# Add project specific R8 rules here. +# AGP will combine all keep rule files in src/main/keepRules to pass to R8 +# +# For more details, see +# https://d.android.com/r/tools/r8/keep-rules + +# 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 *; +#} \ No newline at end of file diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/android/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..daf5ad8 --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Livith + \ No newline at end of file diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..8913f9e --- /dev/null +++ b/android/app/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + +