make Anti-Features list in App Details clickable
This should provide some more info about each anti-feature.
This commit is contained in:
parent
3a5ecc5e8e
commit
e76aa0390d
@ -450,19 +450,24 @@ public class AppDetailsRecyclerViewAdapter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (app.antiFeatures != null) {
|
if (app.antiFeatures != null && app.antiFeatures.length > 0) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("<ul>");
|
||||||
for (String af : app.antiFeatures) {
|
for (String af : app.antiFeatures) {
|
||||||
String afdesc = descAntiFeature(af);
|
String afdesc = descAntiFeature(af);
|
||||||
sb.append("\t• ").append(afdesc).append('\n');
|
sb.append("<li><a href=\"https://f-droid.org/wiki/page/Antifeature:")
|
||||||
|
.append(af)
|
||||||
|
.append("\">")
|
||||||
|
.append(afdesc)
|
||||||
|
.append("</a></li>");
|
||||||
}
|
}
|
||||||
if (sb.length() > 0) {
|
sb.append("</ul>");
|
||||||
sb.setLength(sb.length() - 1);
|
antiFeaturesView.setText(Html.fromHtml(sb.toString()));
|
||||||
antiFeaturesView.setText(sb.toString());
|
antiFeaturesView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
} else {
|
} else {
|
||||||
antiFeaturesView.setVisibility(View.GONE);
|
antiFeaturesView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
updateAntiFeaturesWarning();
|
updateAntiFeaturesWarning();
|
||||||
buttonSecondaryView.setText(R.string.menu_uninstall);
|
buttonSecondaryView.setText(R.string.menu_uninstall);
|
||||||
buttonSecondaryView.setVisibility(app.isUninstallable(context) ? View.VISIBLE : View.INVISIBLE);
|
buttonSecondaryView.setVisibility(app.isUninstallable(context) ? View.VISIBLE : View.INVISIBLE);
|
||||||
@ -664,7 +669,8 @@ public class AppDetailsRecyclerViewAdapter
|
|||||||
contentView = (LinearLayout) view.findViewById(R.id.ll_content);
|
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
|
* Depending on whether we are expanded or not, update the icon which indicates whether the
|
||||||
@ -694,7 +700,8 @@ public class AppDetailsRecyclerViewAdapter
|
|||||||
updateExpandableItem(showVersions);
|
updateExpandableItem(showVersions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected @DrawableRes int getIcon() {
|
@DrawableRes
|
||||||
|
protected int getIcon() {
|
||||||
return R.drawable.ic_access_time_24dp_grey600;
|
return R.drawable.ic_access_time_24dp_grey600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -794,7 +801,8 @@ public class AppDetailsRecyclerViewAdapter
|
|||||||
contentView.addView(perms.getPermissionsView(AppSecurityPermissions.WHICH_ALL));
|
contentView.addView(perms.getPermissionsView(AppSecurityPermissions.WHICH_ALL));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected @DrawableRes int getIcon() {
|
@DrawableRes
|
||||||
|
protected int getIcon() {
|
||||||
return R.drawable.ic_lock_24dp_grey600;
|
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;
|
return R.drawable.ic_website;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user