Code refactor and Flat, Fit, Full, Circle theme toolbar shadow fixes

This commit is contained in:
= 2020-02-26 22:19:24 +05:30
parent 954dfb6327
commit 724f743627
304 changed files with 3874 additions and 3524 deletions

View file

@ -75,17 +75,16 @@
</code.name.monkey.retromusic.views.WidthFitSquareCardView>
<code.name.monkey.retromusic.views.CircularImageView
<code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/artistImage"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_weight="0"
app:civ_border="false"
app:civ_shadow="false"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/albumCoverContainer"
app:retroCornerSize="26dp"
tools:srcCompat="@tools:sample/backgrounds/scenic[11]" />
<com.google.android.material.textview.MaterialTextView
@ -95,8 +94,8 @@
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:maxLines="3"
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="@style/TextViewHeadline5"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -10,9 +10,9 @@
android:id="@+id/playAction"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/action_play_all"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:text="@string/action_play_all"
app:backgroundTint="?attr/colorSurface"
app:icon="@drawable/ic_play_arrow_white_24dp"
app:layout_constraintEnd_toStartOf="@+id/shuffleAction"
@ -23,9 +23,9 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/shuffleAction"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_height="wrap_content"
android:text="@string/shuffle"
app:backgroundTint="?attr/colorSurface"
app:icon="@drawable/ic_shuffle_white_24dp"

View file

@ -84,8 +84,8 @@
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:maxLines="2"
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="@style/TextViewHeadline5"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View file

@ -161,8 +161,8 @@
android:id="@+id/songText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="4dp"
android:gravity="center"
android:maxLines="3"
android:textAppearance="@style/TextViewHeadline6"
android:textColor="@color/md_grey_200"

View file

@ -29,8 +29,8 @@
android:id="@+id/toolbar"
style="@style/Toolbar"
app:layout_collapseMode="pin"
app:title="@string/licenses"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:title="@string/licenses"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal"
tools:ignore="UnusedAttribute" />

View file

@ -53,12 +53,12 @@
tools:ignore="UnusedAttribute">
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:id="@+id/appTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textAppearance="@style/TextViewHeadline6"
android:text="@string/app_name" />
android:text="@string/app_name"
android:textAppearance="@style/TextViewHeadline6" />
</androidx.appcompat.widget.Toolbar>
<ViewStub

View file

@ -1,96 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="@dimen/app_widget_classic_height"
android:background="@color/md_black_1000"
android:orientation="horizontal"
tools:ignore="ContentDescription">
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/app_widget_classic_image_size"
android:layout_height="@dimen/app_widget_classic_image_size"
android:scaleType="centerCrop" />
<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="@dimen/app_widget_classic_height"
android:background="@color/md_black_1000"
android:orientation="horizontal"
tools:ignore="ContentDescription">
<LinearLayout
android:id="@+id/media_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:layoutDirection="ltr"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp">
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/app_widget_classic_image_size"
android:layout_height="@dimen/app_widget_classic_image_size"
android:scaleType="centerCrop" />
<ImageButton
android:id="@+id/button_prev"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
tools:src="@drawable/ic_skip_previous_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
android:layout_height="match_parent">
<ImageButton
android:id="@+id/button_toggle_play_pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
tools:src="@drawable/ic_play_arrow_white_32dp"
tools:tint="@color/ate_secondary_text_dark" />
<LinearLayout
android:id="@+id/media_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:layoutDirection="ltr"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp">
<ImageButton
android:id="@+id/button_next"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
tools:src="@drawable/ic_skip_next_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
<ImageButton
android:id="@+id/button_prev"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
tools:src="@drawable/ic_skip_previous_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
</LinearLayout>
<ImageButton
android:id="@+id/button_toggle_play_pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
tools:src="@drawable/ic_play_arrow_white_32dp"
tools:tint="@color/ate_secondary_text_dark" />
<LinearLayout
android:id="@+id/media_titles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/media_actions"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingEnd="8dp">
<ImageButton
android:id="@+id/button_next"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
tools:src="@drawable/ic_skip_next_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="@color/ate_primary_text_dark"
tools:text="Title" />
</LinearLayout>
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp"
android:singleLine="true"
android:textAppearance="@style/TextViewNormal"
android:textColor="@color/ate_secondary_text_dark"
tools:text="Text" />
<LinearLayout
android:id="@+id/media_titles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/media_actions"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingEnd="8dp">
</LinearLayout>
</RelativeLayout>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="@color/ate_primary_text_dark"
tools:text="Title" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp"
android:singleLine="true"
android:textAppearance="@style/TextViewNormal"
android:textColor="@color/ate_secondary_text_dark"
tools:text="Text" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -30,9 +30,9 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:overScrollMode="never"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sb1" />

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/playbackControls"
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.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:id="@+id/playbackControls"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@ -136,8 +136,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingEnd="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
app:layout_constraintBottom_toTopOf="@id/songInfo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -153,9 +153,9 @@
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:paddingBottom="8dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"

