Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7105fbe2 authored by Tony Huang's avatar Tony Huang
Browse files

Fine tune list item layout and remove summary column

Use weight to get dynamic width preview icon will show or hide.
If preview icon hide, there will have a large space on second line.

Remove summary column due to it is not showing currently on both
phone and tablet, summary column is just only using for show
progress of downloading files.

Fix: 122344258
Test: visual
Test: atest DocumentsUITests
Change-Id: I79f888fdbd659e37bc601f0c637eddca27dc94b9
parent 9c046249
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -88,18 +88,6 @@
                android:textAppearance="@android:style/TextAppearance.Material.Subhead"
                android:textColor="?android:attr/textColorPrimary" />

            <TextView
                android:id="@android:id/summary"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginEnd="0dp"
                android:layout_weight="0"
                android:ellipsize="end"
                android:singleLine="true"
                android:textAlignment="viewStart"
                android:textAppearance="@android:style/TextAppearance.Material.Body1"
                android:textColor="?android:attr/textColorSecondary" />

            <TextView
                android:id="@+id/file_type"
                android:layout_width="0dp"
+5 −13
Original line number Diff line number Diff line
@@ -97,8 +97,9 @@

                <TextView
                    android:id="@+id/date"
                    android:layout_width="70dp"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.4"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textAlignment="viewStart"
@@ -106,9 +107,10 @@

                <TextView
                    android:id="@+id/size"
                    android:layout_width="70dp"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:layout_weight="0.3"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textAlignment="viewStart"
@@ -116,20 +118,10 @@

                <TextView
                    android:id="@+id/file_type"
                    android:layout_width="70dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textAlignment="viewStart"
                    android:textAppearance="@android:style/TextAppearance.Material.Caption"/>

                <TextView
                    android:id="@android:id/summary"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:layout_weight="1"
                    android:layout_weight="0.3"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textAlignment="viewStart"
+0 −16
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ final class ListDocumentHolder extends DocumentHolder {
    private final TextView mDate;
    private final TextView mSize;
    private final TextView mType;
    private final TextView mSummary;
    private final ImageView mIconMime;
    private final ImageView mIconThumb;
    private final ImageView mIconCheck;
@@ -67,7 +66,6 @@ final class ListDocumentHolder extends DocumentHolder {
        mIconThumb = (ImageView) itemView.findViewById(R.id.icon_thumb);
        mIconCheck = (ImageView) itemView.findViewById(R.id.icon_check);
        mTitle = (TextView) itemView.findViewById(android.R.id.title);
        mSummary = (TextView) itemView.findViewById(android.R.id.summary);
        mSize = (TextView) itemView.findViewById(R.id.size);
        mDate = (TextView) itemView.findViewById(R.id.date);
        mType = (TextView) itemView.findViewById(R.id.file_type);
@@ -199,20 +197,6 @@ final class ListDocumentHolder extends DocumentHolder {
            // Note, we don't show any details for any directory...ever.
            hasDetails = false;
        } else {
            // Show summary if the file is partial. Otherwise, there tends
            // to be a bunch of confusing junk in the summary field
            // as populated by Downlaods (and others). So to make things
            // simpler and clearer for the user in list view, we only
            // show the summary if the file is partial >
            // which we believe to mean actively downloading.
            if (mDoc.isPartial() && mDoc.summary != null) {
                hasDetails = true;
                mSummary.setText(mDoc.summary);
                mSummary.setVisibility(View.VISIBLE);
            } else {
                mSummary.setVisibility(View.INVISIBLE);
            }

            if (mDoc.lastModified > 0) {
                hasDetails = true;
                mDate.setText(Shared.formatTime(mContext, mDoc.lastModified));