Shifted summary to the right of icon to give icon more space, aligned status with license
This commit is contained in:
parent
4f717c663b
commit
5786d014dc
@ -11,12 +11,13 @@
|
||||
|
||||
<ImageView android:id="@+id/icon"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginRight="6dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_centerVertical="true"
|
||||
/>
|
||||
|
||||
<LinearLayout android:id="@+id/status_icons"
|
||||
@ -48,8 +49,7 @@
|
||||
android:ellipsize="marquee"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/icon"
|
||||
android:paddingTop="4dp" />
|
||||
android:layout_toRightOf="@id/icon" />
|
||||
|
||||
<TextView android:id="@+id/status"
|
||||
android:textSize="12sp"
|
||||
@ -67,14 +67,17 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:layout_alignParentRight="true" />
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignBaseline="@id/status" />
|
||||
|
||||
<!-- Some of the layout settings are set in
|
||||
AppListAdapater.java:layoutSummary() -->
|
||||
<TextView android:id="@+id/summary"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/icon"
|
||||
android:paddingLeft="@dimen/applist_summary_padding" />
|
||||
android:layout_below="@id/status"
|
||||
android:layout_toRightOf="@id/icon" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -80,7 +80,6 @@ abstract public class AppListAdapter extends BaseAdapter {
|
||||
iconContainer.setVisibility(visibleOnCompact);
|
||||
status.setVisibility(notVisibleOnCompact);
|
||||
license.setVisibility(notVisibleOnCompact);
|
||||
layoutSummary(summary);
|
||||
|
||||
ImageLoader.getInstance().displayImage(app.iconUrl, icon);
|
||||
|
||||
@ -116,38 +115,6 @@ abstract public class AppListAdapter extends BaseAdapter {
|
||||
return convertView;
|
||||
}
|
||||
|
||||
/**
|
||||
* In compact view, the summary sites next to the icon, below the name.
|
||||
* In non-compact view, it sits under the icon, with some padding pushing
|
||||
* it away from the left margin.
|
||||
*/
|
||||
private void layoutSummary(TextView summaryView) {
|
||||
|
||||
if (Preferences.get().hasCompactLayout()) {
|
||||
|
||||
RelativeLayout.LayoutParams summaryLayout =
|
||||
new RelativeLayout.LayoutParams(
|
||||
RelativeLayout.LayoutParams.WRAP_CONTENT,
|
||||
RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
summaryLayout.addRule(RelativeLayout.BELOW, R.id.name);
|
||||
summaryLayout.addRule(LayoutCompat.RelativeLayout.END_OF, R.id.icon);
|
||||
summaryView.setLayoutParams(summaryLayout);
|
||||
summaryView.setPadding(0,0,0,0);
|
||||
|
||||
} else {
|
||||
|
||||
RelativeLayout.LayoutParams summaryLayout =
|
||||
new RelativeLayout.LayoutParams(
|
||||
RelativeLayout.LayoutParams.MATCH_PARENT,
|
||||
RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
summaryLayout.addRule(RelativeLayout.BELOW, R.id.icon);
|
||||
summaryView.setLayoutParams(summaryLayout);
|
||||
float padding = mContext.getResources().getDimension(R.dimen.applist_summary_padding);
|
||||
summaryView.setPadding((int)padding, 0, 0, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private String getVersionInfo(DB.App app) {
|
||||
if (app.installedVersion != null) {
|
||||
if (app.toUpdate) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user