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

Commit 22ed240a authored by Peter_Liang's avatar Peter_Liang
Browse files

Fix the dark theme obscures the center marker of audio balance slider.

Root Cause:
The color of center marker is wrong.

Next:
The color of center marker is white when dark theme is enabled; Otherwise, it's black.

Bug: 159028208
Test: manual test & make RunSettingsRoboTests ROBOTEST_FILTER=BalanceSeekBarPreferenceTest & make RunSettingsRoboTests ROBOTEST_FILTER=BalanceSeekBarTest
Change-Id: Id2d548778d1275709448f4c009a8469216950d8c
Merged-In: Id2d548778d1275709448f4c009a8469216950d8c
(cherry picked from commit 34a87388)
parent 481816a9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settings.accessibility;

import static com.android.settings.Utils.isNightMode;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
@@ -113,8 +115,7 @@ public class BalanceSeekBar extends SeekBar {
                res.getDimensionPixelSize(R.dimen.balance_seekbar_center_marker_width),
                res.getDimensionPixelSize(R.dimen.balance_seekbar_center_marker_height));
        mCenterMarkerPaint = new Paint();
        // TODO use a more suitable colour?
        mCenterMarkerPaint.setColor(Color.BLACK);
        mCenterMarkerPaint.setColor(isNightMode(context) ? Color.WHITE : Color.BLACK);
        mCenterMarkerPaint.setStyle(Paint.Style.FILL);
        // Remove the progress colour
        setProgressTintList(ColorStateList.valueOf(Color.TRANSPARENT));