Skip to content

Commit

Permalink
[MERGE] : #453 -> develop
Browse files Browse the repository at this point in the history
[CHORE/#453] Compose Setting
  • Loading branch information
kkk5474096 authored Jul 22, 2024
2 parents e5edddd + 4f73208 commit 4cdb871
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 37 deletions.
4 changes: 1 addition & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("yello.android.application")
id("yello.android.application.compose")
id("yello.android.androidHilt")
alias(libs.plugins.androidKotlin)
}
Expand All @@ -8,7 +9,4 @@ dependencies {
implementation(project(":core-ui"))
implementation(project(":data"))
implementation(project(":domain"))
implementation(libs.androidx.appCompat)
implementation(libs.materialDesign)
implementation(libs.androidx.constraintLayout)
}
15 changes: 9 additions & 6 deletions app/src/main/java/com/el/yello/util/extension/ImageViewExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import com.el.yello.R

fun ImageView.loadUrl(url: String) {
if (url.endsWith(".svg")) {
val imageLoader = ImageLoader.Builder(this.context)
.componentRegistry { add(SvgDecoder(this@loadUrl.context)) }
.build()
val imageLoader = ImageLoader.Builder(context)
.components {
add(SvgDecoder.Factory())
}.build()

val request = ImageRequest.Builder(this.context)
.crossfade(true)
Expand All @@ -36,9 +37,11 @@ fun ImageView.loadUrlWithCircleCrop(url: String) {
return
}

val imageLoader = ImageLoader.Builder(this.context)
.componentRegistry { add(SvgDecoder(this@loadUrlWithCircleCrop.context)) }
.build()
val imageLoader = ImageLoader.Builder(context)
.components {
add(SvgDecoder.Factory())
}.build()


val request = ImageRequest.Builder(this.context)
.crossfade(true)
Expand Down
4 changes: 4 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ gradlePlugin {
id = "yello.android.application"
implementationClass = "plugins.AndroidApplicationPlugin"
}
register("androidApplicationCompose") {
id = "yello.android.application.compose"
implementationClass = "plugins.AndroidApplicationComposePlugin"
}
register("androidLibrary") {
id = "yello.android.library"
implementationClass = "plugins.AndroidLibraryPlugin"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package plugins

import com.android.build.api.dsl.ApplicationExtension
import ext.androidTestImplementation
import ext.debugImplementation
import ext.getBundle
import ext.getLibrary
import ext.getVersionCatalog
import ext.implementation
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType

/**
* Android Application 모듈에 compose를 사용할 경우 적용할 Plugin
*
* plugin id : [yello.android.application.compose]
*/
class AndroidApplicationComposePlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
extensions.getByType<ApplicationExtension>().apply {
buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.11"
}
}
val libs = extensions.getVersionCatalog()
dependencies {
val composeBom = platform(libs.getLibrary("compose-bom"))
implementation(composeBom)
androidTestImplementation(composeBom)
implementation(libs.getBundle("compose-bom-bundle"))
debugImplementation(libs.getLibrary("compose-bom-debug-ui-tooling"))
androidTestImplementation(libs.getLibrary("compose-bom-debug-ui-test-manifest"))
implementation(libs.getBundle("compose"))
}
}
}
}
79 changes: 51 additions & 28 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
buildToolsVersion = "34.0.0"
## Kotlin
kotlinVersion = "1.8.20"
kotlinVersion = "1.9.23"
kotlinSerializationJsonVersion = "1.5.1"
coroutinesAndroidVersion = "1.7.1"
kotlinDateTimeVersion = "0.4.0"
Expand All @@ -23,16 +23,27 @@ pagingVersion = "3.1.1"
lifecycleVersion = "2.6.1"
ossVersion = "17.0.0"
splashVersion = "1.0.0-beta01"
composeVersion = "1.4.3"
workManagerVersion = "2.8.1"
billingVersion = "6.0.1"
admobVersion = "21.5.0"

