Recent chapters with constraint layout

This commit is contained in:
inorichi 2017-05-08 13:06:40 +02:00
parent fa8f5bc0d8
commit 29fd5747eb

View File

@ -1,108 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:background="?attr/selectable_list_drawable">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/manga_cover">
<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="fill_parent"
android:layout_height="18dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:id="@+id/download_text"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textAllCaps="true"
android:textSize="12sp"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginEnd="30dp"
android:layout_marginRight="30dp"
android:orientation="vertical">
<TextView
android:id="@+id/manga_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.Regular.Body1"
tools:text="My manga"/>
<TextView
android:id="@+id/chapter_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Regular.Caption"
tools:text="Title"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/chapter_menu"
android:layout_width="50dp"
android:layout_height="fill_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:gravity="center|end"
android:paddingBottom="18dp"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingRight="?android:attr/listPreferredItemPaddingRight">
<android.support.v7.widget.AppCompatImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentEnd="false"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:tint="?android:attr/textColorPrimary"
app:srcCompat="@drawable/ic_more_horiz_black_24dp"/>
</RelativeLayout>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_two_line_height"
android:background="?attr/selectable_list_drawable">
<ImageView
android:id="@+id/manga_cover"
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:layout_centerVertical="true"
android:src="@drawable/branded_logo_icon"
android:clickable="true"
android:paddingLeft="@dimen/material_component_lists_icon_left_padding"
android:paddingStart="@dimen/material_component_lists_icon_left_padding"
android:layout_width="56dp"
android:layout_height="0dp"
android:paddingLeft="16dp"
android:paddingStart="16dp"
android:paddingRight="0dp"
android:paddingEnd="0dp"
android:contentDescription="@string/description_cover"/>
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/branded_logo_icon" />
</RelativeLayout>
<TextView
android:id="@+id/manga_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Regular.Body1"
app:layout_constraintBottom_toTopOf="@+id/chapter_title"
app:layout_constraintLeft_toRightOf="@+id/manga_cover"
app:layout_constraintRight_toLeftOf="@+id/chapter_menu"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Manga title" />
<TextView
android:id="@+id/chapter_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Regular.Caption"
app:layout_constraintLeft_toRightOf="@+id/manga_cover"
app:layout_constraintTop_toBottomOf="@+id/manga_title"
app:layout_constraintRight_toLeftOf="@+id/download_text"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="Chapter title" />
<TextView
android:id="@+id/download_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="3dp"
android:textAllCaps="true"
android:textSize="12sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="Downloaded" />
<FrameLayout
android:id="@+id/chapter_menu"
android:layout_width="50dp"
android:layout_height="0dp"
android:paddingBottom="18dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center|end"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:srcCompat="@drawable/ic_more_horiz_black_24dp" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>