Fix default widget background (#6494)
This commit is contained in:
parent
3da7fcf8f0
commit
7d1259a39a
@ -97,7 +97,7 @@ public class WidgetConfigActivity extends AppCompatActivity {
|
|||||||
ckFastForward.setChecked(prefs.getBoolean(PlayerWidget.KEY_WIDGET_FAST_FORWARD + appWidgetId, false));
|
ckFastForward.setChecked(prefs.getBoolean(PlayerWidget.KEY_WIDGET_FAST_FORWARD + appWidgetId, false));
|
||||||
ckSkip.setChecked(prefs.getBoolean(PlayerWidget.KEY_WIDGET_SKIP + appWidgetId, false));
|
ckSkip.setChecked(prefs.getBoolean(PlayerWidget.KEY_WIDGET_SKIP + appWidgetId, false));
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
int color = prefs.getInt(PlayerWidget.KEY_WIDGET_COLOR + appWidgetId, 0);
|
int color = prefs.getInt(PlayerWidget.KEY_WIDGET_COLOR + appWidgetId, PlayerWidget.DEFAULT_COLOR);
|
||||||
int opacity = Color.alpha(color) * 100 / 0xFF;
|
int opacity = Color.alpha(color) * 100 / 0xFF;
|
||||||
|
|
||||||
opacitySeekBar.setProgress(opacity, false);
|
opacitySeekBar.setProgress(opacity, false);
|
||||||
@ -139,6 +139,6 @@ public class WidgetConfigActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getColorWithAlpha(int color, int opacity) {
|
private int getColorWithAlpha(int color, int opacity) {
|
||||||
return (int) Math.round(0xFF * (0.01 * opacity)) * 0x1000000 + color;
|
return (int) Math.round(0xFF * (0.01 * opacity)) * 0x1000000 + (color & 0xffffff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public class PlayerWidget extends AppWidgetProvider {
|
|||||||
public static final String KEY_WIDGET_SKIP = "widget_skip";
|
public static final String KEY_WIDGET_SKIP = "widget_skip";
|
||||||
public static final String KEY_WIDGET_FAST_FORWARD = "widget_fast_forward";
|
public static final String KEY_WIDGET_FAST_FORWARD = "widget_fast_forward";
|
||||||
public static final String KEY_WIDGET_REWIND = "widget_rewind";
|
public static final String KEY_WIDGET_REWIND = "widget_rewind";
|
||||||
public static final int DEFAULT_COLOR = 0x00262C31;
|
public static final int DEFAULT_COLOR = 0xff262C31;
|
||||||
private static final String WORKAROUND_WORK_NAME = "WidgetUpdaterWorkaround";
|
private static final String WORKAROUND_WORK_NAME = "WidgetUpdaterWorkaround";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user