show "Anti-features" in list view when app is filtered
closes fdroid/fdroidclient#1533
This commit is contained in:
parent
90acd75b90
commit
fe37695751
@ -4,7 +4,6 @@ import android.app.Activity;
|
|||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import org.fdroid.fdroid.AppUpdateStatusManager;
|
import org.fdroid.fdroid.AppUpdateStatusManager;
|
||||||
import org.fdroid.fdroid.R;
|
import org.fdroid.fdroid.R;
|
||||||
import org.fdroid.fdroid.data.App;
|
import org.fdroid.fdroid.data.App;
|
||||||
@ -12,9 +11,11 @@ import org.fdroid.fdroid.data.App;
|
|||||||
/**
|
/**
|
||||||
* Used for search results or for category lists.
|
* Used for search results or for category lists.
|
||||||
* Shows an inline download button, and also (if appropriate):
|
* Shows an inline download button, and also (if appropriate):
|
||||||
* * Whether the app is incompatible.
|
* <ul>
|
||||||
* * Version that app can be upgraded to.
|
* <li>Whether the app is incompatible
|
||||||
* * Installed version.
|
* <li>Version that app can be upgraded to
|
||||||
|
* <li>Installed version
|
||||||
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public class StandardAppListItemController extends AppListItemController {
|
public class StandardAppListItemController extends AppListItemController {
|
||||||
public StandardAppListItemController(Activity activity, View itemView) {
|
public StandardAppListItemController(Activity activity, View itemView) {
|
||||||
@ -35,6 +36,8 @@ public class StandardAppListItemController extends AppListItemController {
|
|||||||
private CharSequence getStatusText(@NonNull App app) {
|
private CharSequence getStatusText(@NonNull App app) {
|
||||||
if (!app.compatible) {
|
if (!app.compatible) {
|
||||||
return activity.getString(R.string.app_incompatible);
|
return activity.getString(R.string.app_incompatible);
|
||||||
|
} else if (app.isDisabledByAntiFeatures()) {
|
||||||
|
return activity.getString(R.string.antifeatures);
|
||||||
} else if (app.isInstalled(activity.getApplicationContext())) {
|
} else if (app.isInstalled(activity.getApplicationContext())) {
|
||||||
if (app.canAndWantToUpdate(activity)) {
|
if (app.canAndWantToUpdate(activity)) {
|
||||||
return activity.getString(R.string.app_version_x_available, app.getSuggestedVersionName());
|
return activity.getString(R.string.app_version_x_available, app.getSuggestedVersionName());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user