Changed artist and album details page a bit

This commit is contained in:
Prathamesh More 2021-09-20 15:03:47 +05:30
parent 8351c3e0fd
commit bd05de53d8
18 changed files with 35 additions and 67 deletions

View file

@ -7,11 +7,8 @@ import androidx.annotation.MenuRes
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.extensions.surfaceColor
import code.name.monkey.retromusic.interfaces.ICabCallback
import code.name.monkey.retromusic.interfaces.ICabHolder
import code.name.monkey.retromusic.util.ColorAnimUtil
import code.name.monkey.retromusic.util.RetroColorUtil
import com.afollestad.materialcab.attached.AttachedCab
import com.afollestad.materialcab.attached.destroy
import com.afollestad.materialcab.attached.isActive
@ -24,7 +21,6 @@ abstract class AbsMultiSelectAdapter<V : RecyclerView.ViewHolder?, I>(
private val checked: MutableList<I>
private var menuRes: Int
override fun onCabCreated(cab: AttachedCab, menu: Menu): Boolean {
return true
}

View file

@ -470,10 +470,10 @@ class AlbumDetailsFragment : AbsMainActivityFragment(R.layout.fragment_album_det
it.destroy()
}
}
cab = createCab(R.id.cab_stub) {
cab = createCab(R.id.toolbar_container) {
menu(menuRes)
closeDrawable(R.drawable.ic_close)
backgroundColor(literal = RetroColorUtil.shiftBackgroundColorForLightText(surfaceColor()))
backgroundColor(literal = RetroColorUtil.shiftBackgroundColor(surfaceColor()))
slideDown()
onCreate { cab, menu -> callback.onCabCreated(cab, menu) }
onSelection {

View file

@ -346,10 +346,10 @@ class AlbumsFragment : AbsRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridL
it.destroy()
}
}
cab = createCab(R.id.cab_stub) {
cab = createCab(R.id.toolbar_container) {
menu(menuRes)
closeDrawable(R.drawable.ic_close)
backgroundColor(literal = RetroColorUtil.shiftBackgroundColorForLightText(surfaceColor()))
backgroundColor(literal = RetroColorUtil.shiftBackgroundColor(surfaceColor()))
slideDown()
onCreate { cab, menu -> callback.onCabCreated(cab, menu) }
onSelection {

View file

@ -326,10 +326,10 @@ abstract class AbsArtistDetailsFragment : AbsMainActivityFragment(R.layout.fragm
it.destroy()
}
}
cab = createCab(R.id.cab_stub) {
cab = createCab(R.id.toolbar_container) {
menu(menuRes)
closeDrawable(R.drawable.ic_close)
backgroundColor(literal = RetroColorUtil.shiftBackgroundColorForLightText(surfaceColor()))
backgroundColor(literal = RetroColorUtil.shiftBackgroundColor(surfaceColor()))
slideDown()
onCreate { cab, menu -> callback.onCabCreated(cab, menu) }
onSelection {

View file

@ -344,10 +344,10 @@ class ArtistsFragment : AbsRecyclerViewCustomGridSizeFragment<ArtistAdapter, Gri
it.destroy()
}
}
cab = createCab(R.id.cab_stub) {
cab = createCab(R.id.toolbar_container) {
menu(menuRes)
closeDrawable(R.drawable.ic_close)
backgroundColor(literal = RetroColorUtil.shiftBackgroundColorForLightText(surfaceColor()))
backgroundColor(literal = RetroColorUtil.shiftBackgroundColor(surfaceColor()))
slideDown()
onCreate { cab, menu -> callback.onCabCreated(cab, menu) }
onSelection {

View file

@ -58,7 +58,8 @@ abstract class AbsRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : Recycle
initAdapter()
setUpRecyclerView()
setupToolbar()
binding.appBarLayout.statusBarForeground = MaterialShapeDrawable.createWithElevationOverlay(requireContext());
binding.appBarLayout.statusBarForeground =
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
}
fun toolbar(): Toolbar {

View file

@ -432,10 +432,10 @@ class FoldersFragment : AbsMainActivityFragment(R.layout.fragment_folder),
if (cab != null && cab!!.isActive()) {
cab?.destroy()
}
cab = createCab(R.id.cab_stub) {
cab = createCab(R.id.toolbar_container) {
menu(menuRes)
closeDrawable(R.drawable.ic_close)
backgroundColor(literal = RetroColorUtil.shiftBackgroundColorForLightText(surfaceColor()))
backgroundColor(literal = RetroColorUtil.shiftBackgroundColor(surfaceColor()))
slideDown()
onCreate { cab, menu -> callback.onCabCreated(cab, menu) }
onSelection {

View file

@ -179,10 +179,10 @@ class PlaylistDetailsFragment : AbsMainActivityFragment(R.layout.fragment_playli
it.destroy()
}
}
cab = createCab(R.id.cab_stub) {
cab = createCab(R.id.toolbar_container) {
menu(menuRes)
closeDrawable(R.drawable.ic_close)
backgroundColor(literal = RetroColorUtil.shiftBackgroundColorForLightText(surfaceColor()))
backgroundColor(literal = RetroColorUtil.shiftBackgroundColor(surfaceColor()))
slideDown()
onCreate { cab, menu -> callback.onCabCreated(cab, menu) }
onSelection {

View file

@ -371,10 +371,10 @@ class SongsFragment : AbsRecyclerViewCustomGridSizeFragment<SongAdapter, GridLay
it.destroy()
}
}
cab = createCab(R.id.cab_stub) {
cab = createCab(R.id.toolbar_container) {
menu(menuRes)
closeDrawable(R.drawable.ic_close)
backgroundColor(literal = RetroColorUtil.shiftBackgroundColorForLightText(surfaceColor()))
backgroundColor(literal = RetroColorUtil.shiftBackgroundColor(surfaceColor()))
slideDown()
onCreate { cab, menu -> callback.onCabCreated(cab, menu) }
onSelection {

View file

@ -11,7 +11,7 @@
tools:ignore="UnusedAttribute">
<FrameLayout
android:id="@+id/toolbarContainer"
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
@ -22,11 +22,6 @@
android:id="@+id/toolbar"
style="@style/Toolbar"
app:navigationIcon="@drawable/ic_keyboard_backspace_black" />
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
</FrameLayout>
<com.google.android.material.card.MaterialCardView
@ -35,12 +30,12 @@
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="@dimen/mini_player_height"
app:cardCornerRadius="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@+id/content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbarContainer">
app:layout_constraintTop_toBottomOf="@id/toolbar_container">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
@ -55,6 +50,7 @@
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:descendantFocusability="beforeDescendants"
android:fillViewport="true"
android:focusableInTouchMode="true"
@ -63,7 +59,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/albumCoverContainer"
app:layout_constraintTop_toBottomOf="@id/toolbarContainer">
app:layout_constraintTop_toBottomOf="@id/toolbar_container">
<LinearLayout
android:layout_width="match_parent"

View file

@ -10,7 +10,7 @@
tools:ignore="UnusedAttribute">
<FrameLayout
android:id="@+id/toolbarContainer"
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
@ -21,11 +21,6 @@
android:id="@+id/toolbar"
style="@style/Toolbar"
app:navigationIcon="@drawable/ic_keyboard_backspace_black" />
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
</FrameLayout>
@ -35,13 +30,13 @@
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="@dimen/mini_player_height"
android:transitionName="@string/transition_artist_image"
app:cardCornerRadius="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@+id/content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbarContainer">
app:layout_constraintTop_toBottomOf="@id/toolbar_container">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
@ -56,6 +51,7 @@
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
@ -64,7 +60,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/artistCoverContainer"
app:layout_constraintTop_toBottomOf="@id/toolbarContainer">
app:layout_constraintTop_toBottomOf="@id/toolbar_container">
<LinearLayout
android:layout_width="match_parent"

View file

@ -13,6 +13,7 @@
app:liftOnScroll="true">
<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -21,11 +22,6 @@
style="@style/Toolbar"
android:background="?attr/colorSurface"
app:navigationIcon="@drawable/ic_keyboard_backspace_black" />
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
</FrameLayout>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -13,6 +13,7 @@
app:liftOnScroll="true">
<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -21,11 +22,6 @@
style="@style/Toolbar"
android:background="?attr/colorSurface"
app:navigationIcon="@drawable/ic_keyboard_backspace_black" />
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
</FrameLayout>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -14,6 +14,7 @@
app:liftOnScroll="true">
<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
@ -36,11 +37,6 @@
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height" />
</FrameLayout>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -13,6 +13,7 @@
android:fitsSystemWindows="true">
<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
@ -34,11 +35,6 @@
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height" />
</FrameLayout>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -15,6 +15,7 @@
app:liftOnScroll="true">
<FrameLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
@ -26,12 +27,6 @@
android:background="?attr/colorSurface"
app:navigationIcon="@drawable/ic_keyboard_backspace_black"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" />
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
</FrameLayout>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -43,7 +43,7 @@
<style name="Toolbar" parent="Widget.Material3.Toolbar">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">48dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="popupTheme">?toolbarPopupTheme</item>
<item name="android:transitionName" tools:ignore="NewApi">toolbar</item>
<item name="layout_collapseMode">pin</item>

View file

@ -18,9 +18,9 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
jcenter()
}
}