Fixed pro icon theming

This commit is contained in:
M66B 2016-10-06 13:57:07 +02:00
parent 9f053d196b
commit 85c6b4eb2d
8 changed files with 9 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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