From 1468dfd6b60ec6b32a52cd73b98a3d6ae13a52cf Mon Sep 17 00:00:00 2001 From: d8ahazard Date: Mon, 12 Sep 2016 14:33:03 -0500 Subject: [PATCH] Add CacheModule display string to title --- app/src/main/java/com/topjohnwu/magisk/ReposAdapter.java | 9 ++++++++- app/src/main/java/com/topjohnwu/magisk/module/Repo.java | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ReposAdapter.java b/app/src/main/java/com/topjohnwu/magisk/ReposAdapter.java index b14d080c8..2a1b78c0e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ReposAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/ReposAdapter.java @@ -93,8 +93,15 @@ public class ReposAdapter extends RecyclerView.Adapter private void SetupViewElements() { int mPosition = mHolder.getAdapterPosition(); + String titleString; if (repo.getId() != null) { - mHolder.title.setText(repo.getName()); + if (repo.isCacheModule()) { + titleString = "[Cache] " + repo.getName(); + } else { + titleString = repo.getName(); + } + + mHolder.title.setText(titleString); mHolder.versionName.setText(repo.getmVersion()); mHolder.description.setText(repo.getDescription()); String authorString = this.context.getResources().getString(R.string.author) + " " + repo.getmAuthor(); diff --git a/app/src/main/java/com/topjohnwu/magisk/module/Repo.java b/app/src/main/java/com/topjohnwu/magisk/module/Repo.java index 2eae521d8..1ef4a419b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/module/Repo.java +++ b/app/src/main/java/com/topjohnwu/magisk/module/Repo.java @@ -31,7 +31,7 @@ public class Repo { private String mDonateUrl; private String lastUpdate; private Context appContext; - private boolean mIsInstalled,mCanUpdate; + private boolean mIsInstalled,mCanUpdate,mIsCacheModule; public Repo(String manifestString, Context context) { @@ -133,6 +133,9 @@ public class Repo { case "donate": this.mDonateUrl = props[1]; break; + case "cacheModule": + this.mIsCacheModule = Boolean.valueOf(props[1]); + break; case "support": this.mSupportUrl = props[1]; break; @@ -261,5 +264,6 @@ public class Repo { public boolean isInstalled() { return mIsInstalled; } public boolean canUpdate() { return mCanUpdate; } + public boolean isCacheModule() { return mIsCacheModule; } }