## Compose
composeActivityVersion = "1.9.0"
composeAnimationVersion = "1.6.8"
composeViewModelVersion = "2.7.0"
composeBom = "2024.06.00"
composeCoil = "2.6.0"
composeConstraintLayoutVersion = "1.0.1"
composeLottieVersion = "6.0.1"
composeCompilerVersion = "1.5.11"
composeNavigation = "2.7.7"
composeHiltVersion= "1.2.0"

## Firebase
firebaseVersion = "30.4.0"

## Third-party
coilVersion = "1.2.0"
coilVersion = "2.6.0"
retrofitVersion = "2.11.0"
kotlinSerializationConverterVersion = "1.0.0"
okHttpVersion = "4.12.0"
Expand Down Expand Up @@ -148,20 +159,28 @@ firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashly
firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics-ktx"}
firebase-remoteConfig = { group = "com.google.firebase", name = "firebase-config-ktx"}

compose-activity = { group = "androidx.activity", name = "activity-compose", version.ref = "activityKtxVersion" }
compose-material = { group = "androidx.compose.material", name = "material", version.ref = "composeVersion" }
compose-animation = { group = "androidx.compose.animation", name = "animation", version.ref = "composeVersion" }
compose-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "composeVersion" }
compose-ui-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "composeVersion" }
compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "composeVersion" }
compose-material-core = { group = "androidx.compose.material", name = "material-icons-core", version.ref = "composeVersion" }
compose-material-extended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "composeVersion" }
compose-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version.ref = "composeVersion" }
compose-lifecycle = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "composeVersion" }
compose-hilt= { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "composeVersion" }
compose-paging = { group = "androidx.paging", name = "paging-compose", version.ref = "composeVersion" }
compose-coil = { group = "io.coil-kt", name = "coil-compose", version.ref = "composeVersion" }
compose-lottie = { group = "com.airbnb.android", name = "lottie-compose", version.ref = "lottieVersion" }
## Compose
compose-activity = { group = "androidx.activity", name = "activity-compose", version.ref = "composeActivityVersion" }
compose-animation = { group = "androidx.compose.animation", name = "animation", version.ref = "composeAnimationVersion" }
compose-viewModel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "composeViewModelVersion" }
compose-coil = {group = "io.coil-kt", name = "coil-compose", version.ref = "composeCoil"}
compose-constraintLayout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version.ref = "composeConstraintLayoutVersion"}
compose-lottie = { group = "com.airbnb.android", name = "lottie-compose", version.ref = "composeLottieVersion"}
compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "composeNavigation"}
compose-hilt= { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "composeHiltVersion" }
compose-compiler-extension = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlinVersion" }

## Compose Bom
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
compose-bom-material3 = {group = "androidx.compose.material3", name = "material3"}
compose-bom-material2 = {group = "androidx.compose.material", name = "material"}
compose-bom-ui = {group = "androidx.compose.ui", name = "ui"}
compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
compose-bom-preview = {group = "androidx.compose.ui", name = "ui-tooling-preview"}
compose-bom-debug-ui-tooling = {group = "androidx.compose.ui", name = "ui-tooling"}
compose-bom-ui-test = {group = "androidx.compose.ui", name = "ui-test-junit4"}
compose-bom-debug-ui-test-manifest = {group = "androidx.compose.ui", name="ui-test-manifest"}
compose-runtime = {group = "androidx.compose.runtime", name="runtime"}


## Test
Expand Down Expand Up @@ -200,21 +219,25 @@ androidx = [
"admob"
]

## Compose
compose = [
"compose-activity",
"compose-animation",
"compose-foundation",
"compose-material",
"compose-material-core",
"compose-material-extended",
"compose-ui",
"compose-ui-preview",
"compose-constraintlayout",
"compose-hilt",
"compose-lifecycle",
"compose-paging",
"compose-viewModel",
"compose-coil",
"compose-lottie"
"compose-hilt",
"compose-constraintLayout",
"compose-lottie",
"compose-navigation"]

## Compose Bom
compose-bom-bundle = [
"compose-bom-material3",
"compose-bom-material2",
"compose-ui-graphics",
"compose-bom-ui",
"compose-bom-preview",
"compose-runtime"
]

kakao = [
Expand Down

0 comments on commit 4cdb871

Please sign in to comment.