Better Edge-to-edge support & fixed some visual glitches
This commit is contained in:
parent
50c7d4aeb7
commit
e0b3960374
27 changed files with 124 additions and 73 deletions
|
@ -129,7 +129,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
|||
if (RetroUtil.isLandscape()) {
|
||||
binding.slidingPanel.drawAboveSystemBarsWithPadding(true)
|
||||
}
|
||||
binding.fragmentContainer.addBottomInsets()
|
||||
chooseFragmentForTheme()
|
||||
setupSlidingUpPanel()
|
||||
setupBottomSheet()
|
||||
|
@ -350,7 +349,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
|||
binding.bottomNavigationView.translationY = 0F
|
||||
}
|
||||
binding.bottomNavigationView.bringToFront()
|
||||
libraryViewModel.setFabMargin(heightOfBarWithTabs - 2 * windowInsets.safeGetBottomInsets())
|
||||
libraryViewModel.setFabMargin(dip(R.dimen.mini_player_height_expanded))
|
||||
} else {
|
||||
println("Details")
|
||||
if (animate) {
|
||||
|
@ -367,7 +366,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
|||
dip(R.dimen.bottom_nav_height).toFloat()
|
||||
binding.slidingPanel.bringToFront()
|
||||
}
|
||||
libraryViewModel.setFabMargin(heightOfBar - 2 * windowInsets.safeGetBottomInsets())
|
||||
libraryViewModel.setFabMargin(dip(R.dimen.mini_player_height))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ import code.name.monkey.retromusic.util.RetroColorUtil.getColor
|
|||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.request.target.ImageViewTarget
|
||||
import com.bumptech.glide.request.transition.Transition
|
||||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
import org.jaudiotagger.tag.FieldKey
|
||||
import java.util.*
|
||||
|
||||
|
@ -101,8 +102,9 @@ class AlbumTagEditorActivity : AbsTagEditorActivity<ActivityAlbumTagEditorBindin
|
|||
private var deleteAlbumArt: Boolean = false
|
||||
|
||||
private fun setupToolbar() {
|
||||
binding.toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorSurface))
|
||||
setSupportActionBar(binding.toolbar)
|
||||
binding.appBarLayout?.statusBarForeground =
|
||||
MaterialShapeDrawable.createWithElevationOverlay(this)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -21,13 +21,12 @@ import android.text.Editable
|
|||
import android.text.TextWatcher
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.ImageView
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.databinding.ActivitySongTagEditorBinding
|
||||
import code.name.monkey.retromusic.extensions.appHandleColor
|
||||
import code.name.monkey.retromusic.extensions.setTint
|
||||
import code.name.monkey.retromusic.repository.SongRepository
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
import org.jaudiotagger.tag.FieldKey
|
||||
import org.koin.android.ext.android.inject
|
||||
import java.util.*
|
||||
|
@ -44,8 +43,9 @@ class SongTagEditorActivity : AbsTagEditorActivity<ActivitySongTagEditorBinding>
|
|||
super.onCreate(savedInstanceState)
|
||||
setUpViews()
|
||||
setNoImageMode()
|
||||
binding.toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorSurface))
|
||||
setSupportActionBar(binding.toolbar)
|
||||
binding.appBarLayout.statusBarForeground =
|
||||
MaterialShapeDrawable.createWithElevationOverlay(this)
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
|
|
|
@ -237,6 +237,6 @@ data class InitialPadding(
|
|||
val right: Int, val bottom: Int
|
||||
)
|
||||
|
||||
private fun recordInitialPaddingForView(view: View) = InitialPadding(
|
||||
fun recordInitialPaddingForView(view: View) = InitialPadding(
|
||||
view.paddingLeft, view.paddingTop, view.paddingRight, view.paddingBottom
|
||||
)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
*/
|
||||
package code.name.monkey.retromusic.fragments
|
||||
|
||||
import android.animation.ValueAnimator
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.*
|
||||
import code.name.monkey.retromusic.*
|
||||
|
@ -42,7 +43,7 @@ class LibraryViewModel(
|
|||
private val legacyPlaylists = MutableLiveData<List<Playlist>>()
|
||||
private val genres = MutableLiveData<List<Genre>>()
|
||||
private val searchResults = MutableLiveData<List<Any>>()
|
||||
private val fabMargin = MutableLiveData(0)
|
||||
private val fabMargin = MutableLiveData<Int>(0)
|
||||
val paletteColor: LiveData<Int> = _paletteColor
|
||||
|
||||
init {
|
||||
|
@ -337,12 +338,19 @@ class LibraryViewModel(
|
|||
}
|
||||
|
||||
fun setFabMargin(bottomMargin: Int) {
|
||||
fabMargin.postValue(
|
||||
// Normal Margin
|
||||
DensityUtil.dip2px(App.getContext(), 16F) +
|
||||
val currentValue = DensityUtil.dip2px(App.getContext(), 16F) +
|
||||
bottomMargin
|
||||
if (currentValue != fabMargin.value) {
|
||||
ValueAnimator.ofInt(fabMargin.value!!, currentValue).apply {
|
||||
addUpdateListener {
|
||||
fabMargin.postValue(
|
||||
it.animatedValue as Int
|
||||
)
|
||||
}
|
||||
start()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum class ReloadType {
|
||||
|
|
|
@ -49,7 +49,7 @@ class AboutFragment : Fragment(R.layout.fragment_about), View.OnClickListener {
|
|||
// insets are not passed to child views
|
||||
// https://github.com/material-components/material-components-android/issues/1310
|
||||
if (!RetroUtil.isLandscape()) {
|
||||
binding.root.updatePadding(bottom = RetroUtil.getNavigationBarHeight())
|
||||
binding.aboutContent.root.updatePadding(bottom = RetroUtil.getNavigationBarHeight())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import androidx.appcompat.widget.Toolbar
|
|||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity
|
||||
|
@ -161,11 +160,9 @@ abstract class AbsRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : Recycle
|
|||
val itemCount: Int = adapter?.itemCount ?: 0
|
||||
|
||||
if (itemCount > 0 && MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
||||
val height = dip(R.dimen.mini_player_height_expanded)
|
||||
binding.recyclerView.updatePadding(0, 0, 0, height)
|
||||
binding.recyclerView.updatePadding(bottom = dip(R.dimen.mini_player_height_expanded))
|
||||
} else {
|
||||
val height = dip(R.dimen.mini_player_height)
|
||||
binding.recyclerView.updatePadding(0, 0, 0, height)
|
||||
binding.recyclerView.updatePadding(bottom = dip(R.dimen.mini_player_height))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de
|
|||
override fun onChanged() {
|
||||
super.onChanged()
|
||||
val height = dipToPix(52f)
|
||||
binding.recyclerView.setPadding(0, 0, 0, height.toInt())
|
||||
binding.recyclerView.updatePadding(bottom = height.toInt())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de
|
|||
if (RetroUtil.isTablet()) {
|
||||
return if (RetroUtil.isLandscape()) 6 else 4
|
||||
}
|
||||
return 2
|
||||
return if (RetroUtil.isLandscape()) 4 else 2
|
||||
}
|
||||
|
||||
override fun onArtist(artistId: Long, view: View) {
|
||||
|
|
|
@ -379,6 +379,7 @@ class LyricsFragment : AbsMusicServiceFragment(R.layout.fragment_lyrics) {
|
|||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
if (MusicPlayerRemote.playingQueue.isNotEmpty())
|
||||
(requireActivity() as MainActivity).expandPanel()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,9 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.MainActivity
|
||||
import code.name.monkey.retromusic.adapter.song.PlayingQueueAdapter
|
||||
import code.name.monkey.retromusic.databinding.FragmentPlayingQueueBinding
|
||||
import code.name.monkey.retromusic.extensions.accentColor
|
||||
|
@ -172,6 +174,8 @@ class PlayingQueueFragment : AbsMusicServiceFragment(R.layout.fragment_playing_q
|
|||
}
|
||||
playingQueueAdapter = null
|
||||
super.onDestroy()
|
||||
if (MusicPlayerRemote.playingQueue.isNotEmpty())
|
||||
(requireActivity() as MainActivity).expandPanel()
|
||||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
|
@ -191,6 +195,7 @@ class PlayingQueueFragment : AbsMusicServiceFragment(R.layout.fragment_playing_q
|
|||
findNavController().navigateUp()
|
||||
}
|
||||
setNavigationIcon(R.drawable.ic_keyboard_backspace_black)
|
||||
ToolbarContentTintHelper.colorBackButton(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil
|
|||
import code.name.monkey.retromusic.views.addAlpha
|
||||
import com.google.android.material.chip.Chip
|
||||
import com.google.android.material.chip.ChipGroup
|
||||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import com.google.android.material.transition.MaterialSharedAxis
|
||||
import java.util.*
|
||||
|
@ -96,6 +97,8 @@ class SearchFragment : AbsMainActivityFragment(R.layout.fragment_search), TextWa
|
|||
bottomMargin = it
|
||||
}
|
||||
})
|
||||
binding.appBarLayout.statusBarForeground =
|
||||
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
|
||||
}
|
||||
|
||||
private fun setupChips() {
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package code.name.monkey.retromusic.views.insets
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.WindowInsets
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import code.name.monkey.retromusic.extensions.drawAboveSystemBarsWithPadding
|
||||
import code.name.monkey.retromusic.extensions.recordInitialPaddingForView
|
||||
import code.name.monkey.retromusic.extensions.requestApplyInsetsWhenAttached
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import com.afollestad.materialdialogs.utils.MDUtil.updatePadding
|
||||
|
||||
class InsetsConstraintLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
init {
|
||||
if (!RetroUtil.isLandscape())
|
||||
drawAboveSystemBarsWithPadding()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package code.name.monkey.retromusic.views.insets
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.annotation.Px
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.retromusic.extensions.drawAboveSystemBarsWithPadding
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
|
||||
class InsetsRecyclerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RecyclerView(context, attrs, defStyleAttr) {
|
||||
init {
|
||||
if (!RetroUtil.isLandscape())
|
||||
drawAboveSystemBarsWithPadding()
|
||||
}
|
||||
|
||||
fun updatePadding(
|
||||
@Px left: Int = paddingLeft,
|
||||
@Px top: Int = paddingTop,
|
||||
@Px right: Int = paddingRight,
|
||||
@Px bottom: Int = paddingBottom
|
||||
) {
|
||||
setPadding(left, top, right, bottom)
|
||||
if (!RetroUtil.isLandscape())
|
||||
drawAboveSystemBarsWithPadding()
|
||||
}
|
||||
}
|
|
@ -66,7 +66,7 @@
|
|||
android:transitionGroup="true"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout
|
||||
android:id="@+id/contentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -152,6 +152,6 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageContainer" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -59,14 +59,12 @@
|
|||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/toolbar_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
|
||||
android:descendantFocusability="beforeDescendants"
|
||||
android:focusableInTouchMode="true"
|
||||
android:transitionGroup="true"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout
|
||||
android:id="@+id/contentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -119,6 +117,6 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleWelcome" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -5,8 +5,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UnusedAttribute">
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<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"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface"
|
||||
android:fitsSystemWindows="true"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true">
|
||||
|
@ -20,8 +18,7 @@
|
|||
style="@style/Toolbar"
|
||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black"
|
||||
app:title="@string/action_tag_editor"
|
||||
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout 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"
|
||||
|
@ -197,4 +197,4 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/listeners" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout 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"
|
||||
|
@ -192,4 +192,4 @@
|
|||
android:layout_height="72dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/listeners" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
|
|
@ -63,7 +63,7 @@
|
|||
android:focusableInTouchMode="true"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout
|
||||
android:id="@+id/contentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -149,6 +149,6 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageContainer" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -77,7 +77,7 @@
|
|||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<code.name.monkey.retromusic.views.insets.InsetsRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
android:focusableInTouchMode="true"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout
|
||||
android:id="@+id/contentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -116,7 +116,7 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/titleWelcome" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -38,7 +38,7 @@
|
|||
</FrameLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<code.name.monkey.retromusic.views.insets.InsetsRecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</FrameLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<code.name.monkey.retromusic.views.insets.InsetsRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -4,21 +4,20 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorSurface"
|
||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black"
|
||||
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal">
|
||||
|
||||
|
@ -30,7 +29,7 @@
|
|||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/searchView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="@string/action_search"
|
||||
|
@ -70,14 +69,6 @@
|
|||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:orientation="vertical">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -128,18 +119,16 @@
|
|||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</HorizontalScrollView>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<code.name.monkey.retromusic.views.insets.InsetsRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@android:id/empty"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:fitsSystemWindows="true"
|
||||
app:liftOnScroll="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<code.name.monkey.retromusic.views.insets.InsetsConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
|
@ -85,7 +85,7 @@
|
|||
tools:text="@tools:sample/full_names" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</code.name.monkey.retromusic.views.insets.InsetsConstraintLayout>
|
||||
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
|
|
|
@ -307,7 +307,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
|
|||
}
|
||||
|
||||
private fun isMD3Enabled(context: Context): Boolean {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(ThemeStorePrefKeys.KEY_MATERIAL_YOU, false)
|
||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(ThemeStorePrefKeys.KEY_MATERIAL_YOU, VersionUtils.hasS())
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue