Commit 881a7e59 authored by Hans-Christoph Steiner's avatar Hans-Christoph Steiner

Merge branch 'fix_null_icons_in_list' into 'master'

Fix displaying default icon for apps without icons

See merge request !868
parents 5de957de 827e2b2e
Pipeline #111867135 passed with stages
in 32 minutes and 7 seconds
......@@ -28,9 +28,11 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import org.fdroid.fdroid.AppUpdateStatusManager;
import org.fdroid.fdroid.AppUpdateStatusManager.AppUpdateStatus;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.Utils;
......@@ -191,7 +193,10 @@ public abstract class AppListItemController extends RecyclerView.ViewHolder {
try {
icon.setImageDrawable(activity.getPackageManager().getApplicationIcon(app.packageName));
} catch (PackageManager.NameNotFoundException e) {
// ignored
DisplayImageOptions options = Utils.getRepoAppDisplayImageOptions();
icon.setImageDrawable(options.shouldShowImageForEmptyUri()
? options.getImageForEmptyUri(FDroidApp.getInstance().getResources())
: null);
}
} else {
ImageLoader.getInstance().displayImage(app.iconUrl, icon, Utils.getRepoAppDisplayImageOptions());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment