From e76aa0390d9db4d98a7c46026db796b8f10388ec Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 25 Apr 2018 17:28:43 +0200 Subject: [PATCH] make Anti-Features list in App Details clickable This should provide some more info about each anti-feature. --- .../views/AppDetailsRecyclerViewAdapter.java | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java index 12ffd19bc..dd5bf1df3 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java +++ b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java @@ -450,19 +450,24 @@ public class AppDetailsRecyclerViewAdapter } } }); - if (app.antiFeatures != null) { + if (app.antiFeatures != null && app.antiFeatures.length > 0) { StringBuilder sb = new StringBuilder(); + sb.append(""); + antiFeaturesView.setText(Html.fromHtml(sb.toString())); + antiFeaturesView.setMovementMethod(LinkMovementMethod.getInstance()); + } else { + antiFeaturesView.setVisibility(View.GONE); } + updateAntiFeaturesWarning(); buttonSecondaryView.setText(R.string.menu_uninstall); buttonSecondaryView.setVisibility(app.isUninstallable(context) ? View.VISIBLE : View.INVISIBLE); @@ -664,7 +669,8 @@ public class AppDetailsRecyclerViewAdapter contentView = (LinearLayout) view.findViewById(R.id.ll_content); } - protected abstract @DrawableRes int getIcon(); + @DrawableRes + protected abstract int getIcon(); /** * Depending on whether we are expanded or not, update the icon which indicates whether the @@ -694,7 +700,8 @@ public class AppDetailsRecyclerViewAdapter updateExpandableItem(showVersions); } - protected @DrawableRes int getIcon() { + @DrawableRes + protected int getIcon() { return R.drawable.ic_access_time_24dp_grey600; } } @@ -794,7 +801,8 @@ public class AppDetailsRecyclerViewAdapter contentView.addView(perms.getPermissionsView(AppSecurityPermissions.WHICH_ALL)); } - protected @DrawableRes int getIcon() { + @DrawableRes + protected int getIcon() { return R.drawable.ic_lock_24dp_grey600; } } @@ -867,7 +875,8 @@ public class AppDetailsRecyclerViewAdapter } } - protected @DrawableRes int getIcon() { + @DrawableRes + protected int getIcon() { return R.drawable.ic_website; } }