update shortcut overrides and other code changes
This commit is contained in:
parent
fc6a71b2c0
commit
d8d5b97d4b
29 changed files with 55 additions and 51 deletions
|
|
@ -18,17 +18,16 @@ import com.dkanada.gramophone.util.PreferenceUtil;
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
public final class AppShortcutIconGenerator {
|
||||
|
||||
public static Icon generateThemedIcon(Context context, int iconId) {
|
||||
if (PreferenceUtil.getInstance(context).getColoredShortcuts()) {
|
||||
return generateUserThemedIcon(context, iconId).toIcon();
|
||||
return generateUserThemedIcon(context, iconId).toIcon(context);
|
||||
} else {
|
||||
return generateDefaultThemedIcon(context, iconId).toIcon();
|
||||
return generateDefaultThemedIcon(context, iconId).toIcon(context);
|
||||
}
|
||||
}
|
||||
|
||||
private static IconCompat generateDefaultThemedIcon(Context context, int iconId) {
|
||||
// Return an Icon of iconId with default colors
|
||||
// return icon of iconId with default colors
|
||||
return generateThemedIcon(context, iconId,
|
||||
context.getColor(R.color.app_shortcut_default_foreground),
|
||||
context.getColor(R.color.app_shortcut_default_background)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public final class FrequentShortcutType extends BaseShortcutType {
|
|||
return PREFIX + ".frequent";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortcutInfo getShortcutInfo() {
|
||||
return new ShortcutInfo.Builder(context, getId())
|
||||
.setShortLabel(context.getString(R.string.my_top_tracks))
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public final class LatestShortcutType extends BaseShortcutType {
|
|||
return PREFIX + ".latest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortcutInfo getShortcutInfo() {
|
||||
return new ShortcutInfo.Builder(context, getId())
|
||||
.setShortLabel(context.getString(R.string.last_added))
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public final class ShuffleShortcutType extends BaseShortcutType {
|
|||
return PREFIX + ".shuffle";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortcutInfo getShortcutInfo() {
|
||||
return new ShortcutInfo.Builder(context, getId())
|
||||
.setShortLabel(context.getString(R.string.action_shuffle))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue