Add scroll helper
This commit is contained in:
parent
b42303f33a
commit
1c0a426805
37 changed files with 312 additions and 268 deletions
|
@ -183,4 +183,5 @@ dependencies {
|
||||||
implementation 'com.google.android.play:core:1.7.2'
|
implementation 'com.google.android.play:core:1.7.2'
|
||||||
implementation 'me.jorgecastillo:androidcolorx:0.2.0'
|
implementation 'me.jorgecastillo:androidcolorx:0.2.0'
|
||||||
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
|
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
|
||||||
|
implementation 'com.github.ologe:scroll-helper:2.0.0-beta01'
|
||||||
}
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package code.name.monkey.retromusic
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import androidx.viewpager2.widget.ViewPager2
|
||||||
|
import code.name.monkey.retromusic.fragments.player.normal.PlayerFragment
|
||||||
|
import dev.olog.scrollhelper.ScrollHelper
|
||||||
|
|
||||||
|
class RetroScrollHelper(
|
||||||
|
private val activity: FragmentActivity
|
||||||
|
) : ScrollHelper(
|
||||||
|
activity,
|
||||||
|
true,
|
||||||
|
false // TODO when true, scrolls both bottomsheet and bottom navigation
|
||||||
|
) {
|
||||||
|
private val skipFragment = listOf(
|
||||||
|
PlayerFragment::class.java.name
|
||||||
|
)
|
||||||
|
|
||||||
|
// TODO every fragment has to have it's unique tag in order to work correctly
|
||||||
|
// here you can decide what fragment will be processed by the library
|
||||||
|
// probably you want to skip player fragments, ecc ..
|
||||||
|
override fun shouldSkipFragment(fragment: Fragment): Boolean {
|
||||||
|
return fragment::class.java.name in skipFragment
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findBottomNavigation(): View? {
|
||||||
|
return activity.findViewById(R.id.bottomNavigationView)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findBottomSheet(): View? {
|
||||||
|
return activity.findViewById(R.id.slidingPanel)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findFab(fragment: Fragment): View? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findRecyclerView(fragment: Fragment): RecyclerView? {
|
||||||
|
return fragment.requireView().findViewById(R.id.recyclerView)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findToolbar(fragment: Fragment): View? {
|
||||||
|
return fragment.requireActivity().findViewById(R.id.toolbar)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findTabLayout(fragment: Fragment): View? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun findViewPager(fragment: Fragment): ViewPager2? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO override this if you want to apply custom padding
|
||||||
|
override fun updateRecyclerViewPadding(
|
||||||
|
fragment: Fragment,
|
||||||
|
recyclerView: RecyclerView,
|
||||||
|
topPadding: Int,
|
||||||
|
bottomPadding: Int
|
||||||
|
) {
|
||||||
|
super.updateRecyclerViewPadding(fragment, recyclerView, topPadding, bottomPadding)
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,7 +39,6 @@ import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.afollestad.materialcab.MaterialCab;
|
import com.afollestad.materialcab.MaterialCab;
|
||||||
import com.afollestad.materialcab.MaterialCab.Callback;
|
import com.afollestad.materialcab.MaterialCab.Callback;
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.google.android.play.core.appupdate.AppUpdateInfo;
|
import com.google.android.play.core.appupdate.AppUpdateInfo;
|
||||||
import com.google.android.play.core.appupdate.AppUpdateManager;
|
import com.google.android.play.core.appupdate.AppUpdateManager;
|
||||||
|
@ -61,14 +60,15 @@ import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
|
import code.name.monkey.retromusic.RetroScrollHelper;
|
||||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity;
|
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity;
|
||||||
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
|
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
|
||||||
import code.name.monkey.retromusic.fragments.albums.AlbumsFragment;
|
import code.name.monkey.retromusic.fragments.albums.AlbumsFragment;
|
||||||
import code.name.monkey.retromusic.fragments.artists.ArtistsFragment;
|
import code.name.monkey.retromusic.fragments.artists.ArtistsFragment;
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
||||||
|
import code.name.monkey.retromusic.fragments.folder.FoldersFragment;
|
||||||
import code.name.monkey.retromusic.fragments.genres.GenresFragment;
|
import code.name.monkey.retromusic.fragments.genres.GenresFragment;
|
||||||
import code.name.monkey.retromusic.fragments.home.BannerHomeFragment;
|
import code.name.monkey.retromusic.fragments.home.BannerHomeFragment;
|
||||||
import code.name.monkey.retromusic.fragments.mainactivity.FoldersFragment;
|
|
||||||
import code.name.monkey.retromusic.fragments.playlists.PlaylistsFragment;
|
import code.name.monkey.retromusic.fragments.playlists.PlaylistsFragment;
|
||||||
import code.name.monkey.retromusic.fragments.queue.PlayingQueueFragment;
|
import code.name.monkey.retromusic.fragments.queue.PlayingQueueFragment;
|
||||||
import code.name.monkey.retromusic.fragments.songs.SongsFragment;
|
import code.name.monkey.retromusic.fragments.songs.SongsFragment;
|
||||||
|
@ -89,13 +89,13 @@ import code.name.monkey.retromusic.util.NavigationUtil;
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroColorUtil;
|
import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroUtil;
|
import code.name.monkey.retromusic.util.RetroUtil;
|
||||||
|
import dev.olog.scrollhelper.ScrollHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by hemanths on 2020-02-19.
|
* Created by hemanths on 2020-02-19.
|
||||||
*/
|
*/
|
||||||
public class MainActivity extends AbsSlidingMusicPanelActivity
|
public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
implements CabHolder, SharedPreferences.OnSharedPreferenceChangeListener {
|
implements CabHolder, SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
public static final String TAG = MainActivity.class.getSimpleName();
|
public static final String TAG = MainActivity.class.getSimpleName();
|
||||||
public static final int APP_INTRO_REQUEST = 100;
|
public static final int APP_INTRO_REQUEST = 100;
|
||||||
public static final String EXPAND_PANEL = "expand_panel";
|
public static final String EXPAND_PANEL = "expand_panel";
|
||||||
|
@ -115,10 +115,11 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@SuppressWarnings("FieldCanBeLocal")
|
||||||
|
private ScrollHelper scrollHelper;
|
||||||
private MainActivityFragmentCallbacks currentFragment;
|
private MainActivityFragmentCallbacks currentFragment;
|
||||||
private boolean blockRequestPermissions = false;
|
private boolean blockRequestPermissions = false;
|
||||||
private MaterialCab cab;
|
private MaterialCab cab;
|
||||||
private AppBarLayout mAppBarLayout;
|
|
||||||
private Toolbar mToolbar;
|
private Toolbar mToolbar;
|
||||||
private AppUpdateManager appUpdateManager;
|
private AppUpdateManager appUpdateManager;
|
||||||
InstallStateUpdatedListener listener = new InstallStateUpdatedListener() {
|
InstallStateUpdatedListener listener = new InstallStateUpdatedListener() {
|
||||||
|
@ -163,7 +164,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
mToolbar = findViewById(R.id.toolbar);
|
||||||
mAppBarLayout = findViewById(R.id.appBarLayout);
|
|
||||||
|
|
||||||
//checkShowChangelog();
|
//checkShowChangelog();
|
||||||
AppRater.appLaunched(this);
|
AppRater.appLaunched(this);
|
||||||
|
@ -177,7 +177,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
selectedFragment(item.getItemId());
|
selectedFragment(item.getItemId());
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
mIntentFilter.addAction(MusicService.MEDIA_STORE_CHANGED);
|
scrollHelper = new RetroScrollHelper(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -253,14 +253,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
PreferenceUtil.getInstance(this).unregisterOnSharedPreferenceChangedListener(this);
|
PreferenceUtil.getInstance(this).unregisterOnSharedPreferenceChangedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addOnAppBarOffsetChangedListener(
|
|
||||||
@NonNull AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
|
||||||
mAppBarLayout.addOnOffsetChangedListener(onOffsetChangedListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTotalAppBarScrollingRange() {
|
|
||||||
return mAppBarLayout.getTotalScrollRange();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleBackPress() {
|
public boolean handleBackPress() {
|
||||||
|
@ -405,11 +397,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
return cab;
|
return cab;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeOnAppBarOffsetChangedListener(
|
|
||||||
@NonNull AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
|
||||||
mAppBarLayout.removeOnOffsetChangedListener(onOffsetChangedListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrentFragment(@NonNull Fragment fragment, @NonNull String tag) {
|
public void setCurrentFragment(@NonNull Fragment fragment, @NonNull String tag) {
|
||||||
String currentTag = null;
|
String currentTag = null;
|
||||||
if (getSupportFragmentManager().findFragmentByTag(tag) != null) {
|
if (getSupportFragmentManager().findFragmentByTag(tag) != null) {
|
||||||
|
@ -830,7 +817,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
private void setupToolbar() {
|
private void setupToolbar() {
|
||||||
setTitle(null);
|
setTitle(null);
|
||||||
mToolbar.setBackgroundColor(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface));
|
mToolbar.setBackgroundColor(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface));
|
||||||
mAppBarLayout.setBackgroundColor(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface));
|
|
||||||
setSupportActionBar(mToolbar);
|
setSupportActionBar(mToolbar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,9 +212,9 @@ class SkuDetailsAdapter(
|
||||||
val titleTextColor = if (purchased) ATHUtil.resolveColor(
|
val titleTextColor = if (purchased) ATHUtil.resolveColor(
|
||||||
donationsDialog,
|
donationsDialog,
|
||||||
android.R.attr.textColorHint
|
android.R.attr.textColorHint
|
||||||
) else textColorPrimary(donationsDialog)
|
) else donationsDialog.textColorPrimary()
|
||||||
val contentTextColor =
|
val contentTextColor =
|
||||||
if (purchased) titleTextColor else textColorSecondary(donationsDialog)
|
if (purchased) titleTextColor else donationsDialog.textColorSecondary()
|
||||||
|
|
||||||
viewHolder.title.setTextColor(titleTextColor)
|
viewHolder.title.setTextColor(titleTextColor)
|
||||||
viewHolder.text.setTextColor(contentTextColor)
|
viewHolder.text.setTextColor(contentTextColor)
|
||||||
|
|
|
@ -127,10 +127,14 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
behavior.removeBottomSheetCallback(bottomSheetCallbackList)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
behavior.removeBottomSheetCallback(bottomSheetCallbackList)
|
navigationBarColorAnimator?.cancel()
|
||||||
if (navigationBarColorAnimator != null) navigationBarColorAnimator?.cancel() // just in case
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View {
|
protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View {
|
||||||
|
@ -158,7 +162,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
// necessary to make the views below clickable
|
// necessary to make the views below clickable
|
||||||
miniPlayerFragment?.view?.visibility = if (alpha == 0f) View.GONE else View.VISIBLE
|
miniPlayerFragment?.view?.visibility = if (alpha == 0f) View.GONE else View.VISIBLE
|
||||||
|
|
||||||
bottomNavigationView.translationY = progress * 500
|
//bottomNavigationView.translationY = progress * 500
|
||||||
//bottomNavigationView.alpha = alpha
|
//bottomNavigationView.alpha = alpha
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,4 +391,5 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
bottomNavigationView.hide()
|
bottomNavigationView.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -17,7 +17,9 @@ package code.name.monkey.retromusic.extensions
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.view.View
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
@ -31,10 +33,26 @@ fun Context.accentColor(): Int {
|
||||||
return ThemeStore.accentColor(this)
|
return ThemeStore.accentColor(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun View.accentColor(): Int {
|
||||||
|
return ThemeStore.accentColor(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Fragment.accentColor(): Int {
|
||||||
|
return ThemeStore.accentColor(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
fun Context.surfaceColor(): Int {
|
fun Context.surfaceColor(): Int {
|
||||||
return ATHUtil.resolveColor(this, R.attr.colorSurface, Color.WHITE)
|
return ATHUtil.resolveColor(this, R.attr.colorSurface, Color.WHITE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun View.surfaceColor(): Int {
|
||||||
|
return ATHUtil.resolveColor(context, R.attr.colorSurface, Color.WHITE)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Fragment.surfaceColor(): Int {
|
||||||
|
return ATHUtil.resolveColor(requireContext(), R.attr.colorSurface, Color.WHITE)
|
||||||
|
}
|
||||||
|
|
||||||
fun Toolbar.backgroundTintList() {
|
fun Toolbar.backgroundTintList() {
|
||||||
val surfaceColor = ATHUtil.resolveColor(context, R.attr.colorSurface, Color.BLACK)
|
val surfaceColor = ATHUtil.resolveColor(context, R.attr.colorSurface, Color.BLACK)
|
||||||
val colorStateList = ColorStateList.valueOf(surfaceColor)
|
val colorStateList = ColorStateList.valueOf(surfaceColor)
|
||||||
|
@ -45,10 +63,26 @@ fun Context.textColorSecondary(): Int {
|
||||||
return ATHUtil.resolveColor(this, android.R.attr.textColorSecondary)
|
return ATHUtil.resolveColor(this, android.R.attr.textColorSecondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Fragment.textColorSecondary(): Int {
|
||||||
|
return ATHUtil.resolveColor(requireContext(), android.R.attr.textColorSecondary)
|
||||||
|
}
|
||||||
|
|
||||||
fun Context.colorControlNormal(): Int {
|
fun Context.colorControlNormal(): Int {
|
||||||
return ATHUtil.resolveColor(this, android.R.attr.colorControlNormal)
|
return ATHUtil.resolveColor(this, android.R.attr.colorControlNormal)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun View.colorControlNormal(): Int {
|
||||||
|
return ATHUtil.resolveColor(context, android.R.attr.colorControlNormal)
|
||||||
|
}
|
||||||
|
|
||||||
fun Context.textColorPrimary(): Int {
|
fun Context.textColorPrimary(): Int {
|
||||||
return ATHUtil.resolveColor(this, android.R.attr.textColorPrimary)
|
return ATHUtil.resolveColor(this, android.R.attr.textColorPrimary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun View.textColorPrimary(): Int {
|
||||||
|
return ATHUtil.resolveColor(context, android.R.attr.textColorPrimary)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Fragment.textColorPrimary(): Int {
|
||||||
|
return ATHUtil.resolveColor(requireContext(), android.R.attr.textColorPrimary)
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package code.name.monkey.retromusic.extensions
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.annotation.DimenRes
|
||||||
|
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun Context.dip(value: Int): Int = (value * resources.displayMetrics.density).toInt()
|
||||||
|
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun Context.dimen(@DimenRes resource: Int): Int = resources.getDimensionPixelSize(resource)
|
|
@ -84,10 +84,10 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
|
||||||
|
|
||||||
val song = MusicPlayerRemote.currentSong
|
val song = MusicPlayerRemote.currentSong
|
||||||
val title = SpannableString(song.title)
|
val title = SpannableString(song.title)
|
||||||
title.setSpan(ForegroundColorSpan(textColorPrimary(requireContext())), 0, title.length, 0)
|
title.setSpan(ForegroundColorSpan(textColorPrimary()), 0, title.length, 0)
|
||||||
|
|
||||||
val text = SpannableString(song.artistName)
|
val text = SpannableString(song.artistName)
|
||||||
text.setSpan(ForegroundColorSpan(textColorSecondary(requireContext())), 0, text.length, 0)
|
text.setSpan(ForegroundColorSpan(textColorSecondary()), 0, text.length, 0)
|
||||||
|
|
||||||
builder.append(title).append(" • ").append(text)
|
builder.append(title).append(" • ").append(text)
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import code.name.monkey.retromusic.adapter.album.AlbumAdapter
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment
|
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment
|
||||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollGridLayoutManager
|
||||||
|
|
||||||
class AlbumsFragment :
|
class AlbumsFragment :
|
||||||
AbsLibraryPagerRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridLayoutManager>(),
|
AbsLibraryPagerRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridLayoutManager>(),
|
||||||
|
@ -32,7 +33,7 @@ class AlbumsFragment :
|
||||||
get() = R.string.no_albums
|
get() = R.string.no_albums
|
||||||
|
|
||||||
override fun createLayoutManager(): GridLayoutManager {
|
override fun createLayoutManager(): GridLayoutManager {
|
||||||
return GridLayoutManager(requireActivity(), getGridSize())
|
return OverScrollGridLayoutManager(requireActivity(), getGridSize())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createAdapter(): AlbumAdapter {
|
override fun createAdapter(): AlbumAdapter {
|
||||||
|
|
|
@ -10,12 +10,13 @@ import code.name.monkey.retromusic.adapter.artist.ArtistAdapter
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment
|
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment
|
||||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollGridLayoutManager
|
||||||
|
|
||||||
class ArtistsFragment :
|
class ArtistsFragment :
|
||||||
AbsLibraryPagerRecyclerViewCustomGridSizeFragment<ArtistAdapter, GridLayoutManager>(),
|
AbsLibraryPagerRecyclerViewCustomGridSizeFragment<ArtistAdapter, GridLayoutManager>(),
|
||||||
MainActivityFragmentCallbacks {
|
MainActivityFragmentCallbacks {
|
||||||
|
|
||||||
lateinit var artistViewModel: ArtistViewModel
|
private lateinit var artistViewModel: ArtistViewModel
|
||||||
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
@ -46,7 +47,7 @@ class ArtistsFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createLayoutManager(): GridLayoutManager {
|
override fun createLayoutManager(): GridLayoutManager {
|
||||||
return GridLayoutManager(requireActivity(), getGridSize())
|
return OverScrollGridLayoutManager(requireActivity(), getGridSize())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createAdapter(): ArtistAdapter {
|
override fun createAdapter(): ArtistAdapter {
|
||||||
|
|
|
@ -8,17 +8,13 @@ import androidx.annotation.NonNull
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
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.ThemedFastScroller.create
|
import code.name.monkey.retromusic.util.ThemedFastScroller.create
|
||||||
import code.name.monkey.retromusic.views.ScrollingViewOnApplyWindowInsetsListener
|
|
||||||
import com.google.android.material.appbar.AppBarLayout
|
|
||||||
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.*
|
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.*
|
||||||
import me.zhanghai.android.fastscroll.FastScroller
|
import me.zhanghai.android.fastscroll.FastScroller
|
||||||
import me.zhanghai.android.fastscroll.FastScrollerBuilder
|
import me.zhanghai.android.fastscroll.FastScrollerBuilder
|
||||||
|
|
||||||
abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> :
|
abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> :
|
||||||
AbsLibraryPagerFragment(), AppBarLayout.OnOffsetChangedListener {
|
AbsLibraryPagerFragment() {
|
||||||
|
|
||||||
protected var adapter: A? = null
|
protected var adapter: A? = null
|
||||||
protected var layoutManager: LM? = null
|
protected var layoutManager: LM? = null
|
||||||
|
@ -31,7 +27,6 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
mainActivity.addOnAppBarOffsetChangedListener(this)
|
|
||||||
initLayoutManager()
|
initLayoutManager()
|
||||||
initAdapter()
|
initAdapter()
|
||||||
setUpRecyclerView()
|
setUpRecyclerView()
|
||||||
|
@ -41,13 +36,6 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
||||||
recyclerView.layoutManager = layoutManager
|
recyclerView.layoutManager = layoutManager
|
||||||
recyclerView.adapter = adapter
|
recyclerView.adapter = adapter
|
||||||
val fastScroller = create(recyclerView)
|
val fastScroller = create(recyclerView)
|
||||||
recyclerView.setOnApplyWindowInsetsListener(
|
|
||||||
ScrollingViewOnApplyWindowInsetsListener(
|
|
||||||
recyclerView,
|
|
||||||
fastScroller
|
|
||||||
)
|
|
||||||
)
|
|
||||||
checkForPadding()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun createFastScroller(recyclerView: RecyclerView): FastScroller {
|
protected open fun createFastScroller(recyclerView: RecyclerView): FastScroller {
|
||||||
|
@ -60,7 +48,6 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
||||||
override fun onChanged() {
|
override fun onChanged() {
|
||||||
super.onChanged()
|
super.onChanged()
|
||||||
checkIsEmpty()
|
checkIsEmpty()
|
||||||
checkForPadding()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -78,18 +65,6 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
||||||
empty.visibility = if (adapter!!.itemCount == 0) View.VISIBLE else View.GONE
|
empty.visibility = if (adapter!!.itemCount == 0) View.VISIBLE else View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkForPadding() {
|
|
||||||
val itemCount: Int = adapter?.itemCount ?: 0
|
|
||||||
val params = container.layoutParams as ViewGroup.MarginLayoutParams
|
|
||||||
if (itemCount > 0 && MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
|
||||||
val height = DensityUtil.dip2px(requireContext(), 104f)
|
|
||||||
params.bottomMargin = height
|
|
||||||
} else {
|
|
||||||
val height = DensityUtil.dip2px(requireContext(), 52f)
|
|
||||||
params.bottomMargin = height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initLayoutManager() {
|
private fun initLayoutManager() {
|
||||||
layoutManager = createLayoutManager()
|
layoutManager = createLayoutManager()
|
||||||
}
|
}
|
||||||
|
@ -99,25 +74,6 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
||||||
@NonNull
|
@NonNull
|
||||||
protected abstract fun createAdapter(): A
|
protected abstract fun createAdapter(): A
|
||||||
|
|
||||||
override fun onOffsetChanged(p0: AppBarLayout?, i: Int) {
|
|
||||||
container.setPadding(
|
|
||||||
container.paddingLeft,
|
|
||||||
container.paddingTop,
|
|
||||||
container.paddingRight,
|
|
||||||
mainActivity.totalAppBarScrollingRange + i
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onQueueChanged() {
|
|
||||||
super.onQueueChanged()
|
|
||||||
checkForPadding()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onServiceConnected() {
|
|
||||||
super.onServiceConnected()
|
|
||||||
checkForPadding()
|
|
||||||
}
|
|
||||||
|
|
||||||
protected fun invalidateLayoutManager() {
|
protected fun invalidateLayoutManager() {
|
||||||
initLayoutManager()
|
initLayoutManager()
|
||||||
recyclerView.layoutManager = layoutManager
|
recyclerView.layoutManager = layoutManager
|
||||||
|
@ -129,11 +85,6 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
|
||||||
recyclerView.adapter = adapter
|
recyclerView.adapter = adapter
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
|
||||||
super.onDestroyView()
|
|
||||||
mainActivity.removeOnAppBarOffsetChangedListener(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun recyclerView(): RecyclerView {
|
fun recyclerView(): RecyclerView {
|
||||||
return recyclerView
|
return recyclerView
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
* See the GNU General Public License for more details.
|
* See the GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package code.name.monkey.retromusic.fragments.mainactivity;
|
package code.name.monkey.retromusic.fragments.folder;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -73,6 +73,7 @@ import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||||
import code.name.monkey.retromusic.util.ThemedFastScroller;
|
import code.name.monkey.retromusic.util.ThemedFastScroller;
|
||||||
import code.name.monkey.retromusic.views.BreadCrumbLayout;
|
import code.name.monkey.retromusic.views.BreadCrumbLayout;
|
||||||
import code.name.monkey.retromusic.views.ScrollingViewOnApplyWindowInsetsListener;
|
import code.name.monkey.retromusic.views.ScrollingViewOnApplyWindowInsetsListener;
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollLinearLayoutManager;
|
||||||
import me.zhanghai.android.fastscroll.FastScroller;
|
import me.zhanghai.android.fastscroll.FastScroller;
|
||||||
|
|
||||||
public class FoldersFragment extends AbsMainActivityFragment implements
|
public class FoldersFragment extends AbsMainActivityFragment implements
|
||||||
|
@ -478,7 +479,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpRecyclerView() {
|
private void setUpRecyclerView() {
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new OverScrollLinearLayoutManager(getActivity()));
|
||||||
FastScroller fastScroller = ThemedFastScroller.INSTANCE.create(recyclerView);
|
FastScroller fastScroller = ThemedFastScroller.INSTANCE.create(recyclerView);
|
||||||
recyclerView.setOnApplyWindowInsetsListener(
|
recyclerView.setOnApplyWindowInsetsListener(
|
||||||
new ScrollingViewOnApplyWindowInsetsListener(recyclerView, fastScroller));
|
new ScrollingViewOnApplyWindowInsetsListener(recyclerView, fastScroller));
|
|
@ -24,11 +24,12 @@ import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.adapter.GenreAdapter
|
import code.name.monkey.retromusic.adapter.GenreAdapter
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewFragment
|
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewFragment
|
||||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollLinearLayoutManager
|
||||||
|
|
||||||
class GenresFragment : AbsLibraryPagerRecyclerViewFragment<GenreAdapter, LinearLayoutManager>(),
|
class GenresFragment : AbsLibraryPagerRecyclerViewFragment<GenreAdapter, LinearLayoutManager>(),
|
||||||
MainActivityFragmentCallbacks {
|
MainActivityFragmentCallbacks {
|
||||||
|
|
||||||
lateinit var genreViewModel: GenreViewModel
|
private lateinit var genreViewModel: GenreViewModel
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -52,7 +53,7 @@ class GenresFragment : AbsLibraryPagerRecyclerViewFragment<GenreAdapter, LinearL
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createLayoutManager(): LinearLayoutManager {
|
override fun createLayoutManager(): LinearLayoutManager {
|
||||||
return LinearLayoutManager(activity)
|
return OverScrollLinearLayoutManager(activity)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createAdapter(): GenreAdapter {
|
override fun createAdapter(): GenreAdapter {
|
||||||
|
|
|
@ -21,7 +21,6 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
import code.name.monkey.retromusic.Constants
|
import code.name.monkey.retromusic.Constants
|
||||||
|
@ -39,6 +38,7 @@ import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollLinearLayoutManager
|
||||||
import kotlinx.android.synthetic.main.abs_playlists.*
|
import kotlinx.android.synthetic.main.abs_playlists.*
|
||||||
import kotlinx.android.synthetic.main.fragment_banner_home.*
|
import kotlinx.android.synthetic.main.fragment_banner_home.*
|
||||||
import kotlinx.android.synthetic.main.home_content.*
|
import kotlinx.android.synthetic.main.home_content.*
|
||||||
|
@ -63,6 +63,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadImageFromStorage() {
|
private fun loadImageFromStorage() {
|
||||||
|
|
||||||
Glide.with(requireContext())
|
Glide.with(requireContext())
|
||||||
.load(
|
.load(
|
||||||
File(
|
File(
|
||||||
|
@ -144,7 +145,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
|
|
||||||
homeAdapter = HomeAdapter(mainActivity, displayMetrics)
|
homeAdapter = HomeAdapter(mainActivity, displayMetrics)
|
||||||
recyclerView.apply {
|
recyclerView.apply {
|
||||||
layoutManager = LinearLayoutManager(mainActivity)
|
layoutManager = OverScrollLinearLayoutManager(mainActivity)
|
||||||
adapter = homeAdapter
|
adapter = homeAdapter
|
||||||
}
|
}
|
||||||
homeModel = ViewModelProvider(this).get(HomeViewModel::class.java)
|
homeModel = ViewModelProvider(this).get(HomeViewModel::class.java)
|
||||||
|
|
|
@ -159,8 +159,8 @@ class AdaptiveFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Call
|
||||||
inflateMenu(R.menu.menu_player)
|
inflateMenu(R.menu.menu_player)
|
||||||
setNavigationOnClickListener { requireActivity().onBackPressed() }
|
setNavigationOnClickListener { requireActivity().onBackPressed() }
|
||||||
ToolbarContentTintHelper.colorizeToolbar(this, primaryColor, requireActivity())
|
ToolbarContentTintHelper.colorizeToolbar(this, primaryColor, requireActivity())
|
||||||
setTitleTextColor(textColorPrimary(requireContext()))
|
setTitleTextColor(textColorPrimary())
|
||||||
setSubtitleTextColor(textColorSecondary(requireContext()))
|
setSubtitleTextColor(textColorSecondary())
|
||||||
setOnMenuItemClickListener(this@AdaptiveFragment)
|
setOnMenuItemClickListener(this@AdaptiveFragment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ class LockScreenPlayerControlsFragment : AbsPlayerControlsFragment() {
|
||||||
val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) {
|
val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) {
|
||||||
color.primaryTextColor
|
color.primaryTextColor
|
||||||
} else {
|
} else {
|
||||||
textColorSecondary(requireContext())
|
textColorSecondary()
|
||||||
}.ripAlpha()
|
}.ripAlpha()
|
||||||
|
|
||||||
volumeFragment?.setTintable(colorFinal)
|
volumeFragment?.setTintable(colorFinal)
|
||||||
|
|
|
@ -116,7 +116,7 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
|
||||||
val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) {
|
val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) {
|
||||||
lastPlaybackControlsColor
|
lastPlaybackControlsColor
|
||||||
} else {
|
} else {
|
||||||
textColorSecondary(requireContext())
|
textColorSecondary()
|
||||||
}.ripAlpha()
|
}.ripAlpha()
|
||||||
|
|
||||||
text.setTextColor(colorFinal)
|
text.setTextColor(colorFinal)
|
||||||
|
|
|
@ -11,6 +11,7 @@ import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.adapter.playlist.PlaylistAdapter
|
import code.name.monkey.retromusic.adapter.playlist.PlaylistAdapter
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewFragment
|
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewFragment
|
||||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollGridLayoutManager
|
||||||
|
|
||||||
class PlaylistsFragment :
|
class PlaylistsFragment :
|
||||||
AbsLibraryPagerRecyclerViewFragment<PlaylistAdapter, GridLayoutManager>(),
|
AbsLibraryPagerRecyclerViewFragment<PlaylistAdapter, GridLayoutManager>(),
|
||||||
|
@ -38,7 +39,7 @@ class PlaylistsFragment :
|
||||||
get() = R.string.no_playlists
|
get() = R.string.no_playlists
|
||||||
|
|
||||||
override fun createLayoutManager(): GridLayoutManager {
|
override fun createLayoutManager(): GridLayoutManager {
|
||||||
return GridLayoutManager(requireContext(), 1)
|
return OverScrollGridLayoutManager(requireContext(), 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createAdapter(): PlaylistAdapter {
|
override fun createAdapter(): PlaylistAdapter {
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropM
|
||||||
import com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager
|
import com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager
|
||||||
import com.h6ah4i.android.widget.advrecyclerview.touchguard.RecyclerViewTouchActionGuardManager
|
import com.h6ah4i.android.widget.advrecyclerview.touchguard.RecyclerViewTouchActionGuardManager
|
||||||
import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils
|
import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollLinearLayoutManager
|
||||||
import kotlinx.android.synthetic.main.activity_playing_queue.*
|
import kotlinx.android.synthetic.main.activity_playing_queue.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +74,7 @@ class PlayingQueueFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createLayoutManager(): LinearLayoutManager {
|
override fun createLayoutManager(): LinearLayoutManager {
|
||||||
return LinearLayoutManager(requireContext())
|
return OverScrollLinearLayoutManager(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createAdapter(): PlayingQueueAdapter {
|
override fun createAdapter(): PlayingQueueAdapter {
|
||||||
|
|
|
@ -68,7 +68,9 @@ class MainSettingsFragment : Fragment(), View.OnClickListener {
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
scrollView.setOnScrollChangeListener(View.OnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
|
||||||
|
|
||||||
|
})
|
||||||
generalSettings.setOnClickListener(this)
|
generalSettings.setOnClickListener(this)
|
||||||
audioSettings.setOnClickListener(this)
|
audioSettings.setOnClickListener(this)
|
||||||
nowPlayingSettings.setOnClickListener(this)
|
nowPlayingSettings.setOnClickListener(this)
|
||||||
|
|
|
@ -14,6 +14,7 @@ import code.name.monkey.retromusic.model.Song
|
||||||
import code.name.monkey.retromusic.mvp.presenter.SongPresenter
|
import code.name.monkey.retromusic.mvp.presenter.SongPresenter
|
||||||
import code.name.monkey.retromusic.mvp.presenter.SongView
|
import code.name.monkey.retromusic.mvp.presenter.SongView
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
|
import dev.olog.scrollhelper.layoutmanagers.OverScrollGridLayoutManager
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ -38,8 +39,7 @@ class SongsFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createLayoutManager(): GridLayoutManager {
|
override fun createLayoutManager(): GridLayoutManager {
|
||||||
println("createLayoutManager: ${getGridSize()}")
|
return OverScrollGridLayoutManager(requireActivity(), getGridSize()).apply {
|
||||||
return GridLayoutManager(requireActivity(), getGridSize()).apply {
|
|
||||||
spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
|
spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
|
||||||
override fun getSpanSize(position: Int): Int {
|
override fun getSpanSize(position: Int): Int {
|
||||||
return if (position == 0) {
|
return if (position == 0) {
|
||||||
|
|
|
@ -57,9 +57,10 @@ class AlbumCoverStylePreference @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
||||||
icon?.colorFilter =
|
icon?.colorFilter =
|
||||||
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
||||||
colorControlNormal(context),
|
context.colorControlNormal(),
|
||||||
SRC_IN
|
SRC_IN
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ class BlacklistPreference @JvmOverloads constructor(
|
||||||
init {
|
init {
|
||||||
icon?.colorFilter =
|
icon?.colorFilter =
|
||||||
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
||||||
colorControlNormal(context),
|
context.colorControlNormal( ),
|
||||||
SRC_IN
|
SRC_IN
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ class LibraryPreference @JvmOverloads constructor(
|
||||||
init {
|
init {
|
||||||
icon?.colorFilter =
|
icon?.colorFilter =
|
||||||
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
||||||
colorControlNormal(context),
|
context.colorControlNormal(),
|
||||||
SRC_IN
|
SRC_IN
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ class MaterialListPreference @JvmOverloads constructor(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
icon?.colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
icon?.colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
||||||
colorControlNormal(context),
|
context.colorControlNormal(),
|
||||||
SRC_IN
|
SRC_IN
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ class NowPlayingScreenPreference @JvmOverloads constructor(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
icon?.colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
icon?.colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
||||||
colorControlNormal(context),
|
context.colorControlNormal(),
|
||||||
SRC_IN
|
SRC_IN
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ import java.util.Objects;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.fragments.AlbumCoverStyle;
|
import code.name.monkey.retromusic.fragments.AlbumCoverStyle;
|
||||||
import code.name.monkey.retromusic.fragments.NowPlayingScreen;
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen;
|
||||||
import code.name.monkey.retromusic.fragments.mainactivity.FoldersFragment;
|
import code.name.monkey.retromusic.fragments.folder.FoldersFragment;
|
||||||
import code.name.monkey.retromusic.helper.SortOrder.AlbumSongSortOrder;
|
import code.name.monkey.retromusic.helper.SortOrder.AlbumSongSortOrder;
|
||||||
import code.name.monkey.retromusic.model.CategoryInfo;
|
import code.name.monkey.retromusic.model.CategoryInfo;
|
||||||
import code.name.monkey.retromusic.model.CategoryInfo.Category;
|
import code.name.monkey.retromusic.model.CategoryInfo.Category;
|
||||||
|
|
|
@ -14,21 +14,23 @@
|
||||||
package code.name.monkey.retromusic.util
|
package code.name.monkey.retromusic.util
|
||||||
|
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor
|
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil.isColorLight
|
import code.name.monkey.appthemehelper.util.ColorUtil.isColorLight
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper.getPrimaryTextColor
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper.getPrimaryTextColor
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.extensions.accentColor
|
||||||
|
import code.name.monkey.retromusic.extensions.dimen
|
||||||
|
import code.name.monkey.retromusic.extensions.dip
|
||||||
import code.name.monkey.retromusic.views.PopupBackground
|
import code.name.monkey.retromusic.views.PopupBackground
|
||||||
import me.zhanghai.android.fastscroll.FastScroller
|
import me.zhanghai.android.fastscroll.FastScroller
|
||||||
import me.zhanghai.android.fastscroll.FastScrollerBuilder
|
import me.zhanghai.android.fastscroll.FastScrollerBuilder
|
||||||
import me.zhanghai.android.fastscroll.PopupStyles
|
import me.zhanghai.android.fastscroll.PopupStyles
|
||||||
import me.zhanghai.android.fastscroll.R
|
|
||||||
|
|
||||||
object ThemedFastScroller {
|
object ThemedFastScroller {
|
||||||
fun create(view: ViewGroup): FastScroller {
|
fun create(view: ViewGroup): FastScroller {
|
||||||
val context = view.context
|
val context = view.context
|
||||||
val color = accentColor(context)
|
val textColor = getPrimaryTextColor(context, isColorLight(context.accentColor()))
|
||||||
val textColor = getPrimaryTextColor(context, isColorLight(color))
|
|
||||||
val fastScrollerBuilder = FastScrollerBuilder(view)
|
val fastScrollerBuilder = FastScrollerBuilder(view)
|
||||||
fastScrollerBuilder.useMd2Style()
|
fastScrollerBuilder.useMd2Style()
|
||||||
fastScrollerBuilder.setPopupStyle { popupText ->
|
fastScrollerBuilder.setPopupStyle { popupText ->
|
||||||
|
@ -36,12 +38,17 @@ object ThemedFastScroller {
|
||||||
popupText.background = PopupBackground(context)
|
popupText.background = PopupBackground(context)
|
||||||
popupText.setTextColor(textColor)
|
popupText.setTextColor(textColor)
|
||||||
}
|
}
|
||||||
|
fastScrollerBuilder.setPadding(
|
||||||
|
0,
|
||||||
|
view.context.dimen(R.dimen.toolbar_height) + view.context.dip(8),
|
||||||
|
0,
|
||||||
|
view.context.dimen(R.dimen.mini_player_height)
|
||||||
|
)
|
||||||
fastScrollerBuilder.setThumbDrawable(
|
fastScrollerBuilder.setThumbDrawable(
|
||||||
TintHelper.createTintedDrawable(
|
TintHelper.createTintedDrawable(
|
||||||
context,
|
context,
|
||||||
R.drawable.afs_md2_thumb,
|
R.drawable.afs_md2_thumb,
|
||||||
color
|
context.accentColor()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return fastScrollerBuilder.build()
|
return fastScrollerBuilder.build()
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2019 Hemanth Savarala.
|
|
||||||
*
|
|
||||||
* Licensed under the GNU General Public License v3
|
|
||||||
*
|
|
||||||
* This is free software: you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
* See the GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package code.name.monkey.retromusic.views;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
public class StatusBarView extends View {
|
|
||||||
|
|
||||||
|
|
||||||
public StatusBarView(@NonNull Context context) {
|
|
||||||
super(context);
|
|
||||||
init(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StatusBarView(@NonNull Context context, @NonNull AttributeSet attrs) {
|
|
||||||
super(context, attrs);
|
|
||||||
init(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StatusBarView(@NonNull Context context, @NonNull AttributeSet attrs, int defStyleAttr) {
|
|
||||||
super(context, attrs, defStyleAttr);
|
|
||||||
init(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getStatusBarHeight(@NonNull Resources r) {
|
|
||||||
int result = 0;
|
|
||||||
int resourceId = r.getIdentifier("status_bar_height", "dimen", "android");
|
|
||||||
if (resourceId > 0) {
|
|
||||||
result = r.getDimensionPixelSize(resourceId);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init(Context context) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
|
||||||
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), getStatusBarHeight(getResources()));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
package code.name.monkey.retromusic.views
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
|
||||||
|
class StatusBarView(
|
||||||
|
context: Context,
|
||||||
|
attrs: AttributeSet
|
||||||
|
) : View(context, attrs) {
|
||||||
|
|
||||||
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
|
if (isInEditMode) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setOnApplyWindowInsetsListener { _, insets ->
|
||||||
|
val height = insets?.systemWindowInsetTop ?: 0
|
||||||
|
setHeight(height)
|
||||||
|
insets
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setHeight(px: Int) {
|
||||||
|
val params = layoutParams ?: return
|
||||||
|
params.height = px
|
||||||
|
layoutParams = params
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,46 +1,38 @@
|
||||||
<?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"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?colorSurface"
|
android:background="?colorSurface">
|
||||||
android:orientation="vertical">
|
|
||||||
|
<!-- TODO in order to work, children has to be defined in reverse drawing order-->
|
||||||
|
<!-- TODO so: first fragment_container, than toolbar, than statusbar -->
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fragment_container"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/status_bar" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:elevation="0dp"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:ignore="UnusedAttribute">
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/status_bar">
|
||||||
<include layout="@layout/status_bar" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
||||||
android:id="@+id/mainContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
|
||||||
android:id="@+id/appBarLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:liftOnScroll="true">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlways">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/toolbar_height"
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurface"
|
||||||
app:popupTheme="?attr/toolbarPopupTheme"
|
app:popupTheme="?attr/toolbarPopupTheme"
|
||||||
app:title="@string/app_name"
|
app:title="@string/app_name"
|
||||||
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal.Library"
|
app:titleTextAppearance="@style/TextViewHeadline6"
|
||||||
app:titleTextColor="?attr/colorControlNormal"
|
app:titleTextColor="?attr/colorControlNormal"
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
||||||
|
|
||||||
|
@ -49,12 +41,15 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/toolbar_height" />
|
android:layout_height="@dimen/toolbar_height" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/fragment_container"
|
<include
|
||||||
android:layout_width="match_parent"
|
layout="@layout/status_bar"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="0dp"
|
||||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
android:layout_height="wrap_content"
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
</LinearLayout>
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:layout_height="24dp" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -15,9 +15,10 @@
|
||||||
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/container"
|
android:id="@+id/container"
|
||||||
android:overScrollMode="never"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/toolbar_height"
|
||||||
|
android:overScrollMode="never"
|
||||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
|
|
@ -11,19 +11,16 @@
|
||||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
~ See the GNU General Public License for more details.
|
~ See the GNU General Public License for more details.
|
||||||
-->
|
-->
|
||||||
<androidx.core.widget.NestedScrollView 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/container"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/toolbar_height"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.RetroShapeableImageView
|
<code.name.monkey.retromusic.views.RetroShapeableImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="42dp"
|
android:layout_width="42dp"
|
||||||
|
@ -70,5 +67,3 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleWelcome" />
|
app:layout_constraintTop_toBottomOf="@id/titleWelcome" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
|
@ -5,11 +5,12 @@
|
||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
<!-- TODO note that recycler view has to cover the entire screen -->
|
||||||
|
<!-- TODO so has to be drawn under bottom navigation, toolbar, ecc, but has to be below statusbar-->
|
||||||
<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="match_parent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:layoutAnimation="@anim/layout_animation_fall_down"
|
android:layoutAnimation="@anim/layout_animation_fall_down"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView 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"
|
||||||
android:id="@+id/scrollView"
|
android:id="@+id/scrollView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -162,4 +162,4 @@
|
||||||
app:settingListItemTitle="@string/action_about" />
|
app:settingListItemTitle="@string/action_about" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</ScrollView>
|
|
@ -4,7 +4,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/miniPlayerContent"
|
android:id="@+id/miniPlayerContent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/bottom_sheet_peek_1_height"
|
android:layout_height="@dimen/mini_player_height"
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurface"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
|
|
@ -5,5 +5,4 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
Loading…
Add table
Add a link
Reference in a new issue