Remove compact icons, replace installed with a symbol
This commit is contained in:
parent
753bc43452
commit
cd00760cc4
Binary file not shown.
Before Width: | Height: | Size: 970 B |
@ -24,28 +24,6 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:baselineAligned="false" >
|
android:baselineAligned="false" >
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/status_icons"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:padding="4dp">
|
|
||||||
|
|
||||||
<ImageView android:id="@+id/icon_status_has_updates"
|
|
||||||
android:layout_width="18dp"
|
|
||||||
android:layout_height="18dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:gravity="end" />
|
|
||||||
|
|
||||||
<ImageView android:id="@+id/icon_status_installed"
|
|
||||||
android:layout_width="18dp"
|
|
||||||
android:layout_height="18dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:gravity="end" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView android:id="@+id/status"
|
<TextView android:id="@+id/status"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
@ -101,36 +101,12 @@ abstract public class AppListAdapter extends BaseAdapter {
|
|||||||
|
|
||||||
LinearLayout iconContainer = (LinearLayout)convertView.findViewById(R.id.status_icons);
|
LinearLayout iconContainer = (LinearLayout)convertView.findViewById(R.id.status_icons);
|
||||||
|
|
||||||
iconContainer.setVisibility(visibleOnCompact);
|
|
||||||
status.setVisibility(notVisibleOnCompact);
|
|
||||||
license.setVisibility(notVisibleOnCompact);
|
|
||||||
|
|
||||||
layoutIcon(icon, compact);
|
layoutIcon(icon, compact);
|
||||||
ImageLoader.getInstance().displayImage(app.iconUrl, icon,
|
ImageLoader.getInstance().displayImage(app.iconUrl, icon,
|
||||||
displayImageOptions);
|
displayImageOptions);
|
||||||
|
|
||||||
if (!compact) {
|
|
||||||
status.setText(getVersionInfo(app));
|
status.setText(getVersionInfo(app));
|
||||||
license.setText(app.license);
|
license.setText(app.license);
|
||||||
} else {
|
|
||||||
ImageView iconInstalled = (ImageView) convertView.findViewById(R.id.icon_status_installed);
|
|
||||||
ImageView iconUpdates = (ImageView) convertView.findViewById(R.id.icon_status_has_updates);
|
|
||||||
|
|
||||||
iconInstalled.setImageResource(R.drawable.ic_cab_done_holo_dark);
|
|
||||||
iconUpdates.setImageResource(R.drawable.ic_menu_refresh);
|
|
||||||
|
|
||||||
if (app.toUpdate && showStatusUpdate()) {
|
|
||||||
iconUpdates.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
iconUpdates.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (app.installedVerCode > 0 && showStatusInstalled()) {
|
|
||||||
iconInstalled.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
iconInstalled.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable it all if it isn't compatible...
|
// Disable it all if it isn't compatible...
|
||||||
View[] views = { convertView, status, summary, license, name };
|
View[] views = { convertView, status, summary, license, name };
|
||||||
@ -148,31 +124,26 @@ abstract public class AppListAdapter extends BaseAdapter {
|
|||||||
return input.substring(0, maxLength) + "…";
|
return input.substring(0, maxLength) + "…";
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpannableString getVersionInfo(DB.App app) {
|
private String getVersionInfo(DB.App app) {
|
||||||
|
|
||||||
if (app.curApk == null) {
|
if (app.curApk == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app.installedVersion == null) {
|
if (app.installedVersion == null) {
|
||||||
return new SpannableString(
|
return ellipsize(app.curApk.version, 12);
|
||||||
ellipsize(app.curApk.version, 12));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SpannableString span;
|
if (app.toUpdate && showStatusUpdate()) {
|
||||||
String cur;
|
return ellipsize(app.installedVersion, 8) +
|
||||||
|
" → " + ellipsize(app.curApk.version, 8);
|
||||||
if (app.toUpdate) {
|
|
||||||
cur = ellipsize(app.installedVersion, 8);
|
|
||||||
span = new SpannableString(
|
|
||||||
cur + " → " + ellipsize(app.curApk.version, 8));
|
|
||||||
} else {
|
|
||||||
cur = ellipsize(app.installedVersion, 12);
|
|
||||||
span = new SpannableString(cur);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
span.setSpan(new StyleSpan(Typeface.BOLD), 0, cur.length(), 0);
|
if (app.installedVerCode > 0 && showStatusInstalled()) {
|
||||||
return span;
|
return ellipsize(app.installedVersion, 12) + " ✔";
|
||||||
|
}
|
||||||
|
|
||||||
|
return app.installedVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void layoutIcon(ImageView icon, boolean compact) {
|
private void layoutIcon(ImageView icon, boolean compact) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user