Merge pull request #529 from h4h13/bottomSheet

Refactor from sliding uppanel to bottom sheet
This commit is contained in:
Hemanth S 2019-10-04 18:30:39 +05:30 committed by GitHub
commit 6fc78159d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 241 additions and 142 deletions

View file

@ -31,16 +31,20 @@ import code.name.monkey.retromusic.fragments.player.plain.PlainPlayerFragment
import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment
import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.util.DensityUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.views.BottomNavigationBarTinted import code.name.monkey.retromusic.views.BottomNavigationBarTinted
import com.sothree.slidinguppanel.SlidingUpPanelLayout import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.card.MaterialCardView
import kotlinx.android.synthetic.main.sliding_music_panel_layout.* import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), SlidingUpPanelLayout.PanelSlideListener, AbsPlayerFragment.Callbacks {
abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlayerFragment.Callbacks {
companion object { companion object {
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
} }
private lateinit var bottomSheetBehavior: BottomSheetBehavior<MaterialCardView>
private var miniPlayerFragment: MiniPlayerFragment? = null private var miniPlayerFragment: MiniPlayerFragment? = null
private var playerFragment: AbsPlayerFragment? = null private var playerFragment: AbsPlayerFragment? = null
private var currentNowPlayingScreen: NowPlayingScreen? = null private var currentNowPlayingScreen: NowPlayingScreen? = null
@ -49,11 +53,37 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
private var lightStatusBar: Boolean = false private var lightStatusBar: Boolean = false
private var lightNavigationBar: Boolean = false private var lightNavigationBar: Boolean = false
private var navigationBarColorAnimator: ValueAnimator? = null private var navigationBarColorAnimator: ValueAnimator? = null
protected abstract fun createContentView(): View protected abstract fun createContentView(): View
private val panelState: Int
get() = bottomSheetBehavior.state
private val bottomSheetCallbackList = object : BottomSheetBehavior.BottomSheetCallback() {
override fun onSlide(bottomSheet: View, slideOffset: Float) {
setMiniPlayerAlphaProgress(slideOffset)
}
override fun onStateChanged(bottomSheet: View, newState: Int) {
when (newState) {
BottomSheetBehavior.STATE_HIDDEN -> {
}
BottomSheetBehavior.STATE_EXPANDED -> {
onPanelExpanded()
}
BottomSheetBehavior.STATE_COLLAPSED -> {
onPanelCollapsed()
}
BottomSheetBehavior.STATE_DRAGGING -> {
}
BottomSheetBehavior.STATE_SETTLING -> {
}
else -> {
}
}
}
}
val panelState: SlidingUpPanelLayout.PanelState?
get() = slidingLayout.panelState
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -63,6 +93,10 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
setupSlidingUpPanel() setupSlidingUpPanel()
updateTabs() updateTabs()
bottomSheetBehavior = BottomSheetBehavior.from(slidingPanel)
bottomSheetBehavior.bottomSheetCallback = bottomSheetCallbackList
} }
override fun onResume() { override fun onResume() {
@ -87,18 +121,19 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
} }
fun setAntiDragView(antiDragView: View) { fun setAntiDragView(antiDragView: View) {
slidingLayout.setAntiDragView(antiDragView) //slidingLayout.setAntiDragView(antiDragView)
} }
private fun collapsePanel() { private fun collapsePanel() {
slidingLayout.panelState = SlidingUpPanelLayout.PanelState.COLLAPSED bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
} }
fun expandPanel() { fun expandPanel() {
slidingLayout.panelState = SlidingUpPanelLayout.PanelState.EXPANDED bottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
} }
private fun setMiniPlayerAlphaProgress(progress: Float) { private fun setMiniPlayerAlphaProgress(progress: Float) {
print("Sliding $progress")
if (miniPlayerFragment?.view == null) return if (miniPlayerFragment?.view == null) return
val alpha = 1 - progress val alpha = 1 - progress
miniPlayerFragment?.view?.alpha = alpha miniPlayerFragment?.view?.alpha = alpha
@ -117,44 +152,41 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
super.setLightNavigationBar(lightNavigationBar) super.setLightNavigationBar(lightNavigationBar)
playerFragment!!.setMenuVisibility(false) playerFragment?.setMenuVisibility(false)
playerFragment!!.userVisibleHint = false playerFragment?.userVisibleHint = false
playerFragment!!.onHide() playerFragment?.onHide()
} }
open fun onPanelExpanded() { open fun onPanelExpanded() {
val playerFragmentColor = playerFragment!!.paletteColor val playerFragmentColor = playerFragment!!.paletteColor
super.setTaskDescriptionColor(playerFragmentColor) super.setTaskDescriptionColor(playerFragmentColor)
playerFragment!!.setMenuVisibility(true) playerFragment?.setMenuVisibility(true)
playerFragment!!.userVisibleHint = true playerFragment?.userVisibleHint = true
playerFragment!!.onShow() playerFragment?.onShow()
onPaletteColorChanged() onPaletteColorChanged()
} }
private fun setupSlidingUpPanel() { private fun setupSlidingUpPanel() {
slidingLayout.viewTreeObserver slidingPanel.viewTreeObserver
.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { .addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() { override fun onGlobalLayout() {
slidingLayout.viewTreeObserver.removeOnGlobalLayoutListener(this) slidingPanel.viewTreeObserver.removeOnGlobalLayoutListener(this)
if (currentNowPlayingScreen != PEAK) { if (currentNowPlayingScreen != PEAK) {
val params = slidingPanel.layoutParams as ViewGroup.LayoutParams val params = slidingPanel.layoutParams as ViewGroup.LayoutParams
params.height = ViewGroup.LayoutParams.MATCH_PARENT params.height = ViewGroup.LayoutParams.MATCH_PARENT
slidingPanel.layoutParams = params slidingPanel.layoutParams = params
} }
when (panelState) { /* when (panelState) {
SlidingUpPanelLayout.PanelState.EXPANDED -> { SlidingUpPanelLayout.PanelState.EXPANDED -> {
onPanelSlide(slidingLayout, 1f) onPanelSlide(slidingLayout, 1f)
onPanelExpanded() onPanelExpanded()
} }
SlidingUpPanelLayout.PanelState.COLLAPSED -> onPanelCollapsed() SlidingUpPanelLayout.PanelState.COLLAPSED -> onPanelCollapsed()
else -> playerFragment!!.onHide() else -> playerFragment!!.onHide()
} }*/
} }
}) })
slidingLayout.addPanelSlideListener(this)
} }
fun toggleBottomNavigationView(toggle: Boolean) { fun toggleBottomNavigationView(toggle: Boolean) {
@ -165,16 +197,20 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
return bottomNavigationView return bottomNavigationView
} }
fun hideBottomBar(hide: Boolean) { private fun hideBottomBar(hide: Boolean) {
val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height) val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height)
val heightOfBarWithTabs = resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded) val heightOfBarWithTabs = resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded)
if (hide) { if (hide) {
slidingLayout.panelHeight = 0 bottomSheetBehavior.isHideable = true
bottomSheetBehavior.peekHeight = 0
collapsePanel() collapsePanel()
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
} else { } else {
if (MusicPlayerRemote.playingQueue.isNotEmpty()) { if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
slidingLayout.panelHeight = if (bottomNavigationView.visibility == View.VISIBLE) heightOfBarWithTabs else heightOfBar bottomNavigationView.elevation = 0f
bottomSheetBehavior.isHideable = false
bottomSheetBehavior.peekHeight = if (bottomNavigationView.visibility == View.VISIBLE) heightOfBarWithTabs else heightOfBar
} }
} }
} }
@ -215,10 +251,10 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
override fun onServiceConnected() { override fun onServiceConnected() {
super.onServiceConnected() super.onServiceConnected()
if (!MusicPlayerRemote.playingQueue.isEmpty()) { if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
slidingLayout.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { slidingPanel.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() { override fun onGlobalLayout() {
slidingLayout.viewTreeObserver.removeOnGlobalLayoutListener(this) slidingPanel.viewTreeObserver.removeOnGlobalLayoutListener(this)
hideBottomBar(false) hideBottomBar(false)
} }
}) })
@ -236,20 +272,17 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
} }
open fun handleBackPress(): Boolean { open fun handleBackPress(): Boolean {
if (slidingLayout.panelHeight != 0 && playerFragment!!.onBackPressed()) if (bottomSheetBehavior.peekHeight != 0 && playerFragment!!.onBackPressed())
return true return true
if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) { if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
collapsePanel() collapsePanel()
return true return true
} }
return false return false
} }
override fun onPanelSlide(panel: View?, slideOffset: Float) {
setMiniPlayerAlphaProgress(slideOffset)
}
override fun onPanelStateChanged(panel: View, previousState: SlidingUpPanelLayout.PanelState, newState: SlidingUpPanelLayout.PanelState) { /*override fun onPanelStateChanged(panel: View, previousState: SlidingUpPanelLayout.PanelState, newState: SlidingUpPanelLayout.PanelState) {
when (newState) { when (newState) {
SlidingUpPanelLayout.PanelState.COLLAPSED -> onPanelCollapsed() SlidingUpPanelLayout.PanelState.COLLAPSED -> onPanelCollapsed()
SlidingUpPanelLayout.PanelState.EXPANDED -> onPanelExpanded() SlidingUpPanelLayout.PanelState.EXPANDED -> onPanelExpanded()
@ -257,16 +290,15 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
else -> { else -> {
} }
} }
} }*/
override fun onPaletteColorChanged() { override fun onPaletteColorChanged() {
if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) { if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
val paletteColor = playerFragment!!.paletteColor val paletteColor = playerFragment!!.paletteColor
super.setTaskDescriptionColor(paletteColor) super.setTaskDescriptionColor(paletteColor)
val isColorLight = ColorUtil.isColorLight(paletteColor) val isColorLight = ColorUtil.isColorLight(paletteColor)
if (PreferenceUtil.getInstance(this).adaptiveColor && if (PreferenceUtil.getInstance(this).adaptiveColor &&
(currentNowPlayingScreen == NORMAL || currentNowPlayingScreen == FLAT)) { (currentNowPlayingScreen == NORMAL || currentNowPlayingScreen == FLAT)) {
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
@ -289,21 +321,21 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
override fun setLightStatusbar(enabled: Boolean) { override fun setLightStatusbar(enabled: Boolean) {
lightStatusBar = enabled lightStatusBar = enabled
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
super.setLightStatusbar(enabled) super.setLightStatusbar(enabled)
} }
} }
override fun setLightNavigationBar(enabled: Boolean) { override fun setLightNavigationBar(enabled: Boolean) {
lightNavigationBar = enabled lightNavigationBar = enabled
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
super.setLightNavigationBar(enabled) super.setLightNavigationBar(enabled)
} }
} }
override fun setNavigationbarColor(color: Int) { override fun setNavigationbarColor(color: Int) {
navigationBarColor = color navigationBarColor = color
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel()
super.setNavigationbarColor(color) super.setNavigationbarColor(color)
} }
@ -311,7 +343,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
override fun setTaskDescriptionColor(color: Int) { override fun setTaskDescriptionColor(color: Int) {
taskColor = color taskColor = color
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
super.setTaskDescriptionColor(color) super.setTaskDescriptionColor(color)
} }
} }

