mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-18 21:47:37 -04:00
Use ContextCompat.getDrawable().
This commit is contained in:
@@ -23,6 +23,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.cursoradapter.widget.CursorAdapter;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.CursorLoader;
|
||||
@@ -147,7 +148,7 @@ public class SelectAppsView extends SwapView implements LoaderManager.LoaderCall
|
||||
|
||||
private Drawable getDefaultAppIcon(Context context) {
|
||||
if (defaultAppIcon == null) {
|
||||
defaultAppIcon = context.getResources().getDrawable(android.R.drawable.sym_def_app_icon);
|
||||
defaultAppIcon = ContextCompat.getDrawable(context, android.R.drawable.sym_def_app_icon);
|
||||
}
|
||||
return defaultAppIcon;
|
||||
}
|
||||
@@ -225,7 +226,7 @@ public class SelectAppsView extends SwapView implements LoaderManager.LoaderCall
|
||||
resource = R.drawable.ic_add_circle_outline;
|
||||
colour = 0xFFD0D0D4;
|
||||
}
|
||||
imageView.setImageDrawable(getResources().getDrawable(resource));
|
||||
imageView.setImageDrawable(ContextCompat.getDrawable(getContext(), resource));
|
||||
imageView.setColorFilter(colour, PorterDuff.Mode.MULTIPLY);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user