Cherish: add more FOD icons [2/2]

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Laker
2021-02-07 20:02:55 +03:00
committed by Hưng Phan
parent 38f2036356
commit f75f9eea7a
4 changed files with 55 additions and 2 deletions

View File

@@ -71,6 +71,8 @@ public class FODIconPicker extends LayoutPreference {
private static ImageButton Button23;
private static ImageButton Button24;
private static ImageButton Button25;
private static ImageButton Button26;
private static ImageButton Button27;
private static final String TAG = "FODIconPicker";
@@ -136,6 +138,8 @@ public class FODIconPicker extends LayoutPreference {
Button23 = findViewById(R.id.fodicon23_button);
Button24 = findViewById(R.id.fodicon24_button);
Button25 = findViewById(R.id.fodicon25_button);
Button26 = findViewById(R.id.fodicon26_button);
Button27 = findViewById(R.id.fodicon27_button);
int defaultfodicon = Settings.System.getInt(
context.getContentResolver(), Settings.System.FOD_ICON, 0);
@@ -191,6 +195,10 @@ public class FODIconPicker extends LayoutPreference {
updateHighlightedItem(Button24, context);
} else if (defaultfodicon == 25) {
updateHighlightedItem(Button25, context);
} else if (defaultfodicon == 26) {
updateHighlightedItem(Button25, context);
} else if (defaultfodicon == 27) {
updateHighlightedItem(Button25, context);
}
Button0.setOnClickListener(new View.OnClickListener() {
@@ -375,6 +383,20 @@ public class FODIconPicker extends LayoutPreference {
updateHighlightedItem(Button25, context);
}
});
Button26.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updateSettings(26, context);
updateHighlightedItem(Button26, context);
}
});
Button27.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updateSettings(27, context);
updateHighlightedItem(Button27, context);
}
});
}
private void updateSettings(int fodicon, Context context) {
@@ -410,6 +432,8 @@ public class FODIconPicker extends LayoutPreference {
Button23.setBackgroundTintList(defaulttint);
Button24.setBackgroundTintList(defaulttint);
Button25.setBackgroundTintList(defaulttint);
Button26.setBackgroundTintList(defaulttint);
Button27.setBackgroundTintList(defaulttint);
activebutton.setBackgroundTintList(Utils.getColorAttr(getContext(), android.R.attr.colorAccent));
}
}