diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4e81eab..cf1144c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -79,23 +79,27 @@ dependencies { implementation(project(DependencyGradle.FROGO_PATH_UI)) - implementation(Androidx.appCompat) - implementation(Androidx.constraintLayout) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.constraintlayout) - implementation(Androidx.Core.ktx) - implementation(Androidx.Lifecycle.runtimeKtx) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) - implementation(Androidx.Compose.activity) - implementation(Androidx.Compose.material) - implementation(Androidx.Compose.ui) - implementation(Androidx.Compose.uiToolingPreview) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.ui) - implementation(Google.material) - implementation(Google.gson) + implementation(libs.material) + implementation(libs.gson) - implementation(DependencyGradle.FrogoRecyclerView) + implementation(libs.frogo.recyclerview) - debugImplementation(Androidx.Compose.uiTooling) - debugImplementation(Androidx.Compose.uiTestManifest) + implementation(libs.material) + + api(libs.github.circleimageview) + + debugImplementation(libs.androidx.compose.ui.tooling) + debugImplementation(libs.androidx.compose.ui.tooling.preview) + debugImplementation(libs.androidx.compose.ui.test.manifest) } \ No newline at end of file diff --git a/app/src/main/java/com/frogobox/appuikit/MainActivity.kt b/app/src/main/java/com/frogobox/appuikit/MainActivity.kt index b9d4ebd..12037ac 100644 --- a/app/src/main/java/com/frogobox/appuikit/MainActivity.kt +++ b/app/src/main/java/com/frogobox/appuikit/MainActivity.kt @@ -64,6 +64,14 @@ class MainActivity : BaseActivity() { ) { view.findViewById(R.id.frogo_rv_list_type_1_tv_title).text = data.name } + + override fun areContentsTheSame(oldItem: Main, newItem: Main): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: Main, newItem: Main): Boolean { + return oldItem == newItem + } }) .createLayoutLinearVertical(false) .build() diff --git a/app/src/main/java/com/frogobox/appuikit/recycler/FrogoRvAdapter.kt b/app/src/main/java/com/frogobox/appuikit/recycler/FrogoRvAdapter.kt index def0614..f5cda98 100644 --- a/app/src/main/java/com/frogobox/appuikit/recycler/FrogoRvAdapter.kt +++ b/app/src/main/java/com/frogobox/appuikit/recycler/FrogoRvAdapter.kt @@ -5,6 +5,7 @@ import android.view.View import android.widget.ImageView import android.widget.TextView import com.frogobox.appuikit.R +import com.frogobox.appuikit.model.Main import com.frogobox.recycler.core.FrogoRecyclerNotifyListener import com.frogobox.recycler.core.IFrogoViewAdapter @@ -55,6 +56,14 @@ object FrogoRvAdapter { R.string.frogo_dummy_title ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -91,6 +100,14 @@ object FrogoRvAdapter { R.string.frogo_dummy_subtitle ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -131,6 +148,14 @@ object FrogoRvAdapter { R.string.frogo_dummy_desc ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -167,6 +192,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -207,6 +240,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -251,6 +292,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -287,6 +336,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -327,6 +384,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -363,6 +428,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -403,6 +476,13 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -447,6 +527,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -479,6 +567,14 @@ object FrogoRvAdapter { R.string.frogo_dummy_title ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -515,6 +611,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -555,6 +659,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -599,6 +711,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -635,6 +755,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -675,6 +803,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -719,6 +855,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -751,6 +895,14 @@ object FrogoRvAdapter { R.drawable.ic_artist ) } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } @@ -780,6 +932,14 @@ object FrogoRvAdapter { ) { } + + override fun areContentsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: String, newItem: String): Boolean { + return oldItem == newItem + } } } } diff --git a/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerGridFragment.kt b/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerGridFragment.kt index 251e460..bd476ff 100644 --- a/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerGridFragment.kt +++ b/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerGridFragment.kt @@ -68,6 +68,14 @@ class RecyclerGridFragment : BaseFragment() { view.findViewById(R.id.frogo_rv_grid_type_1_iv_poster) .setImageResource(R.drawable.ic_artist) } + + override fun areContentsTheSame(oldItem: Layout, newItem: Layout): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: Layout, newItem: Layout): Boolean { + return oldItem == newItem + } }) .createLayoutGrid(2) .build() diff --git a/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerListFragment.kt b/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerListFragment.kt index 0f826ec..2cad678 100644 --- a/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerListFragment.kt +++ b/app/src/main/java/com/frogobox/appuikit/recycler/RecyclerListFragment.kt @@ -66,6 +66,14 @@ class RecyclerListFragment : BaseFragment() { ) { view.findViewById(R.id.frogo_rv_list_type_1_tv_title).text = data.name } + + override fun areContentsTheSame(oldItem: Layout, newItem: Layout): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: Layout, newItem: Layout): Boolean { + return oldItem == newItem + } }) .createLayoutLinearVertical(false) .build() diff --git a/build.gradle.kts b/build.gradle.kts index bfca4ad..cfb78ab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.3.1" apply false - id("com.android.library") version "8.3.1" apply false + id("com.android.application") version "8.3.2" apply false + id("com.android.library") version "8.3.2" apply false id("org.jetbrains.kotlin.android") version DependencyGradle.KOTLIN_VERSION apply false id("org.jetbrains.kotlin.jvm") version DependencyGradle.KOTLIN_VERSION apply false } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 21fd521..e351e87 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -7,9 +7,4 @@ plugins { repositories { mavenCentral() maven("https://jitpack.io") -} - -dependencies{ - // library frogo-build-src - implementation("com.github.frogobox:open-build-src:3.0.4") -} +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/DependencyGradle.kt b/buildSrc/src/main/kotlin/DependencyGradle.kt index 6296f0b..9c44e10 100644 --- a/buildSrc/src/main/kotlin/DependencyGradle.kt +++ b/buildSrc/src/main/kotlin/DependencyGradle.kt @@ -14,13 +14,11 @@ object DependencyGradle { // dependencies version - const val KOTLIN_VERSION = Version.JetBrains.kotlin - const val COMPOSE_MULTIPLATFORM_VERSION = Version.Androidx.composeMultiPlatform - const val COMPOSE_VERSION = Version.Androidx.composeCompiler + const val KOTLIN_VERSION = "1.9.23" // https://kotlinlang.org/docs/releases.html#release-details + const val COMPOSE_MULTIPLATFORM_VERSION = "1.6.1" // https://github.com/JetBrains/compose-jb + const val COMPOSE_VERSION = "1.5.12" // https://developer.android.com/jetpack/androidx/releases/compose const val FROGO_PATH_CORE_UI = ":${ProjectSetting.MODULE_NAME_UI}" const val FROGO_PATH_UI = ":${ProjectSetting.MODULE_NAME_CORE_UI}" - const val FrogoRecyclerView = "com.github.amirisback:frogo-recycler-view:4.3.5" - } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/ProjectSetting.kt b/buildSrc/src/main/kotlin/ProjectSetting.kt index 676e87e..240bf19 100644 --- a/buildSrc/src/main/kotlin/ProjectSetting.kt +++ b/buildSrc/src/main/kotlin/ProjectSetting.kt @@ -33,8 +33,8 @@ object ProjectSetting { // --------------------------------------------------------------------------------------------- - const val PROJECT_MIN_SDK = Version.Gradle.minSdk - const val PROJECT_COMPILE_SDK = Version.Gradle.compileSdk + const val PROJECT_MIN_SDK = 21 + const val PROJECT_COMPILE_SDK = 34 const val PROJECT_TARGET_SDK = PROJECT_COMPILE_SDK // --------------------------------------------------------------------------------------------- diff --git a/core-ui-android/build.gradle.kts b/core-ui-android/build.gradle.kts index a9e50af..a7cf598 100644 --- a/core-ui-android/build.gradle.kts +++ b/core-ui-android/build.gradle.kts @@ -58,19 +58,18 @@ android { dependencies { - implementation(Androidx.appCompat) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.ui) - implementation(Androidx.Compose.activity) - implementation(Androidx.Compose.material) - implementation(Androidx.Compose.ui) - implementation(Androidx.Compose.uiToolingPreview) + implementation(libs.material) - implementation(Google.material) + api(libs.github.circleimageview) - api(Util.hdodenhofCircleImageView) - - debugImplementation(Androidx.Compose.uiTooling) - debugImplementation(Androidx.Compose.uiTestManifest) + debugImplementation(libs.androidx.compose.ui.tooling) + debugImplementation(libs.androidx.compose.ui.tooling.preview) + debugImplementation(libs.androidx.compose.ui.test.manifest) } diff --git a/core-ui/build.gradle.kts b/core-ui/build.gradle.kts index 7f02712..56ea294 100644 --- a/core-ui/build.gradle.kts +++ b/core-ui/build.gradle.kts @@ -57,7 +57,7 @@ publishing { } repositories { - maven(Util.jitpackUrl) + maven("https://jitpack.io") } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..4ea0796 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,127 @@ +[versions] +agp = "8.5.1" +kotlin = "1.9.23" +ksp = "1.9.23-1.0.19" + +coreKtx = "1.13.1" +appcompat = "1.7.0" +activity = "1.9.1" +fragment = "1.8.2" +constraintlayout = "2.1.4" +liveCycle = "2.8.4" +viewPager2 = "1.1.0" +preference = "1.2.1" +roomKtx = "2.6.1" +work = "2.9.0" + +# Compose Version +composeCompiler = "1.5.12" # https://developer.android.com/jetpack/androidx/releases/compose +composeAnimation = "1.6.6"# https://developer.android.com/jetpack/androidx/releases/compose +composeActivity = "1.9.1" # https://androidx.tech/artifacts/activity/activity-compose/ +compose = "1.6.8" # https://developer.android.com/jetpack/androidx/releases/compose +composeMaterial = "1.6.8" # https://developer.android.com/jetpack/androidx/releases/compose +composeFoundation = "1.6.6" # https://developer.android.com/jetpack/androidx/releases/compose +composeMaterial3 = "1.2.1" # https://developer.android.com/jetpack/androidx/releases/compose +composeNavigation = "2.7.7" # https://androidx.tech/artifacts/navigation/navigation-compose/ +composeHiltNavigation = "1.2.0" # https://developer.android.com/jetpack/androidx/releases/hilt + + +material = "1.12.0" +gson = "2.10.1" + +okhttp = "4.12.0" +retrofit = "2.11.0" + +rxandroid3 = "3.0.2" +rxjava3 = "3.1.8" + +chucker = "4.0.0" +glide = "4.16.0" +customactivityoncrash = "2.4.0" +circleimageview = "3.1.0" + +koin = "3.5.6" + +frogorecylerview = "4.4.1" + +junit = "4.13.2" +junitVersion = "1.2.1" +espressoCore = "3.6.1" + +[libraries] +# Android Kit +androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +androidx-activity-ktx = { group = "androidx.activity", name = "activity-ktx", version.ref = "activity" } +androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment" } +androidx-work-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "work" } + + +androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } +androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "liveCycle" } +androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "liveCycle" } +androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "liveCycle" } +androidx-lifecycle-compiler = { group = "androidx.lifecycle", name = "lifecycle-compiler", version.ref = "liveCycle" } + +androidx-viewpager2 = { group = "androidx.viewpager2", name = "viewpager2", version.ref = "viewPager2" } +androidx-preference = { group = "androidx.preference", name = "preference", version.ref = "preference" } + +androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "roomKtx" } +androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "roomKtx" } +androidx-room-rxjava3 = { group = "androidx.room", name = "room-rxjava3", version.ref = "roomKtx" } +androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "roomKtx" } + +androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "composeActivity"} +androidx-compose-material = { group = "androidx.compose.material", name = "material", version.ref = "composeMaterial"} +androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "composeMaterial3"} +androidx-compose-animation = { group = "androidx.compose.animation", name = "animation", version.ref = "compose"} +androidx-compose-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "compose"} +androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "compose"} +androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "compose"} +androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest", version.ref = "compose"} + +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } + +# -------------------------------------------------------------------------------------------------- +# Test Library + +androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +junit = { group = "junit", name = "junit", version.ref = "junit" } + +# -------------------------------------------------------------------------------------------------- +# Library + +square-okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } +square-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" } + +square-retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" } +square-retrofit-converter-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "retrofit" } +square-retrofit-adapter-rxjava3 = { group = "com.squareup.retrofit2", name = "adapter-rxjava3", version.ref = "retrofit" } + +reactivex-rxjava3 = { group = "io.reactivex.rxjava3", name = "rxjava", version.ref = "rxjava3" } +reactivex-rxandroid3 = { group = "io.reactivex.rxjava3", name = "rxandroid", version.ref = "rxandroid3" } + +github-chucker = { group = "com.github.chuckerteam.chucker", name = "library", version.ref = "chucker" } +github-glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" } +github-glide-compiler = { group = "com.github.bumptech.glide", name = "compiler", version.ref = "glide" } +github-customactivityoncrash = { group = "cat.ereza", name = "customactivityoncrash", version.ref = "customactivityoncrash" } +github-circleimageview = { group = "de.hdodenhof", name = "circleimageview", version.ref = "circleimageview" } + +koin-core = { group = "io.insert-koin", name = "koin-core", version.ref = "koin" } +koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" } +koin-android-compat = { group = "io.insert-koin", name = "koin-android-compat", version.ref = "koin" } +koin-androidx-workmanager = { group = "io.insert-koin", name = "koin-androidx-workmanager", version.ref = "koin" } + +frogo-recyclerview = { group = "com.github.amirisback", name = "frogo-recycler-view", version.ref = "frogorecylerview" } + +# -------------------------------------------------------------------------------------------------- + + +[plugins] +#android-application = { id = "com.android.application", version.ref = "agp" } +#android.library = { id = "com.android.library", version.ref = "agp"} +#jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +#jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin"} +#google-devtools-ksp = { id = "org.google.devtools.ksp", version.ref = "ksp"}