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 34a873884d
)
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.accessibility;
|
package com.android.settings.accessibility;
|
||||||
|
|
||||||
|
import static com.android.settings.Utils.isNightMode;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.content.res.Resources;
|
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_width),
|
||||||
res.getDimensionPixelSize(R.dimen.balance_seekbar_center_marker_height));
|
res.getDimensionPixelSize(R.dimen.balance_seekbar_center_marker_height));
|
||||||
mCenterMarkerPaint = new Paint();
|
mCenterMarkerPaint = new Paint();
|
||||||
// TODO use a more suitable colour?
|
mCenterMarkerPaint.setColor(isNightMode(context) ? Color.WHITE : Color.BLACK);
|
||||||
mCenterMarkerPaint.setColor(Color.BLACK);
|
|
||||||
mCenterMarkerPaint.setStyle(Paint.Style.FILL);
|
mCenterMarkerPaint.setStyle(Paint.Style.FILL);
|
||||||
// Remove the progress colour
|
// Remove the progress colour
|
||||||
setProgressTintList(ColorStateList.valueOf(Color.TRANSPARENT));
|
setProgressTintList(ColorStateList.valueOf(Color.TRANSPARENT));
|
||||||
|
Reference in New Issue
Block a user