Apply material design guidelines to categories

This commit is contained in:
len
2016-12-18 13:08:56 +01:00
parent 36bbb906c1
commit 79705df499
4 changed files with 50 additions and 60 deletions

View File

@@ -1,53 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeightLarge"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:background="?attr/selectable_list_drawable"
>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_single_line_with_avatar_height"
android:background="?attr/selectable_list_drawable">
<ImageView
android:id="@+id/image"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:layout_width="@dimen/material_component_lists_single_line_with_avatar_height"
android:layout_height="@dimen/material_component_lists_single_line_with_avatar_height"
android:clickable="true"
android:layout_marginLeft="@dimen/margin_left"
android:layout_marginStart="@dimen/margin_left"
android:layout_marginRight="@dimen/margin_right"
android:layout_marginEnd="@dimen/margin_right"/>
<android.support.v7.widget.AppCompatImageView
android:id="@+id/reorder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="@dimen/margin_left"
android:layout_marginStart="@dimen/margin_left"
android:layout_marginRight="@dimen/margin_right"
android:layout_marginEnd="@dimen/margin_right"
android:scaleType="center"
android:layout_centerInParent="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
app:srcCompat="@drawable/ic_reorder_grey_24dp"
android:tint="?android:attr/textColorPrimary"/>
android:paddingLeft="@dimen/material_component_lists_icon_left_padding"
android:paddingStart="@dimen/material_component_lists_icon_left_padding"
android:paddingRight="0dp"
android:paddingEnd="0dp"/>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/image"
android:layout_toEndOf="@id/image"
android:layout_toLeftOf="@id/reorder"
android:layout_toStartOf="@id/reorder"
android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/material_component_lists_text_left_padding"
android:layout_marginStart="@dimen/material_component_lists_text_left_padding"
android:layout_marginRight="@dimen/material_component_lists_single_line_with_avatar_height"
android:layout_marginEnd="@dimen/material_component_lists_single_line_with_avatar_height"
android:ellipsize="end"
android:maxLines="1"
android:layout_gravity="center_vertical"
android:textAppearance="@style/TextAppearance.Regular.SubHeading"
tools:text="Title"/>
</RelativeLayout>
<ImageView
android:id="@+id/reorder"
android:layout_width="@dimen/material_component_lists_single_line_with_avatar_height"
android:layout_height="@dimen/material_component_lists_single_line_with_avatar_height"
android:scaleType="center"
android:layout_gravity="end"
app:srcCompat="@drawable/ic_reorder_grey_24dp"
android:tint="?android:attr/textColorPrimary"/>
</FrameLayout>