Skip to content

Commit a86079e

Browse files
committed
feat(UI): migrate to Material Design 3
1 parent df8f39c commit a86079e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ package com.hoc.flowmvi.core_ui
22

33
import android.content.Context
44
import android.widget.Toast
5+
import androidx.annotation.Px
56

67
@Suppress("NOTHING_TO_INLINE")
78
inline fun Context.toast(text: CharSequence) = Toast.makeText(this, text, Toast.LENGTH_SHORT).show()
89

10+
@Px
911
@Suppress("NOTHING_TO_INLINE")
10-
inline fun Context.dpToPx(dp: Int): Int = (dp * resources.displayMetrics.density).toInt()
12+
inline fun Context.dpToPx(dp: Float): Int = (dp * resources.displayMetrics.density).toInt()

core-ui/src/main/res/values/colors.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<color name="md_theme_light_onSurface">#1C1B1F</color>
2222
<color name="md_theme_light_surfaceVariant">#E7E0EC</color>
2323
<color name="md_theme_light_onSurfaceVariant">#49454F</color>
24-
<color name="md_theme_light_outline">#79747E</color>
24+
<color name="md_theme_light_outline">#9A989C</color>
2525
<color name="md_theme_light_inverseOnSurface">#F4EFF4</color>
2626
<color name="md_theme_light_inverseSurface">#313033</color>
2727
<color name="md_theme_light_primaryInverse">#D0BCFF</color>
@@ -48,7 +48,7 @@
4848
<color name="md_theme_dark_onSurface">#E6E1E5</color>
4949
<color name="md_theme_dark_surfaceVariant">#49454F</color>
5050
<color name="md_theme_dark_onSurfaceVariant">#CAC4D0</color>
51-
<color name="md_theme_dark_outline">#938F99</color>
51+
<color name="md_theme_dark_outline">#6D6775</color>
5252
<color name="md_theme_dark_inverseOnSurface">#1C1B1F</color>
5353
<color name="md_theme_dark_inverseSurface">#E6E1E5</color>
5454
<color name="md_theme_dark_primaryInverse">#6750A4</color>

feature-main/src/main/java/com/hoc/flowmvi/ui/main/MainActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ class MainActivity :
6565
adapter = userAdapter
6666
addItemDecoration(
6767
MaterialDividerItemDecoration(context, RecyclerView.VERTICAL).apply {
68-
dividerInsetStart = dpToPx(8)
69-
dividerInsetEnd = dpToPx(8)
68+
dividerInsetStart = dpToPx(8f)
69+
dividerInsetEnd = dpToPx(8f)
7070
isLastItemDecorated = false
71+
dividerThickness = dpToPx(0.8f)
7172
}
7273
)
7374

0 commit comments

Comments
 (0)