Skip to content

Commit 34f3cf1

Browse files
committed
ref: Clean up and first scaffolding in order to move to jetpack compose
1 parent 7b564cc commit 34f3cf1

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
![banner](https://user-images.githubusercontent.com/37318022/40349145-3e0c8d8a-5dd8-11e8-8654-5784f9ab7554.png)
22

3+
# STATUS: Refactoring! Please check the TODOs below in the **project status section**.
4+
35
# Android - Clean Architecture - Kotlin [![Build Status](https://travis-ci.org/android10/Android-CleanArchitecture-Kotlin.svg?branch=main)](https://travis-ci.org/android10/Android-CleanArchitecture-Kotlin) [![codecov](https://codecov.io/gh/android10/Android-CleanArchitecture-Kotlin/branch/main/graph/badge.svg?token=x1AtDcNuDv)](https://codecov.io/gh/android10/Android-CleanArchitecture-Kotlin)
46
The purpose of this repo is to follow up Clean Architecture principles by bringing them to Android. It is worth saying that the idea is to take advantage of the Kotlin Programming Language features plus also pull in lessons learned and ideas from other interesting approaches like Functional Programming.
57

68
## Project Status
79

810
- **Last Update: 2024.08**
9-
- Migrated to Kotlin 2.0.
10-
- Migrated to Jetpack Compose.
11-
- Bug Fixes.
11+
- TODO: Migrate to Kotlin 2.0.
12+
- TODO: Migrate to Jetpack Compose.
13+
- TODO: Bug Fixes.
14+
- TODO: Reorganize and cleanup tests.
15+
- TODO: Reorganize dependencies and build system.
1216

1317
## Blog post with implementation details explanation:
1418
[Architecting Android… Reloaded](https://fernandocejas.com/2018/05/07/architecting-android-reloaded/)

app/build.gradle.kts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AppConfig {
2020
plugins {
2121
alias(libs.plugins.android.application)
2222
alias(libs.plugins.kotlin.android)
23-
// alias(libs.plugins.kotlin.compose.compiler)
23+
alias(libs.plugins.kotlin.compose.compiler)
2424
alias(libs.plugins.kotlin.ksp)
2525
alias(libs.plugins.kotlin.parcelize)
2626
}
@@ -47,9 +47,9 @@ android {
4747
targetCompatibility = appConfig.javaVersion
4848
}
4949

50-
// composeCompiler {
51-
// enableStrongSkippingMode = true
52-
// }
50+
buildFeatures {
51+
compose = true
52+
}
5353

5454
buildTypes {
5555
getByName("debug") {
@@ -68,19 +68,17 @@ kotlin {
6868
}
6969

7070
dependencies {
71-
//Compile time dependencies
72-
// implementation(libs.kotlin.compose.compiler.plugin.embeddable)
73-
// implementation(libs.kotlin.compose.compiler.plugin)
74-
7571
// Application dependencies
7672
implementation(libs.kotlin.stdlib)
7773
implementation(libs.kotlinx.coroutines.core)
7874
implementation(libs.kotlinx.coroutines.android)
7975
implementation(libs.koin.android)
8076
implementation(libs.android.appcompat)
81-
// implementation(libs.glide)
8277
implementation(libs.converter.gson)
8378

79+
// jetpack compose dependencies
80+
// https://developer.android.google.cn/develop/ui/compose/setup?hl=en#kotlin_1
81+
8482
// Unit/Integration tests dependencies
8583
testImplementation(libs.kotest.runner.junit5)
8684
testImplementation(libs.kotest.assertions.core)

app/src/main/kotlin/com/fernandocejas/sample/features/movies/ui/MoviesActivity.kt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ package com.fernandocejas.sample.features.movies.ui
1818
import android.content.Context
1919
import android.content.Intent
2020
import android.os.Bundle
21+
import androidx.activity.ComponentActivity
2122
import androidx.appcompat.app.AppCompatActivity
2223
import com.fernandocejas.sample.R
2324

24-
class MoviesActivity : AppCompatActivity() {
25+
class MoviesActivity : ComponentActivity() {
2526

2627
companion object {
2728
fun callingIntent(context: Context) = Intent(context, MoviesActivity::class.java)
@@ -31,16 +32,9 @@ class MoviesActivity : AppCompatActivity() {
3132

3233
override fun onCreate(savedInstanceState: Bundle?) {
3334
super.onCreate(savedInstanceState)
34-
setContentView(R.layout.test_layout)
35-
}
36-
37-
private fun testKotlinTwo() {
38-
35+
// @see: https://github.com/android/compose-samples
36+
// setContent {
37+
//
38+
// }
3939
}
4040
}
41-
42-
fun <T> List<T>.secondOrNull(): T? = if (this.size > 1) this[1] else null
43-
44-
val numbers = listOf(1, 2, 3)
45-
val secondNumber = numbers.secondOrNull() // Type inferred as Int?
46-

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ plugins {
88
alias(libs.plugins.android.application) apply false
99
alias(libs.plugins.kotlin.ksp) apply false
1010
alias(libs.plugins.kotlin.android) apply false
11-
// alias(libs.plugins.kotlin.compose.compiler) apply false
11+
alias(libs.plugins.kotlin.compose.compiler) apply false
1212
alias(libs.plugins.kotlin.parcelize) apply false
1313
}

gradle/libs.versions.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ androidGradlePlugin = "8.5.1"
3434
[libraries]
3535
# kotlin dependencies ---
3636
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
37-
kotlin-compose-compiler-plugin-embeddable = { module = "org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable", version.ref = "kotlin" }
38-
kotlin-compose-compiler-plugin = { module = "org.jetbrains.kotlin:kotlin-compose-compiler-plugin", version.ref = "kotlin" }
3937
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinCoroutines" }
4038

4139
# main module dependencies: android related ---

0 commit comments

Comments
 (0)