Refined seletable

This commit is contained in:
h4h13 2020-01-06 11:04:09 +05:30
parent 813fb86073
commit e1f2d14ee8
45 changed files with 259 additions and 332 deletions

View file

@ -4,6 +4,7 @@
android:id="@+id/imageContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="?attr/rectSelector"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/rectSelector"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
@ -28,11 +29,11 @@
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="2"
android:paddingBottom="4dp"
android:paddingEnd="8dp"
android:paddingStart="12dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp"
android:textAppearance="@style/TextViewNormal"
tools:ignore="MissingPrefix"
android:textColor="?android:attr/textColorPrimary"
tools:ignore="MissingPrefix"
tools:text="@tools:sample/full_names" />
</LinearLayout>

View file

@ -5,6 +5,7 @@
android:layout_width="106dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="?attr/rectSelector"
android:orientation="vertical">
<code.name.monkey.retromusic.views.WidthFitSquareLayout

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/rectSelector"
app:cardCornerRadius="6dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true">

View file

@ -1,60 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout 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="wrap_content"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true"
android:layout_margin="2dp"
android:background="?attr/rectSelector"
android:clickable="true"
android:focusable="true"
tools:ignore="MissingPrefix">
<LinearLayout
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?rectSelector"
android:gravity="center"
android:orientation="vertical"
tools:ignore="UnusedAttribute,UselessParent">
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
tools:ignore="MissingPrefix">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="12dp">
tools:ignore="UnusedAttribute,UselessParent">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="wrap_content"
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
tools:text="@string/bug_report_summary" />
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="12dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:singleLine="true"
tools:text="@string/bug_report_summary" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
tools:text="@string/bug_report_summary" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:singleLine="true"
tools:text="@string/bug_report_summary" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
</FrameLayout>

View file

@ -1,60 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout 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="wrap_content"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true"
android:layout_margin="2dp"
android:background="?attr/rectSelector"
android:clickable="true"
android:focusable="true"
tools:ignore="MissingPrefix">
<LinearLayout
android:id="@+id/paletteColorContainer"
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?rectSelector"
android:gravity="center"
android:orientation="vertical"
tools:ignore="UnusedAttribute,UselessParent">
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
tools:ignore="MissingPrefix">
<LinearLayout
android:id="@+id/paletteColorContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_height="match_parent"
android:background="?rectSelector"
android:gravity="center"
android:orientation="vertical"
android:padding="12dp">
tools:ignore="UnusedAttribute,UselessParent">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
tools:text="@string/bug_report_summary" />
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="wrap_content"
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:singleLine="true"
tools:text="@string/bug_report_summary" />
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="12dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
tools:text="@string/bug_report_summary" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:singleLine="true"
tools:text="@string/bug_report_summary" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
</FrameLayout>

View file

@ -17,7 +17,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:background="?rectSelector"
android:gravity="center_vertical"
android:minHeight="64dp"
android:orientation="horizontal"

View file

@ -16,7 +16,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:background="?rectSelector"
android:gravity="center_horizontal"
android:minHeight="@dimen/md_listitem_height"
android:orientation="vertical"

View file

@ -16,6 +16,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="?rectSelector"
android:gravity="center"
android:orientation="vertical">

View file

@ -4,10 +4,10 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_margin="2dp"
android:background="?rectSelector"
android:clickable="true"
android:focusable="true"
android:foreground="?rectSelector"
tools:ignore="MissingPrefix">
<LinearLayout

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:background="?rectSelector"
tools:ignore="MissingPrefix">

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?rectSelector"
android:orientation="vertical">
<code.name.monkey.retromusic.views.WidthFitSquareCardView

View file

@ -1,62 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout 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="wrap_content"
android:orientation="vertical"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true">
android:layout_margin="2dp"
android:background="?attr/rectSelector"
android:clickable="true"
android:focusable="true"
tools:ignore="MissingPrefix">
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:id="@+id/imageContainer"
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content"
android:orientation="vertical"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:transitionName="@string/transition_album_art"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
<LinearLayout
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:id="@+id/imageContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?rectSelector"
android:orientation="vertical">
<Space
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:transitionName="@string/transition_album_art"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
<View
android:id="@+id/mask"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/shadow_up_home" />
</LinearLayout>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
android:layout_height="match_parent"
android:orientation="vertical">
<Space
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<View
android:id="@+id/mask"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/shadow_up_home" />
</LinearLayout>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:gravity="center"
android:maxLines="2"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="@color/md_white_1000"
tools:text="@string/bug_report_summary" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:gravity="center"
android:maxLines="2"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="@color/md_white_1000"
tools:text="@string/bug_report_summary" />
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
</FrameLayout>

View file

@ -4,14 +4,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:layout_marginBottom="2dp"
android:layout_marginEnd="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="2dp"
android:background="?rectSelector"
android:clickable="true"
android:focusable="true"
android:foreground="?rectSelector"
android:gravity="center_vertical"
android:minHeight="64dp"
android:orientation="horizontal"
tools:ignore="MissingPrefix">
@ -32,8 +30,8 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0"
android:paddingEnd="0dp"
android:paddingStart="16dp">
android:paddingStart="16dp"
android:paddingEnd="0dp">
<com.google.android.material.card.MaterialCardView
android:id="@+id/imageTextContainer"
@ -73,8 +71,8 @@
android:layout_weight="1.0"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingEnd="16dp"
android:paddingStart="16dp">
android:paddingStart="16dp"
android:paddingEnd="16dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"

View file

@ -17,12 +17,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?attr/rectSelector"
android:minHeight="72dp"
android:padding="16dp"
android:layout_margin="2dp"
android:background="?rectSelector"
android:minHeight="64dp"
android:padding="14dp"
tools:ignore="UnusedAttribute">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="0dp"

View file

@ -17,6 +17,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?rectSelector"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="8dp"

View file

@ -4,9 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?rectSelector"
android:clickable="true"
android:focusable="true"
android:foreground="?rectSelector">
android:focusable="true">
<FrameLayout
android:id="@+id/dummy_view"

View file

@ -17,7 +17,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:background="?attr/rectSelector"
android:minHeight="72dp"
android:orientation="horizontal"
android:padding="16dp"

View file

@ -5,6 +5,7 @@
android:id="@+id/root_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/rectSelector"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
@ -42,7 +43,7 @@
android:paddingStart="16dp"
android:paddingTop="6dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp"
android:paddingBottom="4dp"
tools:ignore="MissingPrefix"
tools:text="My top tracks" />

View file

@ -17,9 +17,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/rectSelector"
android:descendantFocusability="blocksDescendants"
android:focusable="true"
android:foreground="?rectSelector"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="0dp"