Skip to content

Commit

Permalink
Adopt Ferris Wheel animation colors to different themes
Browse files Browse the repository at this point in the history
  • Loading branch information
meikpiep committed Sep 26, 2024
1 parent 4b1a8b4 commit e205069
Showing 1 changed file with 21 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,49 +58,34 @@ class FerrisWheelConfigurer(

private fun cabinColorsDark(): List<CabinStyle> =
listOf(
CabinStyle(
MaterialColors.getColor(ferrisWheel, com.google.android.material.R.attr.colorPrimaryVariant),
Color.TRANSPARENT,
),
CabinStyle(
MaterialColors.getColor(ferrisWheel, com.google.android.material.R.attr.colorSecondaryVariant),
Color.TRANSPARENT,
),
CabinStyle(
ferrisWheel.resources.getColor(R.color.gridSelected, null),
Color.TRANSPARENT,
),
cabin(com.google.android.material.R.attr.colorPrimaryVariant),
cabin(com.google.android.material.R.attr.colorSecondaryVariant),
cabinFromColor(R.color.gridSelected),
)

private fun cabinColorsLight(): List<CabinStyle> =
listOf(
CabinStyle(
ferrisWheel.resources.getColor(R.color.md_theme_light_inversePrimary, null),
Color.TRANSPARENT,
),
CabinStyle(
MaterialColors.getColor(ferrisWheel, com.google.android.material.R.attr.colorSecondaryVariant),
Color.TRANSPARENT,
),
CabinStyle(
MaterialColors.getColor(ferrisWheel, R.attr.colorMainTopPanelBackground),
Color.TRANSPARENT,
),
cabin(com.google.android.material.R.attr.colorSecondaryVariant),
cabin(R.attr.colorMainTopPanelBackground),
cabinFromColor(R.color.md_theme_light_inversePrimary),
)

private fun cabinColorsDynamic(): List<CabinStyle> =
listOf(
CabinStyle(
MaterialColors.getColor(ferrisWheel, com.google.android.material.R.attr.colorPrimaryVariant),
Color.TRANSPARENT,
),
CabinStyle(
MaterialColors.getColor(ferrisWheel, com.google.android.material.R.attr.colorSecondaryVariant),
Color.TRANSPARENT,
),
CabinStyle(
MaterialColors.getColor(ferrisWheel, R.attr.colorMainTopPanelBackground),
Color.TRANSPARENT,
),
cabin(com.google.android.material.R.attr.colorPrimaryVariant),
cabin(com.google.android.material.R.attr.colorSecondaryVariant),
cabin(R.attr.colorMainTopPanelBackground),
)

private fun cabin(attr: Int) =
CabinStyle(
MaterialColors.getColor(ferrisWheel, attr),
Color.TRANSPARENT,
)

private fun cabinFromColor(color: Int) =
CabinStyle(
ferrisWheel.resources.getColor(color, null),
Color.TRANSPARENT,
)
}

0 comments on commit e205069

Please sign in to comment.