Skip to content

Commit

Permalink
refactor: m3
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhyo committed Apr 17, 2024
1 parent 756ee2b commit 0fba091
Show file tree
Hide file tree
Showing 87 changed files with 2,097 additions and 809 deletions.
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Breaking Bad - Jetpack Compose
<a href='https://developer.android.com'><img src='http://img.shields.io/badge/platform-android-green.svg'/></a>
<a href="https://kotlinlang.org/docs/whatsnew1920.html"><img src = "https://shields.io/badge/kotlin-1.9.20-blue" /></a>
<a href="https://developer.android.com/jetpack/compose/bom"><img src = "https://img.shields.io/badge/jetpack%20compose-2023.10.01-brightgreen" /></a>
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"/></a>
[![ktlint](https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg)](https://ktlint.github.io/)

<p >
<img src="/gif/0.gif" width="32%"/>
<img src="/gif/1.gif" width="32%"/>
<img src="/gif/2.gif" width="32%"/>
<h1 align="center">Breaking Bad - Jetpack Compose</h1>

<p align="center">
<a href='https://developer.android.com'><img src='http://img.shields.io/badge/platform-android-green.svg'/></a>
<a href="https://kotlinlang.org/docs/whatsnew1920.html"><img src = "https://shields.io/badge/kotlin-1.9.23-blue" /></a>
<a href="https://developer.android.com/jetpack/compose/bom"><img src = "https://img.shields.io/badge/jetpack%20compose-2024.04.00-brightgreen" /></a>
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"/></a>
</p>

<p align="center">
<img src="/gif/0.gif" width="32%"/>
<img src="/gif/1.gif" width="32%"/>
<img src="/gif/2.gif" width="32%"/>
</p>

## Tech Stack

- [Jetpack](https://developer.android.com/jetpack)
- Compose - Define your UI programmatically with composable functions that describe its shape
and data dependencies.
Expand All @@ -24,18 +27,36 @@
- Clean Architecture (nowinandroid)
- MVVM pattern
- Kotlin Coroutines & Flows
- Material Design3
- Material Design 3
- Single Activity
- StaggeredVerticalGrid
- [Gradle Version Catalog](https://docs.gradle.org/7.4/userguide/platforms.html)
- [Retrofit2](https://github.com/square/retrofit)
- [Coil-Compose](https://coil-kt.github.io/coil/compose)
- [Timber](https://github.com/JakeWharton/timber)

## Multi Module ([nowinandroid](https://github.com/android/nowinandroid))
![](project.dot.png)
## Multi Module
```
├── app
├── core
│   ├── common
│   ├── data
│   ├── database
│   ├── datastore
│   ├── designsystem
│   ├── domain
│   ├── model
│   └── network
└── feature
   ├── bottombar
   ├── detail
   ├── favorite
   ├── list
   ├── main
   └── setting
```

### If you think this reposittory is useful, please press the star button at the top. ⭐️
![](project.dot.png)

# License

Expand Down
15 changes: 1 addition & 14 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,9 @@ android {
}

dependencies {

implementation(project(":core:data"))
implementation(project(":core:designsystem"))

implementation(project(":feature:list"))
implementation(project(":feature:favorite"))
implementation(project(":feature:detail"))
implementation(project(":feature:main"))

implementation(libs.androidx.startup)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity.compose)

implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.hilt.navigation.compose)

implementation(libs.androidx.compose.material3)

implementation(libs.timber)
}
17 changes: 4 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,25 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".app.BrBaApplication"
android:allowBackup="true"
android:name=".BrBaApplication"
android:enableOnBackInvokedCallback="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:enableOnBackInvokedCallback="true"
android:theme="@style/Theme.BrBaCompose">
<activity
android:name=".app.MainActivity"
android:exported="true"
android:theme="@style/Theme.BrBaCompose.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="io.github.shinhyo.brba.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="io.github.shinhyo.brba.app.initializer.TimberInitializer"
android:name="io.github.shinhyo.brba.initializer.TimberInitializer"
android:value="androidx.startup" />
</provider>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.shinhyo.brba.app
package io.github.shinhyo.brba

import android.app.Application
import dagger.hilt.android.HiltAndroidApp
Expand Down
40 changes: 0 additions & 40 deletions app/src/main/java/io/github/shinhyo/brba/app/MainActivity.kt

This file was deleted.

85 changes: 0 additions & 85 deletions app/src/main/java/io/github/shinhyo/brba/app/ui/main/MainScreen.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.shinhyo.brba.app.initializer
package io.github.shinhyo.brba.initializer

import android.content.Context
import androidx.startup.Initializer
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>

<style name="Theme.BrBaCompose" parent="android:Theme.Material.NoActionBar" />

</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="immersive_sys_ui">#33000000</color>
</resources>
12 changes: 1 addition & 11 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<resources>
<!-- Base application theme. -->
<style name="Theme.BrBaCompose" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@color/immersive_sys_ui</item>
</style>

<style name="Theme.BrBaCompose.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.BrBaCompose" parent="android:Theme.Material.Light.NoActionBar" />

<style name="Theme.BrBaCompose.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="Theme.BrBaCompose.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ androidExtension.apply {

dependencies {
add("implementation", project(":core:model"))
add("implementation", project(":core:ui"))
add("implementation", project(":core:designsystem"))
add("implementation", project(":core:common"))
add("implementation", project(":core:domain"))
Expand All @@ -19,7 +18,7 @@ androidExtension.apply {
add("implementation", findLibrary("androidx.constraintlayout.compose"))
add("implementation", findLibrary("androidx.compose.material3"))
add("implementation", findLibrary("androidx.compose.material.iconsExtended"))

add("implementation", findLibrary("haze"))

add("implementation", findLibrary("androidx.navigation.compose"))
add("implementation", findLibrary("androidx.hilt.navigation.compose"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.getByType

internal val Project.applicationExtension: CommonExtension<*, *, *, *, *>
internal val Project.applicationExtension: CommonExtension<*, *, *, *, *, *>
get() = extensions.getByType<ApplicationExtension>()

internal val Project.libraryExtension: CommonExtension<*, *, *, *, *>
internal val Project.libraryExtension: CommonExtension<*, *, *, *, *, *>
get() = extensions.getByType<LibraryExtension>()

internal val Project.androidExtension: CommonExtension<*, *, *, *, *>
internal val Project.androidExtension: CommonExtension<*, *, *, *, *, *>
get() = runCatching { libraryExtension }
.recoverCatching { applicationExtension }
.onFailure { println("Could not find Library or Application extension from this project") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package io.github.shinhyo.brba.buildlogic
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand Down Expand Up @@ -32,12 +31,16 @@ private fun Project.configureKotlin() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
val warningsAsErrors: String? by project
allWarningsAsErrors = warningsAsErrors.toBoolean()
allWarningsAsErrors = properties["warningsAsErrors"] as? Boolean ?: false
compilerOptions.freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:experimentalStrongSkipping=true",
)
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
)
}
}
Expand Down
1 change: 1 addition & 0 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ dependencies {
implementation(project(":core:domain"))
implementation(project(":core:model"))
implementation(project(":core:database"))
implementation(project(":core:datastore"))
implementation(project(":core:network"))
}
Loading

0 comments on commit 0fba091

Please sign in to comment.