First pass at Materializing DocumentsUI!
Initial Material asset drop, which still needs some tweaking. Moved
back to framework list item selectors, giving us ripples. Using
accent color overlay for activated items. Align all items to new
Material grid, including insetting list divider and resizing list
items on wide screens.
Fix obscure RTL drawing bug.
Still lots of work left.
Bug: 15836082
Change-Id: I729cc7dcb0271ee62b55d1e036fc28427fc0dd3d
diff --git a/res/layout/item_doc_list.xml b/res/layout/item_doc_list.xml
index e3a0ddd..50ed2d6 100644
--- a/res/layout/item_doc_list.xml
+++ b/res/layout/item_doc_list.xml
@@ -14,114 +14,121 @@
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/item_background"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:baselineAligned="false">
-
- <FrameLayout
- android:id="@android:id/icon"
- android:layout_width="@dimen/icon_size"
- android:layout_height="@dimen/icon_size"
- android:layout_marginStart="12dp"
- android:layout_marginEnd="20dp">
-
- <ImageView
- android:id="@+id/icon_mime"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
-
- <ImageView
- android:id="@+id/icon_thumb"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop"
- android:contentDescription="@null" />
-
- </FrameLayout>
+ android:foreground="@drawable/item_activated">
<LinearLayout
- android:layout_width="0dp"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical">
+ android:minHeight="@dimen/list_item_height"
+ android:paddingStart="@dimen/list_item_padding"
+ android:paddingEnd="@dimen/list_item_padding"
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
+ android:baselineAligned="false">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:baselineAligned="false">
-
- <TextView
- android:id="@android:id/title"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:singleLine="true"
- android:ellipsize="middle"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Medium" />
+ <FrameLayout
+ android:id="@android:id/icon"
+ android:layout_width="@dimen/icon_size"
+ android:layout_height="@dimen/icon_size"
+ android:layout_marginEnd="16dp">
<ImageView
- android:id="@android:id/icon1"
- android:layout_width="@dimen/root_icon_size"
- android:layout_height="@dimen/root_icon_size"
- android:layout_marginStart="8dp"
+ android:id="@+id/icon_mime"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
android:scaleType="centerInside"
android:contentDescription="@null" />
- </LinearLayout>
+ <ImageView
+ android:id="@+id/icon_thumb"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:contentDescription="@null" />
+
+ </FrameLayout>
<LinearLayout
- android:id="@+id/line2"
- android:layout_width="match_parent"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:baselineAligned="false">
+ android:layout_weight="1"
+ android:orientation="vertical">
- <TextView
- android:id="@+id/date"
- android:layout_width="90dp"
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ android:orientation="horizontal"
+ android:baselineAligned="false">
- <TextView
- android:id="@+id/size"
- android:layout_width="90dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:ellipsize="middle"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+ android:textColor="?android:attr/textColorPrimary" />
- <TextView
- android:id="@android:id/summary"
- android:layout_width="0dp"
+ <ImageView
+ android:id="@android:id/icon1"
+ android:layout_width="@dimen/root_icon_size"
+ android:layout_height="@dimen/root_icon_size"
+ android:layout_marginStart="8dp"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/line2"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_marginStart="8dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
+ android:baselineAligned="false">
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="90dp"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ <TextView
+ android:id="@+id/size"
+ android:layout_width="90dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginStart="8dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ </LinearLayout>
</LinearLayout>
</LinearLayout>
-</LinearLayout>
+</FrameLayout>