View file

@ -1,6 +1,5 @@
package code.name.monkey.retromusic.adapter package code.name.monkey.retromusic.adapter
import android.content.res.ColorStateList
import android.util.DisplayMetrics import android.util.DisplayMetrics
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -9,7 +8,6 @@ import androidx.annotation.IntDef
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.adapter.album.AlbumFullWidthAdapter import code.name.monkey.retromusic.adapter.album.AlbumFullWidthAdapter
import code.name.monkey.retromusic.adapter.artist.ArtistAdapter import code.name.monkey.retromusic.adapter.artist.ArtistAdapter
@ -20,7 +18,7 @@ import code.name.monkey.retromusic.model.Artist
import code.name.monkey.retromusic.model.Home import code.name.monkey.retromusic.model.Home
import code.name.monkey.retromusic.model.Playlist import code.name.monkey.retromusic.model.Playlist
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import com.google.android.material.chip.Chip import com.google.android.material.textview.MaterialTextView
class HomeAdapter( class HomeAdapter(
@ -92,8 +90,8 @@ class HomeAdapter(
recyclerView.apply { recyclerView.apply {
adapter = AlbumFullWidthAdapter(activity, home.arrayList as ArrayList<Album>, displayMetrics) adapter = AlbumFullWidthAdapter(activity, home.arrayList as ArrayList<Album>, displayMetrics)
} }
chip.text = activity.getString(home.title) title.text = activity.getString(home.title)
chip.setChipIconResource(home.icon) text.text = activity.getString(home.subTitle)
} }
} }
@ -104,8 +102,9 @@ class HomeAdapter(
val artistAdapter = ArtistAdapter(activity, home.arrayList as ArrayList<Artist>, PreferenceUtil.getInstance(activity).getHomeGridStyle(context!!), false, null) val artistAdapter = ArtistAdapter(activity, home.arrayList as ArrayList<Artist>, PreferenceUtil.getInstance(activity).getHomeGridStyle(context!!), false, null)
adapter = artistAdapter adapter = artistAdapter
} }
chip.text = activity.getString(home.title)
chip.setChipIconResource(home.icon) title.text = activity.getString(home.title)
text.text = activity.getString(home.subTitle)
} }
} }
@ -118,17 +117,14 @@ class HomeAdapter(
adapter = songAdapter adapter = songAdapter
} }
chip.text = activity.getString(home.title) title.text = activity.getString(home.title)
chip.setChipIconResource(home.icon) text.text = activity.getString(home.subTitle)
} }
} }
private open inner class AbsHomeViewItem(itemView: View) : RecyclerView.ViewHolder(itemView) { private open inner class AbsHomeViewItem(itemView: View) : RecyclerView.ViewHolder(itemView) {
val recyclerView: RecyclerView = itemView.findViewById(R.id.recyclerView) val recyclerView: RecyclerView = itemView.findViewById(R.id.recyclerView)
val chip: Chip = itemView.findViewById(R.id.chipHead) val title: MaterialTextView = itemView.findViewById(R.id.title)
val text: MaterialTextView = itemView.findViewById(R.id.text)
init {
chip.apply { chipBackgroundColor = ColorStateList.valueOf(ThemeStore.primaryColor(context)) }
}
} }
} }

