diff --git a/res/layout/apklistitem.xml b/res/layout/apklistitem.xml index d92e92bb7..d9dfdb756 100644 --- a/res/layout/apklistitem.xml +++ b/res/layout/apklistitem.xml @@ -47,7 +47,7 @@ android:textSize="13sp" android:layout_below="@id/buildtype" android:layout_toLeftOf="@id/size" - android:layout_alignParentRight="true" + android:layout_marginRight="12sp" android:layout_height="wrap_content" android:layout_width="wrap_content" /> diff --git a/res/values/strings.xml b/res/values/strings.xml index bc666cb08..60ee632ec 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -163,5 +163,6 @@ Show icons at a smaller size Show icons at regular size Theme + %s or later diff --git a/src/org/fdroid/fdroid/AppDetails.java b/src/org/fdroid/fdroid/AppDetails.java index f5a056e7e..0082c0783 100644 --- a/src/org/fdroid/fdroid/AppDetails.java +++ b/src/org/fdroid/fdroid/AppDetails.java @@ -140,10 +140,11 @@ public class AppDetails extends ListActivity { tv = (TextView) v.findViewById(R.id.status); if (apk.vercode == app.installedVerCode - && apk.sig.equals(mInstalledSigID)) + && apk.sig.equals(mInstalledSigID)) { tv.setText(getString(R.string.inst)); - else + } else { tv.setText(getString(R.string.not_inst)); + } tv.setEnabled(apk.compatible); tv = (TextView) v.findViewById(R.id.size); @@ -153,6 +154,16 @@ public class AppDetails extends ListActivity { tv.setText(Utils.getFriendlySize(apk.detail_size)); tv.setEnabled(apk.compatible); } + + tv = (TextView) v.findViewById(R.id.api); + if (apk.minSdkVersion == 0) { + tv.setText(""); + } else { + tv.setText(getString(R.string.minsdk_or_later, + Utils.getAndroidVersionName(apk.minSdkVersion))); + tv.setEnabled(apk.compatible); + } + tv = (TextView) v.findViewById(R.id.buildtype); if (apk.srcname != null) { tv.setText("source"); @@ -160,6 +171,7 @@ public class AppDetails extends ListActivity { tv.setText("bin"); } tv.setEnabled(apk.compatible); + tv = (TextView) v.findViewById(R.id.added); if (apk.added != null) { tv.setVisibility(View.VISIBLE); @@ -168,6 +180,7 @@ public class AppDetails extends ListActivity { } else { tv.setVisibility(View.GONE); } + tv = (TextView) v.findViewById(R.id.nativecode); if (pref_expert && apk.nativecode != null) { tv.setVisibility(View.VISIBLE); @@ -457,26 +470,6 @@ public class AppDetails extends ListActivity { tv = (TextView) infoView.findViewById(R.id.description); - /* - The following is a quick solution to enable both text selection and - links. Causes glitches and crashes: - java.lang.IndexOutOfBoundsException: setSpan (-1 ... -1) starts before 0 - - class CustomMovementMethod extends LinkMovementMethod { - @Override - public boolean canSelectArbitrarily () { - return true; - } - } - - if (Utils.hasApi(11)) { - tv.setTextIsSelectable(true); - tv.setMovementMethod(new CustomMovementMethod()); - } else { - tv.setMovementMethod(LinkMovementMethod.getInstance()); - } - */ - tv.setMovementMethod(LinkMovementMethod.getInstance()); // Need this to add the unimplemented support for ordered and unordered diff --git a/src/org/fdroid/fdroid/Utils.java b/src/org/fdroid/fdroid/Utils.java index 4726e2f32..ba271ceaf 100644 --- a/src/org/fdroid/fdroid/Utils.java +++ b/src/org/fdroid/fdroid/Utils.java @@ -81,6 +81,31 @@ public final class Utils { return String.format(FRIENDLY_SIZE_FORMAT[i], s); } + public static String getAndroidVersionName(int sdkLevel) { + switch (sdkLevel) { + case 19: return "4.4"; + case 18: return "4.3"; + case 17: return "4.2"; + case 16: return "4.1"; + case 15: return "4.0.3"; + case 14: return "4.0"; + case 13: return "3.2"; + case 12: return "3.1"; + case 11: return "3.0"; + case 10: return "2.3.3"; + case 9: return "2.3"; + case 8: return "2.2"; + case 7: return "2.1"; + case 6: return "2.0.1"; + case 5: return "2.0"; + case 4: return "1.6"; + case 3: return "1.5"; + case 2: return "1.1"; + case 1: return "1.0"; + } + return "Unknown"; + } + public static int countSubstringOccurrence(File file, String substring) throws IOException { int count = 0; BufferedReader reader = null;