* Add better library item selectors Inspired by the J2K method of library item selection. * Tweak theme selection colors It was missing for Hot Pink and Midnight Dusk. The selector color is 75% alpha of the color accent, this looked fitting for all themes. (cherry picked from commit 88d9ffe92e41ab8a4d24655a32aa87a20ee8bd01)
142 lines
5.5 KiB
XML
142 lines
5.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_margin="2dp"
|
|
android:background="@drawable/library_item_selector"
|
|
android:padding="4dp">
|
|
|
|
<FrameLayout
|
|
android:id="@+id/card"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="220dp"
|
|
android:background="@drawable/rounded_rectangle">
|
|
|
|
<ImageView
|
|
android:id="@+id/thumbnail"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="?attr/colorSurface"
|
|
android:scaleType="centerCrop"
|
|
tools:ignore="ContentDescription"
|
|
tools:src="@mipmap/ic_launcher" />
|
|
|
|
<View
|
|
android:id="@+id/gradient"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="bottom"
|
|
android:background="@drawable/gradient_shape" />
|
|
|
|
<FrameLayout
|
|
android:id="@+id/play_layout"
|
|
android:layout_width="50dp"
|
|
android:layout_height="50dp"
|
|
android:layout_gravity="end"
|
|
android:clickable="true"
|
|
android:focusable="true"
|
|
android:visibility="gone"
|
|
tools:visibility="visible">
|
|
|
|
<ImageView
|
|
android:id="@+id/play_button"
|
|
android:layout_width="30dp"
|
|
android:layout_height="30dp"
|
|
android:layout_gravity="center"
|
|
android:layout_marginTop="6dp"
|
|
android:layout_marginEnd="6dp"
|
|
android:layout_marginStart="6dp"
|
|
android:layout_marginBottom="6dp"
|
|
android:background="@drawable/round_play_background"
|
|
android:contentDescription="@string/action_start_reading"
|
|
android:padding="6dp"
|
|
android:src="@drawable/ic_start_reading_24dp"
|
|
android:tint="@android:color/white" />
|
|
</FrameLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/badges"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="4dp"
|
|
android:layout_marginTop="4dp"
|
|
android:background="@drawable/rounded_rectangle">
|
|
|
|
<TextView
|
|
android:id="@+id/local_text"
|
|
style="@style/TextAppearance.Regular.Caption"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:background="?attr/colorTertiary"
|
|
android:paddingStart="3dp"
|
|
android:paddingTop="1dp"
|
|
android:paddingEnd="3dp"
|
|
android:paddingBottom="1dp"
|
|
android:text="@string/local_source_badge"
|
|
android:textColor="?attr/colorOnTertiary"
|
|
android:visibility="gone"
|
|
tools:visibility="visible" />
|
|
|
|
<TextView
|
|
android:id="@+id/download_text"
|
|
style="@style/TextAppearance.Regular.Caption"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:background="?attr/colorTertiary"
|
|
android:paddingStart="3dp"
|
|
android:paddingTop="1dp"
|
|
android:paddingEnd="3dp"
|
|
android:paddingBottom="1dp"
|
|
android:textColor="?attr/colorOnTertiary"
|
|
android:visibility="gone"
|
|
tools:text="120"
|
|
tools:visibility="visible" />
|
|
|
|
<TextView
|
|
android:id="@+id/unread_text"
|
|
style="@style/TextAppearance.Regular.Caption"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:background="?attr/colorSecondary"
|
|
android:paddingStart="3dp"
|
|
android:paddingTop="1dp"
|
|
android:paddingEnd="3dp"
|
|
android:paddingBottom="1dp"
|
|
android:textColor="?attr/colorOnSecondary"
|
|
android:visibility="gone"
|
|
tools:text="120"
|
|
tools:visibility="visible" />
|
|
|
|
</LinearLayout>
|
|
|
|
<TextView
|
|
android:id="@+id/title"
|
|
style="@style/TextAppearance.Regular.Body1"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="bottom"
|
|
android:ellipsize="end"
|
|
android:fontFamily="@font/ptsans_narrow_bold"
|
|
android:lineSpacingExtra="-4dp"
|
|
android:maxLines="2"
|
|
android:padding="8dp"
|
|
android:shadowColor="@color/textColorPrimaryLight"
|
|
android:shadowDx="0"
|
|
android:shadowDy="0"
|
|
android:shadowRadius="4"
|
|
android:textColor="@color/md_white_1000"
|
|
tools:text="Sample name" />
|
|
|
|
<com.google.android.material.progressindicator.CircularProgressIndicator
|
|
android:id="@+id/progress"
|
|
style="@style/Theme.Widget.CircularProgressIndicator.Small"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center"
|
|
android:indeterminate="true"
|
|
android:visibility="gone" />
|
|
|
|
</FrameLayout>
|
|
|
|
</FrameLayout> |