View file

@ -9,7 +9,6 @@ import androidx.annotation.StringRes
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.util.DensityUtil import code.name.monkey.retromusic.util.DensityUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
@ -64,10 +63,7 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
} }
private fun checkForPadding() { private fun checkForPadding() {
val height = if (MusicPlayerRemote.playingQueue.isEmpty()) val height = DensityUtil.dip2px(requireContext(), 52f)
DensityUtil.dip2px(context!!, 52f)
else
0
recyclerView.setPadding(0, 0, 0, (height * 2.3).toInt()) recyclerView.setPadding(0, 0, 0, (height * 2.3).toInt())
} }

View file

@ -151,11 +151,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
} }
private fun checkPadding() { private fun checkPadding() {
val marginSpan = when { val marginSpan = DensityUtil.dip2px(requireContext(), 52f)
MusicPlayerRemote.playingQueue.isEmpty() -> RetroUtil.convertDpToPixel(52f, context!!).toInt()
else -> RetroUtil.convertDpToPixel(0f, requireContext()).toInt()
}
(recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt() (recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt()
} }

View file

@ -72,7 +72,7 @@ interface HomePresenter : Presenter<HomeView> {
if (it.isNotEmpty()) hashSet.add( if (it.isNotEmpty()) hashSet.add(
Home(0, Home(0,
R.string.recent_artists, R.string.recent_artists,
0, R.string.recent_added_artists,
it, it,
RECENT_ARTISTS, RECENT_ARTISTS,
R.drawable.ic_artist_white_24dp R.drawable.ic_artist_white_24dp
@ -87,7 +87,7 @@ interface HomePresenter : Presenter<HomeView> {
if (it.isNotEmpty()) hashSet.add( if (it.isNotEmpty()) hashSet.add(
Home(1, Home(1,
R.string.recent_albums, R.string.recent_albums,
0, R.string.recent_added_albums,
it, it,
RECENT_ALBUMS, RECENT_ALBUMS,
R.drawable.ic_album_white_24dp R.drawable.ic_album_white_24dp
@ -102,7 +102,7 @@ interface HomePresenter : Presenter<HomeView> {
if (it.isNotEmpty()) hashSet.add( if (it.isNotEmpty()) hashSet.add(
Home(2, Home(2,
R.string.top_artists, R.string.top_artists,
0, R.string.most_played_artists,
it, it,
TOP_ARTISTS, TOP_ARTISTS,
R.drawable.ic_artist_white_24dp R.drawable.ic_artist_white_24dp
@ -117,7 +117,7 @@ interface HomePresenter : Presenter<HomeView> {
if (it.isNotEmpty()) hashSet.add( if (it.isNotEmpty()) hashSet.add(
Home(3, Home(3,
R.string.top_albums, R.string.top_albums,
0, R.string.most_played_albums,
it, it,
TOP_ALBUMS, TOP_ALBUMS,
R.drawable.ic_album_white_24dp R.drawable.ic_album_white_24dp
@ -132,7 +132,7 @@ interface HomePresenter : Presenter<HomeView> {
if (it.isNotEmpty()) hashSet.add( if (it.isNotEmpty()) hashSet.add(
Home(4, Home(4,
R.string.favorites, R.string.favorites,
0, R.string.favorites_songs,
it, it,
PLAYLISTS, PLAYLISTS,
R.drawable.ic_favorite_white_24dp R.drawable.ic_favorite_white_24dp

View file

@ -33,9 +33,10 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorOnBackground" android:background="?colorPrimary"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView

View file

@ -34,9 +34,10 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorOnBackground" android:background="?colorPrimary"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView

View file

@ -35,9 +35,10 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorOnBackground" android:background="?colorPrimary"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView

View file

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="112dp" android:layout_width="106dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:orientation="vertical"> android:orientation="vertical">
@ -27,7 +27,6 @@
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:paddingTop="12dp" android:paddingTop="12dp"
android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?colorOnPrimary"
tools:text="Name" /> tools:text="Name" />
</LinearLayout> </LinearLayout>

View file

@ -89,7 +89,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textAppearance="@style/TextViewBody2"
android:textColor="?colorOnBackground" android:textColor="?colorOnBackground"
tools:text="Song artist name " /> tools:text="Song artist name " />
</LinearLayout> </LinearLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -7,28 +7,61 @@
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="12dp"> android:paddingBottom="12dp">
<code.name.monkey.retromusic.views.RetroChip <LinearLayout
android:id="@+id/chipHead" android:id="@+id/titleContainer"
style="@style/Widget.MaterialComponents.Chip.Action" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:gravity="center_vertical"
android:layout_marginBottom="12dp" android:orientation="horizontal"
android:layout_marginStart="@dimen/horizontal_padding_home" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="@dimen/horizontal_padding_home" app:layout_constraintStart_toStartOf="parent"
android:textAppearance="@style/ChipFont" app:layout_constraintTop_toTopOf="parent">
android:textColor="?android:textColorSecondary"
app:chipIconTint="?iconColor" <LinearLayout
app:chipStrokeColor="?dividerColor" android:layout_width="match_parent"
app:chipStrokeWidth="1dp" android:layout_height="wrap_content"
app:iconStartPadding="8dp" android:layout_weight="1"
tools:chipIcon="@drawable/ic_person_white_24dp" android:orientation="vertical"
tools:text="@string/for_you" /> android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold"
tools:text="@tools:sample/full_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewCaption"
tools:text="@tools:sample/full_names" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_keyboard_arrow_right_white_24dp"
app:tint="@color/ate_primary_text_light" />
</LinearLayout>
<code.name.monkey.retromusic.views.MetalRecyclerViewPager <code.name.monkey.retromusic.views.MetalRecyclerViewPager
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
app:itemMargin="28dp" /> app:itemMargin="28dp"
</LinearLayout> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recentArtistContainer" android:id="@+id/recentArtistContainer"
@ -7,28 +7,62 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<code.name.monkey.retromusic.views.RetroChip <LinearLayout
android:id="@+id/chipHead" android:id="@+id/titleContainer"
style="@style/Widget.MaterialComponents.Chip.Action" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/horizontal_padding_home" android:gravity="center_vertical"
android:layout_marginTop="12dp" android:orientation="horizontal"
android:layout_marginEnd="@dimen/horizontal_padding_home" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="12dp" app:layout_constraintStart_toStartOf="parent"
android:textAppearance="@style/ChipFont" app:layout_constraintTop_toTopOf="parent">
android:textColor="?android:textColorSecondary"
app:chipIconTint="?iconColor" <LinearLayout
app:chipStrokeColor="?dividerColor" android:layout_width="match_parent"
app:chipStrokeWidth="1dp" android:layout_height="wrap_content"
app:iconStartPadding="8dp" android:layout_weight="1"
tools:chipIcon="@drawable/ic_person_white_24dp" android:orientation="vertical"
tools:text="@string/for_you" /> android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold"
tools:text="@tools:sample/full_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewCaption"
tools:text="@tools:sample/full_names" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_keyboard_arrow_right_white_24dp"
app:tint="@color/ate_primary_text_light" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" /> android:layout_marginTop="16dp"
android:nestedScrollingEnabled="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer" />
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -6,7 +6,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" <!--<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/slidingLayout" android:id="@+id/slidingLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -14,34 +14,40 @@
sothree:umanoOverlay="false" sothree:umanoOverlay="false"
sothree:umanoPanelHeight="0dp" sothree:umanoPanelHeight="0dp"
sothree:umanoScrollableView="@+id/recycler_view" sothree:umanoScrollableView="@+id/recycler_view"
sothree:umanoShadowHeight="0dp"> sothree:umanoShadowHeight="0dp">-->
<FrameLayout
android:id="@+id/mainContentFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/slidingPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:behavior_hideable="false"
app:behavior_peekHeight="0dp"
app:cardElevation="0dp"
app:cardUseCompatPadding="false"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<FrameLayout <FrameLayout
android:id="@+id/mainContentFrame" android:id="@+id/playerFragmentContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:layout_weight="1" />
<FrameLayout <fragment
android:id="@+id/slidingPanel" android:id="@+id/miniPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.MiniPlayerFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="48dp"
tools:layout="@layout/fragment_mini_player" />
<FrameLayout </com.google.android.material.card.MaterialCardView>
android:id="@+id/playerFragmentContainer" <!-- </com.sothree.slidinguppanel.SlidingUpPanelLayout>-->
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
android:id="@+id/miniPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.MiniPlayerFragment"
android:layout_width="match_parent"
android:layout_height="48dp"
tools:layout="@layout/fragment_mini_player" />
</FrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
<code.name.monkey.retromusic.views.BottomNavigationBarTinted <code.name.monkey.retromusic.views.BottomNavigationBarTinted
android:id="@+id/bottomNavigationView" android:id="@+id/bottomNavigationView"
@ -50,7 +56,7 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="?colorSecondary" android:background="?colorSecondary"
android:elevation="0dp" android:elevation="0dp"
app:elevation="0dp" android:visibility="gone"
app:itemIconTint="@drawable/bottom_navigation_item_colors" app:itemIconTint="@drawable/bottom_navigation_item_colors"
app:itemTextAppearanceActive="@style/BottomSheetItemTextAppearanceActive" app:itemTextAppearanceActive="@style/BottomSheetItemTextAppearanceActive"
app:itemTextAppearanceInactive="@style/BottomSheetItemTextAppearanceInactive" app:itemTextAppearanceInactive="@style/BottomSheetItemTextAppearanceInactive"

View file

@ -659,4 +659,9 @@
<string name="action_toggle_favorite">Toggle favorite</string> <string name="action_toggle_favorite">Toggle favorite</string>
<string name="pref_dialog_corner_title">Dialog corner</string> <string name="pref_dialog_corner_title">Dialog corner</string>
<string name="peak">Peak</string> <string name="peak">Peak</string>
<string name="recent_added_artists">Recently added artists</string>
<string name="recent_added_albums">Recently added albums</string>
<string name="most_played_artists">Most played artists</string>
<string name="most_played_albums">Most played albums</string>
<string name="favorites_songs">You\'re most favorites songs</string>
</resources> </resources>