View file

@ -21,55 +21,43 @@
<include layout="@layout/shadow_statusbar_toolbar" />
<LinearLayout
<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/shadow_statusbar_toolbar" />
<include layout="@layout/status_bar" />
</FrameLayout>
<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0">
android:orientation="vertical">
<code.name.monkey.retromusic.views.StatusBarView
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding" />
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/playerToolbar"
style="@style/Toolbar"
android:navigationIcon="@drawable/ic_close_white_24dp"
app:navigationIcon="@drawable/ic_close_white_24dp" />
</FrameLayout>
android:background="@android:color/transparent"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp" />
</LinearLayout>
</FrameLayout>
<Space
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="8dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<com.google.android.material.card.MaterialCardView
<fragment
android:id="@+id/playbackControlsFragment"
android:name="code.name.monkey.retromusic.fragments.player.card.CardPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="0"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/playbackControlsFragment"
android:name="code.name.monkey.retromusic.fragments.player.card.CardPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_card_player_playback_controls" />
</FrameLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
tools:layout="@layout/fragment_card_player_playback_controls" />
</com.google.android.material.card.MaterialCardView>
</FrameLayout>

View file

@ -115,8 +115,8 @@
android:focusableInTouchMode="true"
android:freezesText="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:scrollHorizontally="true"
android:singleLine="true"
android:textStyle="bold"
tools:text="@tools:sample/lorem/random" />

View file

@ -159,7 +159,7 @@
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
app:layout_constraintTop_toBottomOf="@+id/volumeSeekBar"
app:thumbColor="?attr/colorSurface"
app:thumbColor="@color/md_white_1000"
app:trackColorInactive="?attr/colorControlNormal"
tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" />

View file

@ -29,10 +29,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:labelBehavior="gone"
app:trackHeight="3dp"
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
app:layout_constraintTop_toTopOf="parent"
app:trackHeight="3dp"
tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" />

View file

@ -28,6 +28,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_album_full_cover" />
<include layout="@layout/shadow_statusbar_toolbar" />
</FrameLayout>
<FrameLayout

View file

@ -30,8 +30,8 @@
android:layout_weight="8"
android:splitTrack="false"
android:thumb="@drawable/switch_square"
app:labelBehavior="gone"
app:haloRadius="0dp"
app:labelBehavior="gone"
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
app:layout_constraintTop_toTopOf="parent"

View file

@ -12,8 +12,8 @@
android:layout_height="wrap_content"
android:clipToPadding="false"
android:layoutAnimation="@anim/layout_animation_fall_down"
android:scrollbars="none"
android:overScrollMode="never"
android:scrollbars="none"
app:layout_dodgeInsetEdges="bottom"
tools:listitem="@layout/item_list" />

View file

@ -40,10 +40,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:labelBehavior="gone"
app:trackHeight="3dp"
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
app:layout_constraintTop_toTopOf="parent"
app:trackHeight="3dp"
tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" />

View file

@ -41,9 +41,9 @@
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:ellipsize="end"
android:maxLines="2"
android:textStyle="bold"

View file

@ -21,8 +21,8 @@
android:gravity="center_vertical"
android:minHeight="64dp"
android:orientation="horizontal"
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
tools:ignore="PrivateResource">
<code.name.monkey.retromusic.views.RetroShapeableImageView

View file

@ -39,10 +39,10 @@
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="8dp">
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"

View file

@ -17,8 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
>
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/playAction"