Skip to content

Commit

Permalink
Fix legacy and m3 theme arrangement for pickers
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzsout committed Sep 23, 2024
1 parent f65fde2 commit 5c45f05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion app/src/main/java/com/ivy/wallet/RootActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.google.android.material.timepicker.MaterialTimePicker
import com.google.android.material.timepicker.TimeFormat
import com.google.android.play.core.review.ReviewManagerFactory
import com.ivy.IvyNavGraph
import com.ivy.base.legacy.Theme
import com.ivy.base.time.TimeConverter
import com.ivy.base.time.TimeProvider
import com.ivy.design.api.IvyUI
Expand Down Expand Up @@ -157,7 +158,10 @@ class RootActivity : AppCompatActivity(), RootScreen {
}
}

dateTimePicker.Content()
dateTimePicker.Content(
isDark = appDesign(ivyContext).context().theme != Theme.LIGHT && isSystemInDarkTheme,
isTrueBlack = appDesign(ivyContext).context().theme == Theme.AMOLED_DARK
)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.ivy.design.system

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import com.ivy.design.system.colors.IvyColors

@Composable
fun IvyMaterial3Theme(
dark: Boolean,
isTrueBlack: Boolean,
dark: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
) {
MaterialTheme(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import java.time.LocalTime
@Stable
interface DateTimePicker {
@Composable
fun Content()
fun Content(isDark: Boolean, isTrueBlack: Boolean)

fun pickDate(
initialDate: Instant?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ object UI {
fun IvyTheme(
theme: Theme,
design: IvyDesign,
isDarkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
) {
val colors = design.colors(theme, isSystemInDarkTheme())
val colors = design.colors(theme, isDarkTheme)
val typography = design.typography()
val shapes = design.shapes()

Expand Down

0 comments on commit 5c45f05

Please sign in to comment.