mirror of https://github.com/M66B/NetGuard.git
Fixed pro icon theming
This commit is contained in:
parent
9f053d196b
commit
85c6b4eb2d
|
@ -704,8 +704,10 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
|
||||
private void markPro(MenuItem menu, String sku) {
|
||||
if (sku == null || !IAB.isPurchased(sku, this)) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
boolean dark = prefs.getBoolean("dark_theme", false);
|
||||
SpannableStringBuilder ssb = new SpannableStringBuilder(" " + menu.getTitle());
|
||||
ssb.setSpan(new ImageSpan(this, R.drawable.ic_shopping_cart_white_24dp), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ssb.setSpan(new ImageSpan(this, dark ? R.drawable.ic_shopping_cart_white_24dp : R.drawable.ic_shopping_cart_black_24dp), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
menu.setTitle(ssb);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -841,8 +841,10 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
|||
|
||||
private void markPro(Preference pref, String sku) {
|
||||
if (sku == null || !IAB.isPurchased(sku, this)) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
boolean dark = prefs.getBoolean("dark_theme", false);
|
||||
SpannableStringBuilder ssb = new SpannableStringBuilder(" " + pref.getTitle());
|
||||
ssb.setSpan(new ImageSpan(this, R.drawable.ic_shopping_cart_white_24dp), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ssb.setSpan(new ImageSpan(this, dark ? R.drawable.ic_shopping_cart_white_24dp : R.drawable.ic_shopping_cart_black_24dp), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
pref.setTitle(ssb);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -668,8 +668,10 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> im
|
|||
|
||||
private void markPro(MenuItem menu, String sku) {
|
||||
if (sku == null || !IAB.isPurchased(sku, context)) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean dark = prefs.getBoolean("dark_theme", false);
|
||||
SpannableStringBuilder ssb = new SpannableStringBuilder(" " + menu.getTitle());
|
||||
ssb.setSpan(new ImageSpan(context, R.drawable.ic_shopping_cart_white_24dp), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ssb.setSpan(new ImageSpan(context, dark ? R.drawable.ic_shopping_cart_white_24dp : R.drawable.ic_shopping_cart_black_24dp), 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
menu.setTitle(ssb);
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 317 B |
Binary file not shown.
After Width: | Height: | Size: 215 B |
Binary file not shown.
After Width: | Height: | Size: 375 B |
Binary file not shown.
After Width: | Height: | Size: 519 B |
Binary file not shown.
After Width: | Height: | Size: 672 B |
Loading…
Reference in New Issue