diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b3d64af95..13d7908f0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,6 +8,7 @@ plugins { android { compileSdk = Configs.COMPILE_SDK + namespace = "com.plub.plubandroid" defaultConfig { applicationId = "com.plub.plubandroid" @@ -29,11 +30,11 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = JavaVersion.VERSION_17.toString() } composeOptions { diff --git a/build.gradle.kts b/build.gradle.kts index f6745d701..561ce3d7c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false +} + buildscript { repositories { google() diff --git a/buildSrc/src/main/java/Configs.kt b/buildSrc/src/main/java/Configs.kt index 9d2b63ecf..95b52d87b 100644 --- a/buildSrc/src/main/java/Configs.kt +++ b/buildSrc/src/main/java/Configs.kt @@ -4,10 +4,10 @@ object Configs { const val KOTLIN_KAPT = "kotlin-kapt" //Android Config - const val COMPILE_SDK = 33 + const val COMPILE_SDK = 34 //Android Default Config - const val MIN_SDK = 23 + const val MIN_SDK = 26 const val TARGET_SDK = 33 const val VERSION_CODE = 1 const val VERSION_NAME = "1.0.0" diff --git a/buildSrc/src/main/java/Versions.kt b/buildSrc/src/main/java/Versions.kt index aff8d6735..8f62aeaf7 100644 --- a/buildSrc/src/main/java/Versions.kt +++ b/buildSrc/src/main/java/Versions.kt @@ -1,8 +1,8 @@ object Versions { - const val GRADLE = "7.3.1" + const val GRADLE = "8.1.1" /* [ Kotlin ] */ - const val KOTLIN_VERSION = "1.7.10" + const val KOTLIN_VERSION = "1.9.10" const val KOTLIN_COROUTINE = "1.6.4" const val KOTLIN_SERIALIZATION = "1.7.0" const val KOTLIN_SERIALIZATION_JSON = "1.3.2" @@ -25,7 +25,7 @@ object Versions { /* [ Google ] */ const val GOOGLE_PLAY_SERVICE = "20.3.0" - const val HILT = "2.42" + const val HILT = "2.48" const val MATERIAL = "1.6.1" const val TINK = "1.7.0" const val PROTOBUF = "3.21.7" diff --git a/data/build.gradle.kts b/data/build.gradle.kts index 1ff6a2011..338f4774e 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -4,13 +4,15 @@ plugins { id("com.android.library") id("dagger.hilt.android.plugin") id("org.jetbrains.kotlin.plugin.serialization") - id("com.google.protobuf") version "0.8.19" + id("com.google.protobuf") version "0.9.1" kotlin("android") kotlin("kapt") + id("com.google.devtools.ksp") } android { compileSdk = Configs.COMPILE_SDK + namespace = "com.plub.data" defaultConfig { minSdk = Configs.MIN_SDK @@ -19,11 +21,11 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = JavaVersion.VERSION_17.toString() } } @@ -41,7 +43,7 @@ dependencies { implementation(AndroidX.PAGING3_COMMON_KTX) implementation(AndroidX.ROOM) implementation(AndroidX.ROOM_KTX) - kapt(AndroidX.ROOM_COMPILER) + ksp(AndroidX.ROOM_COMPILER) implementation(Libraries.RETROFIT) implementation(Libraries.RETROFIT_CONVERTER_GSON) @@ -63,12 +65,11 @@ protobuf { } generateProtoTasks { all().forEach { task -> - task.plugins { + task.builtins { create("java") { option("lite") } } - } } } \ No newline at end of file diff --git a/data/src/main/java/com/plub/data/dao/RecentSearchDao.kt b/data/src/main/java/com/plub/data/dao/RecentSearchDao.kt index 8b864bd74..59c777bc6 100644 --- a/data/src/main/java/com/plub/data/dao/RecentSearchDao.kt +++ b/data/src/main/java/com/plub/data/dao/RecentSearchDao.kt @@ -10,21 +10,21 @@ import kotlinx.coroutines.flow.Flow @Dao interface RecentSearchDao { - @Query("SELECT * FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime DESC LIMIT :count") + @Query("SELECT * FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime DESC LIMIT :arg0") fun getSearches(count: Int): Flow> @Query("SELECT COUNT(*) FROM ${EntityTable.RECENT_SEARCH}") - suspend fun getSearchesCount(): Int + fun getSearchesCount(): Int - @Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE search = :search") - suspend fun deleteBySearch(search: String) + @Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE search = :arg0") + fun deleteBySearch(search: String): Int @Insert(onConflict = REPLACE) - suspend fun insert(recentSearchEntity: RecentSearchEntity) + fun insert(recentSearchEntity: RecentSearchEntity) - @Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE saveTime IN (SELECT saveTime FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime ASC LIMIT :count )") - suspend fun deleteOldestSearch(count: Int) + @Query("DELETE FROM ${EntityTable.RECENT_SEARCH} WHERE saveTime IN (SELECT saveTime FROM ${EntityTable.RECENT_SEARCH} ORDER BY saveTime ASC LIMIT :arg0 )") + fun deleteOldestSearch(count: Int): Int @Query("DELETE FROM ${EntityTable.RECENT_SEARCH}") - suspend fun deleteAll() + fun deleteAll() } \ No newline at end of file diff --git a/data/src/main/java/com/plub/data/dto/kakaoLocation/KakaoLocationInfoResponse.kt b/data/src/main/java/com/plub/data/dto/kakaoLocation/KakaoLocationInfoResponse.kt index 83020d482..ee927918f 100644 --- a/data/src/main/java/com/plub/data/dto/kakaoLocation/KakaoLocationInfoResponse.kt +++ b/data/src/main/java/com/plub/data/dto/kakaoLocation/KakaoLocationInfoResponse.kt @@ -14,6 +14,14 @@ data class KakaoLocationInfoResponse( data class KakaoLocationInfoDocument( @SerialName("place_name") val placeName: String = "", + @SerialName("x") + val placePositionX: String = "", + @SerialName("y") + val placePositionY: String = "", + @SerialName("address_name") + val addressName: String = "", + @SerialName("road_address_name") + val roadAddressName: String = "" ) data class Meta( diff --git a/design-system/build.gradle.kts b/design-system/build.gradle.kts index 341e8db79..5d5fb73fe 100644 --- a/design-system/build.gradle.kts +++ b/design-system/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.android.application") + id("com.android.library") id("org.jetbrains.kotlin.android") } @@ -8,11 +8,7 @@ android { compileSdk = 33 defaultConfig { - applicationId = "com.plub.design_system" minSdk = 26 - targetSdk = 33 - versionCode = 1 - versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -27,8 +23,8 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } buildFeatures { @@ -40,7 +36,7 @@ android { } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = JavaVersion.VERSION_17.toString() } } diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index 3f45b04e2..a99cb8fca 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -4,8 +4,8 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } dependencies { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7cfa3c3fe..dbe32e6b4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Sep 10 10:41:11 KST 2022 +#Wed Oct 04 15:15:31 KST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/presentation-compose/build.gradle.kts b/presentation-compose/build.gradle.kts index cdb150ca2..bf58bcc53 100644 --- a/presentation-compose/build.gradle.kts +++ b/presentation-compose/build.gradle.kts @@ -17,6 +17,9 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") + vectorDrawables { + useSupportLibrary = true + } } buildTypes { @@ -29,14 +32,27 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } + kotlinOptions { - jvmTarget = "1.8" + jvmTarget = JavaVersion.VERSION_17.toString() + } + + composeOptions { + kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPLIER } + + buildFeatures { viewBinding = true + compose = true + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } } } @@ -87,6 +103,15 @@ dependencies { implementation("androidx.constraintlayout:constraintlayout:2.1.4") implementation("androidx.navigation:navigation-fragment-ktx:2.7.3") implementation("androidx.navigation:navigation-ui-ktx:2.7.3") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") + implementation("androidx.activity:activity-compose:1.7.2") + implementation(platform("androidx.compose:compose-bom:2023.03.00")) + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.ui:ui-graphics") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.compose.material3:material3") + androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00")) + androidTestImplementation("androidx.compose.ui:ui-test-junit4") annotationProcessor(Glide.GLIDE_COMPILER) implementation(Compose.COMPOSE_ACTIVITY) @@ -96,6 +121,8 @@ dependencies { implementation(Compose.COMPOSE_NAV) implementation(Compose.COMPOSE_ANI_NAV) implementation(Compose.COMPOSE_UI_TOOL) + debugImplementation("androidx.compose.ui:ui-tooling") + debugImplementation("androidx.compose.ui:ui-test-manifest") kapt(Google.HILT_ANDROID_COMPILER) } \ No newline at end of file diff --git a/presentation-compose/src/androidTest/java/com/plub/presentation_compose/ExampleInstrumentedTest.kt b/presentation-compose/src/androidTest/java/com/plub/presentation_compose/ExampleInstrumentedTest.kt deleted file mode 100644 index bf229951d..000000000 --- a/presentation-compose/src/androidTest/java/com/plub/presentation_compose/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.plub.presentation_compose - -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.plub.presentation_compose.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/presentation-compose/src/main/AndroidManifest.xml b/presentation-compose/src/main/AndroidManifest.xml index 745d27581..fa5f6e257 100644 --- a/presentation-compose/src/main/AndroidManifest.xml +++ b/presentation-compose/src/main/AndroidManifest.xml @@ -1,12 +1,21 @@ - + + android:theme="@style/Theme.PlubAndroid"> + + + + + + + + + \ No newline at end of file diff --git a/presentation-compose/src/main/java/com/plub/presentation_compose/MainActivity.kt b/presentation-compose/src/main/java/com/plub/presentation_compose/MainActivity.kt new file mode 100644 index 000000000..b6f861682 --- /dev/null +++ b/presentation-compose/src/main/java/com/plub/presentation_compose/MainActivity.kt @@ -0,0 +1,46 @@ +package com.plub.presentation_compose + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.plub.presentation_compose.ui.theme.PlubAndroidTheme + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + PlubAndroidTheme { + // A surface container using the 'background' color from the theme + Surface( + modifier = Modifier.fillMaxSize(), + color = MaterialTheme.colorScheme.background + ) { + Greeting("Android") + } + } + } + } +} + +@Composable +fun Greeting(name: String, modifier: Modifier = Modifier) { + Text( + text = "Hello $name!", + modifier = modifier + ) +} + +@Preview(showBackground = true) +@Composable +fun GreetingPreview() { + PlubAndroidTheme { + Greeting("Android") + } +} \ No newline at end of file diff --git a/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Color.kt b/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Color.kt new file mode 100644 index 000000000..ab93b5025 --- /dev/null +++ b/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Color.kt @@ -0,0 +1,11 @@ +package com.plub.presentation_compose.ui.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) \ No newline at end of file diff --git a/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Theme.kt b/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Theme.kt new file mode 100644 index 000000000..4eaabc120 --- /dev/null +++ b/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Theme.kt @@ -0,0 +1,70 @@ +package com.plub.presentation_compose.ui.theme + +import android.app.Activity +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.runtime.SideEffect +import androidx.compose.ui.graphics.toArgb +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalView +import androidx.core.view.WindowCompat + +private val DarkColorScheme = darkColorScheme( + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 +) + +private val LightColorScheme = lightColorScheme( + primary = Purple40, + secondary = PurpleGrey40, + tertiary = Pink40 + + /* Other default colors to override + background = Color(0xFFFFFBFE), + surface = Color(0xFFFFFBFE), + onPrimary = Color.White, + onSecondary = Color.White, + onTertiary = Color.White, + onBackground = Color(0xFF1C1B1F), + onSurface = Color(0xFF1C1B1F), + */ +) + +@Composable +fun PlubAndroidTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + 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 + } + val view = LocalView.current + if (!view.isInEditMode) { + SideEffect { + val window = (view.context as Activity).window + window.statusBarColor = colorScheme.primary.toArgb() + WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme + } + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} \ No newline at end of file diff --git a/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Type.kt b/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Type.kt new file mode 100644 index 000000000..5bbcc3a08 --- /dev/null +++ b/presentation-compose/src/main/java/com/plub/presentation_compose/ui/theme/Type.kt @@ -0,0 +1,34 @@ +package com.plub.presentation_compose.ui.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 + +// Set of Material typography styles to start with +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ) + /* Other default text styles to override + titleLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 22.sp, + lineHeight = 28.sp, + letterSpacing = 0.sp + ), + labelSmall = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 11.sp, + lineHeight = 16.sp, + letterSpacing = 0.5.sp + ) + */ +) \ No newline at end of file diff --git a/presentation-compose/src/main/res/values/strings.xml b/presentation-compose/src/main/res/values/strings.xml new file mode 100644 index 000000000..2ca737562 --- /dev/null +++ b/presentation-compose/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + MainActivity + \ No newline at end of file diff --git a/presentation-compose/src/main/res/values/themes.xml b/presentation-compose/src/main/res/values/themes.xml new file mode 100644 index 000000000..064908c0c --- /dev/null +++ b/presentation-compose/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + +