Skip to content

Commit d982875

Browse files
authored
feat(UI): migrate to Material Design 3 (#91)
* feat(UI): migrate to Material Design 3 * feat(UI): migrate to Material Design 3 * feat(UI): migrate to Material Design 3 * feat(UI): migrate to Material Design 3 * feat(UI): migrate to Material Design 3 * feat(UI): migrate to Material Design 3 * feat(UI): migrate to Material Design 3 * feat(UI): migrate to Material Design 3
1 parent df1479f commit d982875

File tree

22 files changed

+207
-55
lines changed

22 files changed

+207
-55
lines changed

.editorconfig

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
root = true
22

33
[*]
4-
indent_size=2
5-
end_of_line=lf
6-
charset=utf-8
7-
trim_trailing_whitespace=true
8-
insert_final_newline=true
4+
indent_size = 2
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
99

1010
[*.{kt,kts}]
11-
ij_kotlin_imports_layout=*
11+
ij_kotlin_imports_layout = *
12+
13+
[*.xml]
14+
indent_size = 4

.idea/compiler.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ dependencies {
6666

6767
implementation(deps.coroutines.android)
6868
implementation(deps.koin.android)
69+
implementation(deps.androidx.material)
6970

7071
debugImplementation(deps.squareup.leakCanary)
7172
implementation(deps.timber)

app/src/main/java/com/hoc/flowmvi/App.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.hoc.flowmvi
22

33
import android.app.Application
4+
import com.google.android.material.color.DynamicColors
45
import com.hoc.flowmvi.core.coreModule
56
import com.hoc.flowmvi.data.dataModule
67
import com.hoc.flowmvi.domain.domainModule
@@ -20,6 +21,7 @@ import kotlin.time.ExperimentalTime
2021
@ExperimentalCoroutinesApi
2122
@ExperimentalStdlibApi
2223
@ExperimentalTime
24+
@JvmField
2325
val allModules = listOf(
2426
coreModule,
2527
dataModule,
@@ -38,6 +40,8 @@ class App : Application() {
3840
override fun onCreate() {
3941
super.onCreate()
4042

43+
DynamicColors.applyToActivitiesIfAvailable(this)
44+
4145
if (BuildConfig.DEBUG) {
4246
Timber.plant(Timber.DebugTree())
4347
} else {

buildSrc/src/main/kotlin/deps.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object deps {
3232
const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.1"
3333
const val recyclerView = "androidx.recyclerview:recyclerview:1.2.1"
3434
const val swipeRefreshLayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01"
35-
const val material = "com.google.android.material:material:1.4.0"
35+
const val material = "com.google.android.material:material:1.6.0-alpha02"
3636
}
3737

3838
object lifecycle {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.hoc.flowmvi.core_ui
2+
3+
import android.content.Context
4+
import android.widget.Toast
5+
import androidx.annotation.Px
6+
7+
@Suppress("NOTHING_TO_INLINE")
8+
inline fun Context.toast(text: CharSequence) = Toast.makeText(this, text, Toast.LENGTH_SHORT).show()
9+
10+
@Px
11+
@Suppress("NOTHING_TO_INLINE")
12+
inline fun Context.dpToPx(dp: Float): Int = (dp * resources.displayMetrics.density).toInt()

core-ui/src/main/java/com/hoc/flowmvi/core_ui/FlowBinding.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package com.hoc.flowmvi.core_ui
22

3-
import android.content.Context
43
import android.os.Looper
54
import android.view.View
65
import android.widget.EditText
7-
import android.widget.Toast
86
import androidx.annotation.CheckResult
97
import androidx.appcompat.widget.SearchView
108
import androidx.core.widget.doOnTextChanged
@@ -121,5 +119,3 @@ fun EditText.textChanges(): Flow<CharSequence?> {
121119
awaitClose { removeTextChangedListener(listener) }
122120
}.onStart { emit(text) }
123121
}
124-
125-
fun Context.toast(text: CharSequence) = Toast.makeText(this, text, Toast.LENGTH_SHORT).show()

0 commit comments

Comments
 (0)