fix expert mode version display when maxSdkVersion is MAX_VALUE
closes #616 https://gitlab.com/fdroid/fdroidclient/issues/616
This commit is contained in:
parent
c4a1295095
commit
b86a30d40f
@ -247,7 +247,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
||||
|
||||
if (!Preferences.get().expertMode()) {
|
||||
holder.api.setVisibility(View.GONE);
|
||||
} else if (apk.minSdkVersion > 0 && apk.maxSdkVersion > 0) {
|
||||
} else if (apk.minSdkVersion > 0 && apk.maxSdkVersion < Apk.SDK_VERSION_MAX_VALUE) {
|
||||
holder.api.setText(getString(R.string.minsdk_up_to_maxsdk,
|
||||
Utils.getAndroidVersionName(apk.minSdkVersion),
|
||||
Utils.getAndroidVersionName(apk.maxSdkVersion)));
|
||||
|
@ -11,6 +11,9 @@ import java.util.Date;
|
||||
|
||||
public class Apk extends ValueObject implements Comparable<Apk> {
|
||||
|
||||
// Using only byte-range keeps it only 8-bits in the SQLite database
|
||||
public static final int SDK_VERSION_MAX_VALUE = Byte.MAX_VALUE;
|
||||
|
||||
public String packageName;
|
||||
public String version;
|
||||
public int vercode;
|
||||
@ -19,7 +22,7 @@ public class Apk extends ValueObject implements Comparable<Apk> {
|
||||
public String hash;
|
||||
public String hashType;
|
||||
public int minSdkVersion; // 0 if unknown
|
||||
public int maxSdkVersion = Byte.MAX_VALUE; // "infinity" if not set
|
||||
public int maxSdkVersion = SDK_VERSION_MAX_VALUE; // "infinity" if not set
|
||||
public Date added;
|
||||
public Utils.CommaSeparatedList permissions; // null if empty or
|
||||
// unknown
|
||||
|
Loading…
x
Reference in New Issue
Block a user