Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1b28cd0 authored by Catherine Liang's avatar Catherine Liang
Browse files

Update color options

Maintain the same color option previews with and without flag for better
continuity.

Flag: com.android.systemui.shared.new_customization_picker_ui
Bug: 404264657
Bug: 402736525
Test: manually verified
Change-Id: I0ae59acff5ec840a3cf3163ca953bedfafad4b0a
parent 47e854d5
Loading
Loading
Loading
Loading
+2 −26
Original line number Diff line number Diff line
@@ -319,20 +319,6 @@ class ColorProvider(private val context: Context, stubPackageName: String) :
        return intArrayOf(colors[0], colors[1], colors[0], colors[1])
    }

    /**
     * Returns the preview of a preset ColorScheme based on this order: top left, top right, bottom
     * left, bottom right
     */
    private fun getFixedPresetColorPreview(colorScheme: ColorScheme, seed: Int): IntArray {
        val colors =
            when (colorScheme.style) {
                Style.FRUIT_SALAD -> intArrayOf(colorScheme.accent3.s100, colorScheme.accent1.s200)
                Style.RAINBOW -> intArrayOf(colorScheme.accent1.s200, colorScheme.accent1.s200)
                else -> intArrayOf(seed, seed)
            }
        return intArrayOf(colors[0], colors[1], colors[0], colors[1])
    }

    /**
     * Returns the light theme contrast-adjusted preview of a preset ColorScheme, based on this
     * order: top left, top right, bottom left, bottom right
@@ -457,18 +443,8 @@ class ColorProvider(private val context: Context, stubPackageName: String) :
                    lightColors = getLightMonochromePreview(lightColorScheme)
                }
                else -> {
                    darkColors =
                        if (isNewPickerUi) {
                            getFixedPresetColorPreview(darkColorScheme, colorFromStub)
                        } else {
                            getDarkPresetColorPreview(darkColorScheme)
                        }
                    lightColors =
                        if (isNewPickerUi) {
                            getFixedPresetColorPreview(lightColorScheme, colorFromStub)
                        } else {
                            getLightPresetColorPreview(lightColorScheme)
                        }
                    darkColors = getDarkPresetColorPreview(darkColorScheme)
                    lightColors = getLightPresetColorPreview(lightColorScheme)
                }
            }
        }