Fixed warnings

pull/199/head
M66B 4 years ago
parent f186c2b37b
commit fae255bc3e

@ -39,7 +39,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.Paint;
@ -6580,9 +6579,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (language != null) {
TextView tv = view.findViewById(android.R.id.text1);
Resources res = context.getResources();
Drawable icon = res.getDrawable(language.icon);
int iconSize = res.getDimensionPixelSize(R.dimen.menu_item_icon_size);
Drawable icon = context.getDrawable(language.icon);
int iconSize = context.getResources()
.getDimensionPixelSize(R.dimen.menu_item_icon_size);
icon.setBounds(0, 0, iconSize, iconSize);
ImageSpan imageSpan = new CenteredImageSpan(icon);

@ -26,7 +26,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.graphics.Paint;
@ -203,10 +202,10 @@ public class FragmentOptions extends FragmentBase {
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
tabLayout.setupWithViewPager(pager);
Resources res = getResources();
int colorAccent = Helper.resolveColor(getContext(), R.attr.colorAccent);
final Context context = getContext();
int colorAccent = Helper.resolveColor(context, R.attr.colorAccent);
for (int i = 0; i < tabLayout.getTabCount(); i++) {
Drawable d = res.getDrawable(PAGE_ICONS[i]);
Drawable d = context.getDrawable(PAGE_ICONS[i]);
d.setColorFilter(colorAccent, PorterDuff.Mode.SRC_ATOP);
SpannableStringBuilder title = new SpannableStringBuilder(getString(PAGE_TITLES[i]));
if (i > 0)

Loading…
Cancel
Save