Refactor from sliding uppanel to bottom sheet
This commit is contained in:
parent
6f362e1ab7
commit
a4f7c99f61
14 changed files with 241 additions and 142 deletions
|
@ -9,7 +9,6 @@ import androidx.annotation.StringRes
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
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.ViewUtil
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
|
@ -64,10 +63,7 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
|||
}
|
||||
|
||||
private fun checkForPadding() {
|
||||
val height = if (MusicPlayerRemote.playingQueue.isEmpty())
|
||||
DensityUtil.dip2px(context!!, 52f)
|
||||
else
|
||||
0
|
||||
val height = DensityUtil.dip2px(requireContext(), 52f)
|
||||
recyclerView.setPadding(0, 0, 0, (height * 2.3).toInt())
|
||||
}
|
||||
|
||||
|
|
|
@ -151,11 +151,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
}
|
||||
|
||||
private fun checkPadding() {
|
||||
val marginSpan = when {
|
||||
MusicPlayerRemote.playingQueue.isEmpty() -> RetroUtil.convertDpToPixel(52f, context!!).toInt()
|
||||
else -> RetroUtil.convertDpToPixel(0f, requireContext()).toInt()
|
||||
}
|
||||
|
||||
val marginSpan = DensityUtil.dip2px(requireContext(), 52f)
|
||||
(recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue