Improving material design

This commit is contained in:
h4h13 2020-05-06 03:23:31 +05:30
parent c8837f13ef
commit 83cb1353d8
9 changed files with 260 additions and 82 deletions

View file

@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
<FrameLayout
android:id="@+id/playerContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -43,7 +43,7 @@
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp" />
</LinearLayout>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
</LinearLayout>
</FrameLayout>
<com.google.android.material.card.MaterialCardView
android:id="@+id/playerQueueSheet"
@ -51,7 +51,6 @@
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="vertical"
android:tag="nested_bottom_sheet"
app:behavior_hideable="false"
app:cardCornerRadius="0dp"
app:layout_behavior="code.name.monkey.retromusic.CustomBottomSheetBehavior">
@ -92,7 +91,6 @@
android:background="?attr/colorSurface"
tools:listitem="@layout/item_list" />
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
@ -7,25 +7,14 @@
android:clickable="true"
android:focusable="true">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface" />
<include layout="@layout/shadow_statusbar_toolbar" />
<LinearLayout
android:id="@+id/playerContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -35,33 +24,101 @@
android:name="code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_album_cover" />
tools:layout="@layout/fragment_album_full_cover" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/playerToolbar"
style="@style/Toolbar"
android:layout_gravity="bottom"
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp" />
</FrameLayout>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
</LinearLayout>
<fragment
android:id="@+id/playbackControlsFragment"
android:name="code.name.monkey.retromusic.fragments.player.material.MaterialControlsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_material_playback_controls" />
</FrameLayout>
<FrameLayout
android:id="@+id/playerQueueSheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
app:behavior_hideable="false"
app:layout_behavior="code.name.monkey.retromusic.CustomBottomSheetBehavior">
<FrameLayout
<LinearLayout
android:id="@+id/sheetContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0">
android:background="?attr/colorSurface"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/playerToolbar"
style="@style/Toolbar"
android:layout_gravity="bottom"
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp" />
</FrameLayout>
</LinearLayout>
</FrameLayout>
<LinearLayout
android:id="@+id/playerControlsContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<fragment
android:id="@+id/playbackControlsFragment"
android:name="code.name.monkey.retromusic.fragments.player.material.MaterialControlsFragment"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="match_parent"
tools:layout="@layout/fragment_material_playback_controls" />
<LinearLayout
android:layout_weight="0"
android:id="@+id/upComing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_shuffle_sharp_white_24dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/player_queue_sub_header"
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:background="?attr/colorSurface"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/up_next"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="?android:attr/textColorSecondary" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
tools:listitem="@layout/item_list" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -30,9 +30,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:labelBehavior="gone"
app:layout_constraintBottom_toTopOf="@id/playPauseButton"
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@id/songInfo"
app:thumbRadius="@dimen/slider_thumb_radius"
app:trackHeight="@dimen/slider_track_height"
tools:ignore="RtlHardcoded,UnusedAttribute"
@ -61,7 +62,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressSlider">
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
@ -114,7 +115,10 @@
android:paddingEnd="16dp"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/playPauseButton"
app:layout_constraintBottom_toTopOf="@+id/progressSlider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:text="@tools:sample/lorem/random" />
@ -155,11 +159,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/roundSelector"
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/nextButton"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/previousButton"
app:layout_constraintTop_toBottomOf="@+id/songInfo"
app:layout_constraintTop_toBottomOf="@+id/progressSlider"
app:srcCompat="@drawable/ic_pause_sharp_white_64dp"
tools:tint="@color/md_black_1000" />
@ -194,15 +198,12 @@
tools:ignore="MissingPrefix"
tools:tint="@color/md_black_1000" />
<FrameLayout
android:id="@+id/volumeFragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
tools:backgroundTint="@color/md_red_400"
tools:layout_height="52dp" />
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>