[MD3] Added more rounded-ness to all Cards, dialogs, etc.

main
Prathamesh More 2021-11-12 17:04:33 +05:30
parent 3fe882c79c
commit 38a8c6a87a
36 changed files with 66 additions and 54 deletions

View File

@ -61,7 +61,6 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.model.CategoryInfo
import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.RetroUtil
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.bottomsheet.BottomSheetBehavior.*
import org.koin.androidx.viewmodel.ext.android.viewModel

View File

@ -14,7 +14,6 @@
*/
package code.name.monkey.retromusic.dialogs
import android.annotation.SuppressLint
import android.app.Dialog
import android.content.Context
import android.os.Bundle
@ -42,7 +41,6 @@ import java.io.IOException
class SongDetailDialog : DialogFragment() {
@SuppressLint("InflateParams")
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val context: Context = requireContext()
val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_file_details, null)

View File

@ -84,7 +84,6 @@ abstract class AbsRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : Recycle
onShuffleClicked()
}
accentColor()
hide()
}
} else {
binding.shuffleButton.isVisible = false

View File

@ -53,7 +53,6 @@ import com.bumptech.glide.request.target.Target
import com.github.dhaval2404.imagepicker.ImagePicker
import com.github.dhaval2404.imagepicker.constant.ImageProvider
import com.google.android.material.transition.MaterialContainerTransform
import com.google.android.material.transition.MaterialSharedAxis
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

View File

@ -17,7 +17,7 @@
<item android:id="@android:id/mask">
<shape>
<corners android:radius="8dp" />
<corners android:radius="@dimen/m3_card_corner_radius" />
<solid android:color="@color/md_green_500" />
</shape>
</item>
@ -25,7 +25,7 @@
<selector>
<item android:state_activated="true">
<shape>
<corners android:radius="8dp" />
<corners android:radius="@dimen/m3_card_corner_radius" />
<solid android:color="@android:color/system_neutral1_300" />
</shape>
</item>

View File

@ -17,7 +17,7 @@
<item android:id="@android:id/mask">
<shape>
<corners android:radius="8dp" />
<corners android:radius="@dimen/m3_card_corner_radius" />
<solid android:color="@color/md_green_500" />
</shape>
</item>
@ -25,7 +25,7 @@
<selector>
<item android:state_activated="true">
<shape>
<corners android:radius="8dp" />
<corners android:radius="@dimen/m3_card_corner_radius" />
<solid android:color="?android:attr/colorControlHighlight" />
</shape>
</item>

View File

@ -8,7 +8,8 @@
android:fitsSystemWindows="true"
android:orientation="vertical"
android:transitionName="@string/transition_album_art"
tools:ignore="UnusedAttribute">
tools:ignore="UnusedAttribute"
android:transitionGroup="true">
<FrameLayout
android:id="@+id/toolbar_container"
@ -31,7 +32,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="@dimen/mini_player_height"
app:cardCornerRadius="24dp"
app:cardCornerRadius="@dimen/m3_card_large_radius"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintStart_toStartOf="parent"

View File

@ -32,7 +32,7 @@
android:layout_marginTop="8dp"
android:layout_marginBottom="@dimen/mini_player_height"
android:transitionName="@string/transition_artist_image"
app:cardCornerRadius="24dp"
app:cardCornerRadius="@dimen/m3_card_large_radius"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintStart_toStartOf="parent"

View File

@ -40,7 +40,7 @@
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:transitionName="@string/transition_album_art"
app:cardCornerRadius="24dp"
app:cardCornerRadius="@dimen/m3_card_large_radius"
app:cardElevation="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -12,7 +12,7 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
app:cardCornerRadius="12dp"
app:cardCornerRadius="@dimen/m3_card_medium_radius"
app:cardElevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:padding="@dimen/padding_album_cover">
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/player_image"

View File

@ -8,7 +8,7 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardElevation="8dp"
app:cardUseCompatPadding="true"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
android:transitionGroup="true">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
@ -47,7 +48,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
app:cardCornerRadius="24dp"
app:cardCornerRadius="@dimen/m3_card_large_radius"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -3,7 +3,8 @@
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:layout_height="wrap_content"
android:padding="@dimen/padding_album_cover">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/player_image"

View File

@ -9,7 +9,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="16dp"
app:cardCornerRadius="16dp"
app:cardCornerRadius="@dimen/m3_card_medium_radius"
app:cardElevation="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -9,7 +9,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -46,7 +46,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
app:cardCornerRadius="24dp"
app:cardCornerRadius="@dimen/m3_card_large_radius"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -9,7 +9,7 @@
android:background="?attr/rectSelector"
android:orientation="vertical"
android:padding="4dp"
app:cardCornerRadius="12dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:layout_constraintDimensionRatio="3:4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -17,7 +17,7 @@
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_margin="4dp"
app:cardCornerRadius="16dp">
app:cardCornerRadius="@dimen/m3_card_corner_radius">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/paletteColorContainer"

View File

@ -7,7 +7,7 @@
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="?attr/rectSelector"
app:cardCornerRadius="8dp">
app:cardCornerRadius="@dimen/m3_card_corner_radius">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"

View File

@ -13,7 +13,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
tools:ignore="MissingPrefix">
<androidx.constraintlayout.widget.ConstraintLayout

View File

@ -13,7 +13,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
tools:ignore="MissingPrefix">
<androidx.constraintlayout.widget.ConstraintLayout

View File

@ -14,7 +14,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardCornerRadius="8dp">
app:cardCornerRadius="@dimen/m3_card_corner_radius">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

View File

@ -17,7 +17,7 @@
android:layout_height="0dp"
android:scaleType="centerCrop"
app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -14,7 +14,7 @@
android:layout_margin="8dp"
android:orientation="vertical"
app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardPreventCornerOverlap="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -15,7 +15,7 @@
android:layout_height="0dp"
android:layout_margin="4dp"
android:orientation="vertical"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -6,8 +6,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="1dp"
android:layout_marginEnd="1dp"
android:layout_marginBottom="1dp"
android:background="?rectSelector"
android:layout_marginVertical="2dp"
android:clickable="true"
android:focusable="true"
android:minHeight="?attr/listPreferredItemHeight"
@ -35,15 +35,15 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
app:cardCornerRadius="6dp"
app:cardCornerRadius="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/drag_view"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:scaleType="centerCrop"
@ -63,7 +63,6 @@
tools:visibility="visible" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="0dp"

View File

@ -24,7 +24,7 @@
android:id="@+id/card1"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toStartOf="@id/card2"
@ -44,7 +44,7 @@
android:id="@+id/card2"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toStartOf="@id/card3"
@ -64,7 +64,7 @@
android:id="@+id/card3"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toStartOf="@id/card4"
@ -84,7 +84,7 @@
android:id="@+id/card4"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toStartOf="@id/card5"
@ -104,7 +104,7 @@
android:id="@+id/card5"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toEndOf="parent"
@ -127,7 +127,7 @@
android:clickable="true"
android:focusable="true"
app:cardBackgroundColor="?attr/colorSurface"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardElevation="0dp"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
@ -155,7 +155,7 @@
android:id="@+id/card7"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toStartOf="@id/card8"
@ -175,7 +175,7 @@
android:id="@+id/card8"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toEndOf="parent"
@ -194,7 +194,7 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="0dp"
android:layout_height="0dp"
app:cardCornerRadius="8dp"
app:cardCornerRadius="@dimen/m3_card_corner_radius"
app:cardUseCompatPadding="true"
app:layout_constraintDimensionRatio="1,1"
app:layout_constraintEnd_toStartOf="@id/card8"

View File

@ -35,5 +35,6 @@
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="q">false</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
</resources>

View File

@ -12,7 +12,7 @@
~ See the GNU General Public License for more details.
-->
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<style name="Theme.RetroMusic.Base.Adaptive" parent="Theme.Material3.DayNight.NoActionBar">
<item name="md_background_color">?attr/colorSurface</item>
@ -33,5 +33,6 @@
<item name="floatingActionButtonStyle">
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
</resources>

View File

@ -33,6 +33,7 @@
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="q">false</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
<style name="Theme.RetroMusic.Base" parent="Theme.Material3.DayNight.NoActionBar">
@ -59,6 +60,7 @@
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="q">false</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
<style name="Theme.RetroMusic.Base.Light" parent="Theme.Material3.Light.NoActionBar">
@ -82,5 +84,6 @@
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="q">false</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
</resources>

View File

@ -8,6 +8,7 @@
<item name="android:statusBarColor">@color/transparent</item>
<item name="android:navigationBarColor">@color/transparent</item>
<item name="android:enforceNavigationBarContrast">false</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
<style name="BottomSheetStyle" parent="Widget.Material3.BottomSheet">

View File

@ -1,7 +1,7 @@
<resources>
<dimen name="toolbar_margin_horizontal">64dp</dimen>
<dimen name="toolbar_height">64dp</dimen>
<dimen name="item_song_height">64dp</dimen>
<dimen name="item_song_height">72dp</dimen>
<dimen name="button_padding_vertical">16dp</dimen>
<dimen name="pref_title_padding">80dp</dimen>
</resources>

View File

@ -42,7 +42,7 @@
<dimen name="icon_notification_dimen">32dp</dimen>
<dimen name="toolbar_margin_horizontal">8dp</dimen>
<dimen name="toolbar_height">48dp</dimen>
<dimen name="item_song_height">52dp</dimen>
<dimen name="item_song_height">60dp</dimen>
<dimen name="button_padding_vertical">10dp</dimen>
<dimen name="list_pref_guideline_begin">56dp</dimen>
<dimen name="pref_title_padding">72dp</dimen>
@ -56,4 +56,9 @@
<dimen name="lyrics_text_size">18sp</dimen>
<dimen name="indicator_radius">10dp</dimen>
<dimen name="lyrics_dialog_radius">20dp</dimen>
<dimen name="m3_card_corner_radius">16dp</dimen>
<dimen name="m3_card_medium_radius">24dp</dimen>
<dimen name="m3_card_large_radius">40dp</dimen>
<dimen name="padding_album_cover">16dp</dimen>
</resources>

View File

@ -137,12 +137,11 @@
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="MaterialPopupMenuStyle" parent="Widget.MaterialComponents.PopupMenu">
<style name="MaterialPopupMenuStyle" parent="Widget.Material3.PopupMenu">
<item name="android:popupBackground">@drawable/popup_background</item>
</style>
<style name="MaterialAlertDialogTheme" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="android:dialogCornerRadius" tools:targetApi="p">12dp</item>
<style name="MaterialAlertDialogTheme" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="materialAlertDialogBodyTextStyle">
@style/AppTextAppearance.MaterialAlertDialog.Body
</item>
@ -166,17 +165,17 @@
<item name="android:padding">0dp</item>
</style>
<style name="AppTextAppearance.MaterialAlertDialog.Body" parent="MaterialAlertDialog.MaterialComponents.Body.Text">
<style name="AppTextAppearance.MaterialAlertDialog.Body" parent="MaterialAlertDialog.Material3.Body.Text">
<item name="android:textAppearance">@style/TextViewBody1</item>
<item name="android:paddingTop">16dp</item>
</style>
<style name="AppTextAppearance.MaterialAlertDialog.Title" parent="MaterialAlertDialog.MaterialComponents.Title.Text">
<style name="AppTextAppearance.MaterialAlertDialog.Title" parent="MaterialAlertDialog.Material3.Title.Text">
<item name="android:textAppearance">@style/TextViewHeadline6</item>
<item name="android:textStyle">bold</item>
</style>
<style name="MaterialButtonTheme" parent="Widget.MaterialComponents.Button">
<style name="MaterialButtonTheme" parent="Widget.Material3.Button">
<item name="cornerRadius">6dp</item>
<item name="iconGravity">textStart</item>
<item name="iconTint">?attr/colorControlNormal</item>

View File

@ -20,6 +20,7 @@
<item name="floatingActionButtonStyle">
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
<style name="Theme.RetroMusic.Base" parent="Theme.Material3.DayNight.NoActionBar">
@ -44,6 +45,7 @@
<item name="floatingActionButtonStyle">
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
<style name="Theme.RetroMusic.Base.Black" parent="Theme.Material3.DayNight.NoActionBar">
@ -66,6 +68,7 @@
<item name="floatingActionButtonStyle">
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
<style name="Theme.RetroMusic.Base.Light" parent="Theme.Material3.Light.NoActionBar">
@ -88,6 +91,7 @@
<item name="floatingActionButtonStyle">
@style/Widget.MaterialComponents.FloatingActionButton
</item>
<item name="popupMenuBackground">@drawable/popup_background</item>
</style>
<style name="MusicProgressSliderParent">