rename app.icon to app.iconFromApk

This makes it clearer what this is actually referring to.
This commit is contained in:
Marcus Hoffmann 2020-02-21 16:08:08 +01:00
parent a500660a41
commit 941d8a0b8b
3 changed files with 12 additions and 11 deletions

View File

@ -414,7 +414,7 @@ public final class LocalRepoManager {
tag("lastupdated", app.lastUpdated); tag("lastupdated", app.lastUpdated);
tag("name", app.name); tag("name", app.name);
tag("summary", app.summary); tag("summary", app.summary);
tag("icon", app.icon); tag("icon", app.iconFromApk);
tag("desc", app.description); tag("desc", app.description);
tag("license", "Unknown"); tag("license", "Unknown");
tag("categories", "LocalRepo," + Preferences.get().getLocalRepoName()); tag("categories", "LocalRepo," + Preferences.get().getLocalRepoName());

View File

@ -118,7 +118,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
public String name = "Unknown"; public String name = "Unknown";
public String summary = "Unknown application"; public String summary = "Unknown application";
public String icon; public String iconFromApk;
public String description; public String description;
@ -217,7 +217,8 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
public String[] requirements; public String[] requirements;
/** /**
* URL to download the app's icon. * URL to download the app's icon. (Set only from localized block, see also
* {@link #iconFromApk} and {@link #getIconUrl(Context)}
*/ */
private String iconUrl; private String iconUrl;
@ -260,7 +261,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
summary = cursor.getString(i); summary = cursor.getString(i);
break; break;
case Cols.ICON: case Cols.ICON:
icon = cursor.getString(i); iconFromApk = cursor.getString(i);
break; break;
case Cols.DESCRIPTION: case Cols.DESCRIPTION:
description = cursor.getString(i); description = cursor.getString(i);
@ -665,7 +666,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
public String getIconUrl(Context context) { public String getIconUrl(Context context) {
Repo repo = RepoProvider.Helper.findById(context, repoId); Repo repo = RepoProvider.Helper.findById(context, repoId);
if (TextUtils.isEmpty(iconUrl)) { if (TextUtils.isEmpty(iconUrl)) {
if (TextUtils.isEmpty(icon)){ if (TextUtils.isEmpty(iconFromApk)){
return null; return null;
} }
String iconsDir; String iconsDir;
@ -674,7 +675,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
} else { } else {
iconsDir = Utils.FALLBACK_ICONS_DIR; iconsDir = Utils.FALLBACK_ICONS_DIR;
} }
return repo.address + iconsDir + icon; return repo.address + iconsDir + iconFromApk;
} }
return repo.address + "/" + packageName + "/" + iconUrl; return repo.address + "/" + packageName + "/" + iconUrl;
} }
@ -779,7 +780,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
+ ", last updated on " + this.lastUpdated + ")</p>"; + ", last updated on " + this.lastUpdated + ")</p>";
this.name = (String) appInfo.loadLabel(pm); this.name = (String) appInfo.loadLabel(pm);
this.icon = getIconName(packageName, packageInfo.versionCode); this.iconFromApk = getIconName(packageName, packageInfo.versionCode);
this.installedVersionName = packageInfo.versionName; this.installedVersionName = packageInfo.versionName;
this.installedVersionCode = packageInfo.versionCode; this.installedVersionCode = packageInfo.versionCode;
this.compatible = true; this.compatible = true;
@ -966,7 +967,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
values.put(Cols.NAME, name); values.put(Cols.NAME, name);
values.put(Cols.REPO_ID, repoId); values.put(Cols.REPO_ID, repoId);
values.put(Cols.SUMMARY, summary); values.put(Cols.SUMMARY, summary);
values.put(Cols.ICON, icon); values.put(Cols.ICON, iconFromApk);
values.put(Cols.ICON_URL, iconUrl); values.put(Cols.ICON_URL, iconUrl);
values.put(Cols.DESCRIPTION, description); values.put(Cols.DESCRIPTION, description);
values.put(Cols.WHATSNEW, whatsNew); values.put(Cols.WHATSNEW, whatsNew);
@ -1196,7 +1197,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
dest.writeString(this.name); dest.writeString(this.name);
dest.writeLong(this.repoId); dest.writeLong(this.repoId);
dest.writeString(this.summary); dest.writeString(this.summary);
dest.writeString(this.icon); dest.writeString(this.iconFromApk);
dest.writeString(this.description); dest.writeString(this.description);
dest.writeString(this.whatsNew); dest.writeString(this.whatsNew);
dest.writeString(this.license); dest.writeString(this.license);
@ -1247,7 +1248,7 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
this.name = in.readString(); this.name = in.readString();
this.repoId = in.readLong(); this.repoId = in.readLong();
this.summary = in.readString(); this.summary = in.readString();
this.icon = in.readString(); this.iconFromApk = in.readString();
this.description = in.readString(); this.description = in.readString();
this.whatsNew = in.readString(); this.whatsNew = in.readString();
this.license = in.readString(); this.license = in.readString();

View File

@ -214,7 +214,7 @@ public class RepoXMLHandler extends DefaultHandler {
curapp.name = str; curapp.name = str;
break; break;
case "icon": case "icon":
curapp.icon = str; curapp.iconFromApk = str;
break; break;
case "description": case "description":
// This is the old-style description. We'll read it // This is the old-style description. We'll read it