mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-19 05:55:04 -04:00
[app] Show a warning in app details, if no compatible versions available
This commit is contained in:
@@ -574,8 +574,18 @@ public class AppDetailsRecyclerViewAdapter
|
||||
repoChooserView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (SessionInstallManager.canBeUsed(context) && suggestedApk != null
|
||||
if (suggestedApk == null && repos.size() > 1 && app.installedSigner != null && preferredRepoId != null
|
||||
&& preferredRepoId == app.repoId && !versionsLoading) {
|
||||
// current repo is preferred, app is installed, but has no suggested version from this repo
|
||||
int color = ContextCompat.getColor(context, R.color.fdroid_red);
|
||||
warningView.setBackgroundColor(color);
|
||||
warningView.setText(R.string.warning_no_compat_versions);
|
||||
warningView.setVisibility(View.VISIBLE);
|
||||
} else if (SessionInstallManager.canBeUsed(context) && suggestedApk != null
|
||||
&& !SessionInstallManager.isTargetSdkSupported(suggestedApk.targetSdkVersion)) {
|
||||
int color = ContextCompat.getColor(context, R.color.warning);
|
||||
warningView.setBackgroundColor(color);
|
||||
warningView.setText(R.string.warning_target_sdk);
|
||||
warningView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
warningView.setVisibility(View.GONE);
|
||||
@@ -637,7 +647,7 @@ public class AppDetailsRecyclerViewAdapter
|
||||
updateAntiFeaturesWarning();
|
||||
|
||||
buttonPrimaryView.setText(R.string.menu_install);
|
||||
buttonPrimaryView.setVisibility(versions.isEmpty() ? View.GONE : View.VISIBLE);
|
||||
buttonPrimaryView.setVisibility(versionsLoading ? View.GONE : View.VISIBLE);
|
||||
buttonSecondaryView.setText(R.string.menu_uninstall);
|
||||
buttonSecondaryView.setVisibility(app.isUninstallable(context) ? View.VISIBLE : View.GONE);
|
||||
buttonSecondaryView.setOnClickListener(v -> callbacks.uninstallApk());
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
<color name="fdroid_blue_dark">#ff004ba0</color>
|
||||
<color name="fdroid_green_light">#ffbee247</color>
|
||||
<color name="fdroid_green">#ff8ab000</color>
|
||||
<color name="fdroid_error">#ffb00020</color>
|
||||
<color name="fdroid_red">#ffb00020</color>
|
||||
<color name="fdroid_error">@color/fdroid_red</color>
|
||||
<color name="fdroid_caption">#ff757575</color>
|
||||
|
||||
<color name="shadow">#cc222222</color>
|
||||
|
||||
@@ -748,6 +748,7 @@ This often occurs with apps installed via Google Play or other sources, if they
|
||||
<string name="details_last_updated_today">Updated today</string>
|
||||
<string name="warning_scaning_qr_code">Your camera doesn\'t seem to have an autofocus. It might be difficult to scan the code.</string>
|
||||
<string name="warning_target_sdk">This app was built for an older version of Android and cannot be updated automatically.</string>
|
||||
<string name="warning_no_compat_versions">The selected repository has no compatible app versions. To receive updates, prefer a repository with compatible versions.</string>
|
||||
<string name="undo">Undo</string>
|
||||
<string name="app_list__dismiss_installing_app">Installation cancelled</string>
|
||||
<string name="turn_on_wifi">Turn on wifi</string>
|
||||
|
||||
Reference in New Issue
Block a user