Added scroll animation

This commit is contained in:
h4h13 2020-01-05 23:52:21 +05:30
parent 79bdd49547
commit 1932ba219e
35 changed files with 247 additions and 97 deletions

View file

@ -22,7 +22,7 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 399 versionCode 400
versionName '3.4.850' versionName '3.4.850'
multiDexEnabled true multiDexEnabled true
@ -116,6 +116,7 @@ static def getDate() {
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':appthemehelper') implementation project(':appthemehelper')
implementation project(':liboverscroll')
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.gridlayout:gridlayout:1.0.0" implementation "androidx.gridlayout:gridlayout:1.0.0"

View file

@ -32,6 +32,7 @@ import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import com.afollestad.materialdialogs.list.listItems import com.afollestad.materialdialogs.list.listItems
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import kotlinx.android.synthetic.main.activity_about.container
import kotlinx.android.synthetic.main.activity_about.toolbar import kotlinx.android.synthetic.main.activity_about.toolbar
import kotlinx.android.synthetic.main.card_credit.recyclerView import kotlinx.android.synthetic.main.card_credit.recyclerView
import kotlinx.android.synthetic.main.card_other.changelog import kotlinx.android.synthetic.main.card_other.changelog
@ -48,6 +49,7 @@ import kotlinx.android.synthetic.main.card_social.instagramLink
import kotlinx.android.synthetic.main.card_social.pinterestLink import kotlinx.android.synthetic.main.card_social.pinterestLink
import kotlinx.android.synthetic.main.card_social.telegramLink import kotlinx.android.synthetic.main.card_social.telegramLink
import kotlinx.android.synthetic.main.card_social.twitterLink import kotlinx.android.synthetic.main.card_social.twitterLink
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
import java.io.IOException import java.io.IOException
import java.nio.charset.StandardCharsets import java.nio.charset.StandardCharsets
@ -86,6 +88,7 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener {
version.setSummary(getAppVersion()) version.setSummary(getAppVersion())
setUpView() setUpView()
loadContributors() loadContributors()
OverScrollDecoratorHelper.setUpOverScroll(container)
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {

View file

@ -46,6 +46,7 @@ import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.activity_album.albumCoverContainer import kotlinx.android.synthetic.main.activity_album.albumCoverContainer
import kotlinx.android.synthetic.main.activity_album.albumText import kotlinx.android.synthetic.main.activity_album.albumText
import kotlinx.android.synthetic.main.activity_album.albumTitle import kotlinx.android.synthetic.main.activity_album.albumTitle
import kotlinx.android.synthetic.main.activity_album.container
import kotlinx.android.synthetic.main.activity_album.image import kotlinx.android.synthetic.main.activity_album.image
import kotlinx.android.synthetic.main.activity_album.toolbar import kotlinx.android.synthetic.main.activity_album.toolbar
import kotlinx.android.synthetic.main.activity_album_content.moreRecyclerView import kotlinx.android.synthetic.main.activity_album_content.moreRecyclerView
@ -54,6 +55,7 @@ import kotlinx.android.synthetic.main.activity_album_content.playAction
import kotlinx.android.synthetic.main.activity_album_content.recyclerView import kotlinx.android.synthetic.main.activity_album_content.recyclerView
import kotlinx.android.synthetic.main.activity_album_content.shuffleAction import kotlinx.android.synthetic.main.activity_album_content.shuffleAction
import kotlinx.android.synthetic.main.activity_album_content.songTitle import kotlinx.android.synthetic.main.activity_album_content.songTitle
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
import java.util.ArrayList import java.util.ArrayList
import javax.inject.Inject import javax.inject.Inject
import android.util.Pair as UtilPair import android.util.Pair as UtilPair
@ -158,6 +160,8 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
isNestedScrollingEnabled = false isNestedScrollingEnabled = false
adapter = simpleSongAdapter adapter = simpleSongAdapter
} }
OverScrollDecoratorHelper.setUpOverScroll(container)
} }
override fun onDestroy() { override fun onDestroy() {

View file

@ -42,6 +42,7 @@ import code.name.monkey.retromusic.util.RetroColorUtil
import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.RetroUtil
import com.afollestad.materialcab.MaterialCab import com.afollestad.materialcab.MaterialCab
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.activity_album.container
import kotlinx.android.synthetic.main.activity_artist_content.albumRecyclerView import kotlinx.android.synthetic.main.activity_artist_content.albumRecyclerView
import kotlinx.android.synthetic.main.activity_artist_content.albumTitle import kotlinx.android.synthetic.main.activity_artist_content.albumTitle
import kotlinx.android.synthetic.main.activity_artist_content.biographyText import kotlinx.android.synthetic.main.activity_artist_content.biographyText
@ -56,6 +57,7 @@ import kotlinx.android.synthetic.main.activity_artist_details.image
import kotlinx.android.synthetic.main.activity_artist_details.imageContainer import kotlinx.android.synthetic.main.activity_artist_details.imageContainer
import kotlinx.android.synthetic.main.activity_artist_details.text import kotlinx.android.synthetic.main.activity_artist_details.text
import kotlinx.android.synthetic.main.activity_artist_details.toolbar import kotlinx.android.synthetic.main.activity_artist_details.toolbar
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
import java.util.Locale import java.util.Locale
import javax.inject.Inject import javax.inject.Inject
@ -177,6 +179,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
layoutManager = LinearLayoutManager(this.context) layoutManager = LinearLayoutManager(this.context)
adapter = songAdapter adapter = songAdapter
} }
OverScrollDecoratorHelper.setUpOverScroll(container)
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {

View file

@ -24,6 +24,7 @@ import kotlinx.android.synthetic.main.activity_playing_queue.clearQueue
import kotlinx.android.synthetic.main.activity_playing_queue.playerQueueSubHeader import kotlinx.android.synthetic.main.activity_playing_queue.playerQueueSubHeader
import kotlinx.android.synthetic.main.activity_playing_queue.recyclerView import kotlinx.android.synthetic.main.activity_playing_queue.recyclerView
import kotlinx.android.synthetic.main.activity_playing_queue.toolbar import kotlinx.android.synthetic.main.activity_playing_queue.toolbar
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
open class PlayingQueueActivity : AbsMusicServiceActivity() { open class PlayingQueueActivity : AbsMusicServiceActivity() {
@ -108,6 +109,7 @@ open class PlayingQueueActivity : AbsMusicServiceActivity() {
} }
}) })
ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView) ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView)
OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL)
} }
private fun checkForPadding() { private fun checkForPadding() {

View file

@ -34,6 +34,7 @@ import kotlinx.android.synthetic.main.activity_playlist_detail.emptyEmoji
import kotlinx.android.synthetic.main.activity_playlist_detail.emptyText import kotlinx.android.synthetic.main.activity_playlist_detail.emptyText
import kotlinx.android.synthetic.main.activity_playlist_detail.recyclerView import kotlinx.android.synthetic.main.activity_playlist_detail.recyclerView
import kotlinx.android.synthetic.main.activity_playlist_detail.toolbar import kotlinx.android.synthetic.main.activity_playlist_detail.toolbar
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
import javax.inject.Inject import javax.inject.Inject
class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, PlaylistSongsView { class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, PlaylistSongsView {
@ -75,6 +76,8 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
private fun setUpRecyclerView() { private fun setUpRecyclerView() {
ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView) ViewUtil.setUpFastScrollRecyclerViewColor(this, recyclerView)
OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL)
recyclerView.layoutManager = LinearLayoutManager(this) recyclerView.layoutManager = LinearLayoutManager(this)
if (playlist is AbsCustomPlaylist) { if (playlist is AbsCustomPlaylist) {
adapter = PlaylistSongAdapter(this, ArrayList(), R.layout.item_list, false, this) adapter = PlaylistSongAdapter(this, ArrayList(), R.layout.item_list, false, this)

View file

@ -38,6 +38,7 @@ import kotlinx.android.synthetic.main.activity_search.recyclerView
import kotlinx.android.synthetic.main.activity_search.searchContainer import kotlinx.android.synthetic.main.activity_search.searchContainer
import kotlinx.android.synthetic.main.activity_search.searchView import kotlinx.android.synthetic.main.activity_search.searchView
import kotlinx.android.synthetic.main.activity_search.voiceSearch import kotlinx.android.synthetic.main.activity_search.voiceSearch
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
import java.util.Locale import java.util.Locale
import javax.inject.Inject import javax.inject.Inject
@ -112,6 +113,8 @@ class SearchActivity : AbsMusicServiceActivity(), OnQueryTextListener, TextWatch
} }
} }
}) })
OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL)
} }
private fun setupSearchView() { private fun setupSearchView() {

View file

@ -1,51 +1,37 @@
package code.name.monkey.retromusic.activities; package code.name.monkey.retromusic.activities;
import static code.name.monkey.appthemehelper.util.ATHUtil.INSTANCE;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.webkit.WebView; import android.webkit.WebView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.core.widget.NestedScrollView;
import com.google.android.material.appbar.AppBarLayout;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import code.name.monkey.appthemehelper.ThemeStore; import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.appthemehelper.util.ColorUtil; import code.name.monkey.appthemehelper.util.ColorUtil;
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.activities.base.AbsBaseActivity; import code.name.monkey.retromusic.activities.base.AbsBaseActivity;
import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.PreferenceUtil;
import com.google.android.material.appbar.AppBarLayout;
import static code.name.monkey.appthemehelper.util.ATHUtil.INSTANCE; import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper;
public class WhatsNewActivity extends AbsBaseActivity { public class WhatsNewActivity extends AbsBaseActivity {
WebView webView;
Toolbar toolbar;
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
Toolbar toolbar;
private static void setChangelogRead(@NonNull Context context) { WebView webView;
try {
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
int currentVersion = pInfo.versionCode;
PreferenceUtil.getInstance(context).setLastChangeLogVersion(currentVersion);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
private static String colorToCSS(int color) {
return String.format("rgb(%d, %d, %d)", Color.red(color), Color.green(color), Color.blue(color)); // on API 29, WebView doesn't load with hex colors
}
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
@ -65,24 +51,30 @@ public class WhatsNewActivity extends AbsBaseActivity {
toolbar.setNavigationOnClickListener(v -> onBackPressed()); toolbar.setNavigationOnClickListener(v -> onBackPressed());
ToolbarContentTintHelper.colorBackButton(toolbar); ToolbarContentTintHelper.colorBackButton(toolbar);
NestedScrollView nestedScrollView = findViewById(R.id.container);
OverScrollDecoratorHelper.setUpOverScroll(nestedScrollView);
try { try {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
InputStream json = getAssets().open("retro-changelog.html"); InputStream json = getAssets().open("retro-changelog.html");
BufferedReader in = new BufferedReader(new InputStreamReader(json, StandardCharsets.UTF_8)); BufferedReader in = new BufferedReader(new InputStreamReader(json, StandardCharsets.UTF_8));
String str; String str;
while ((str = in.readLine()) != null) while ((str = in.readLine()) != null) {
buf.append(str); buf.append(str);
}
in.close(); in.close();
// Inject color values for WebView body background and links // Inject color values for WebView body background and links
final boolean isDark = INSTANCE.isWindowBackgroundDark(this); final boolean isDark = INSTANCE.isWindowBackgroundDark(this);
final String backgroundColor = colorToCSS(INSTANCE.resolveColor(this, R.attr.colorSurface, Color.parseColor(isDark ? "#424242" : "#ffffff"))); final String backgroundColor = colorToCSS(INSTANCE.resolveColor(this, R.attr.colorSurface,
Color.parseColor(isDark ? "#424242" : "#ffffff")));
final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000")); final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000"));
final String changeLog = buf.toString() final String changeLog = buf.toString()
.replace("{style-placeholder}", String.format("body { background-color: %s; color: %s; }", backgroundColor, contentColor)) .replace("{style-placeholder}",
String.format("body { background-color: %s; color: %s; }", backgroundColor, contentColor))
.replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this))) .replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this)))
.replace("{link-color-active}", colorToCSS(ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this)))); .replace("{link-color-active}",
colorToCSS(ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this))));
webView.loadData(changeLog, "text/html", "UTF-8"); webView.loadData(changeLog, "text/html", "UTF-8");
} catch (Throwable e) { } catch (Throwable e) {
@ -90,4 +82,19 @@ public class WhatsNewActivity extends AbsBaseActivity {
} }
setChangelogRead(this); setChangelogRead(this);
} }
private static String colorToCSS(int color) {
return String.format("rgb(%d, %d, %d)", Color.red(color), Color.green(color),
Color.blue(color)); // on API 29, WebView doesn't load with hex colors
}
private static void setChangelogRead(@NonNull Context context) {
try {
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
int currentVersion = pInfo.versionCode;
PreferenceUtil.getInstance(context).setLastChangeLogVersion(currentVersion);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
} }

View file

@ -13,15 +13,21 @@ 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
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.* import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.container
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.empty
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.emptyEmoji
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.emptyText
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.recyclerView
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> : AbsLibraryPagerFragment(), AppBarLayout.OnOffsetChangedListener { abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> :
AbsLibraryPagerFragment(), AppBarLayout.OnOffsetChangedListener {
protected var adapter: A? = null protected var adapter: A? = null
protected var layoutManager: LM? = null protected var layoutManager: LM? = null
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View? { ): View? {
return inflater.inflate(R.layout.fragment_main_activity_recycler_view, container, false) return inflater.inflate(R.layout.fragment_main_activity_recycler_view, container, false)
} }
@ -40,6 +46,8 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
} }
recyclerView.layoutManager = layoutManager recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter recyclerView.adapter = adapter
OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL)
} }
private fun initAdapter() { private fun initAdapter() {
@ -89,10 +97,11 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
override fun onOffsetChanged(p0: AppBarLayout?, i: Int) { override fun onOffsetChanged(p0: AppBarLayout?, i: Int) {
container.setPadding( container.setPadding(
container.paddingLeft, container.paddingLeft,
container.paddingTop, container.paddingTop,
container.paddingRight, container.paddingRight,
libraryFragment.totalAppBarScrollingRange + i) libraryFragment.totalAppBarScrollingRange + i
)
} }
override fun onQueueChanged() { override fun onQueueChanged() {

View file

@ -4,12 +4,16 @@ import android.app.ActivityOptions
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics import android.util.DisplayMetrics
import android.view.* import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import code.name.monkey.appthemehelper.common.ATHToolbarActivity import code.name.monkey.appthemehelper.common.ATHToolbarActivity
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.ToolbarContentTintHelper import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.App import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.Constants import code.name.monkey.retromusic.Constants
@ -30,14 +34,24 @@ import code.name.monkey.retromusic.mvp.presenter.HomePresenter
import code.name.monkey.retromusic.mvp.presenter.HomeView import code.name.monkey.retromusic.mvp.presenter.HomeView
import code.name.monkey.retromusic.util.NavigationUtil 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 com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.DiskCacheStrategy
import kotlinx.android.synthetic.main.abs_playlists.* import kotlinx.android.synthetic.main.abs_playlists.actionShuffle
import kotlinx.android.synthetic.main.fragment_banner_home.* import kotlinx.android.synthetic.main.abs_playlists.history
import kotlinx.android.synthetic.main.home_content.* import kotlinx.android.synthetic.main.abs_playlists.lastAdded
import kotlinx.android.synthetic.main.abs_playlists.topPlayed
import kotlinx.android.synthetic.main.fragment_banner_home.bannerImage
import kotlinx.android.synthetic.main.fragment_banner_home.titleWelcome
import kotlinx.android.synthetic.main.fragment_banner_home.toolbarContainer
import kotlinx.android.synthetic.main.fragment_banner_home.userImage
import kotlinx.android.synthetic.main.fragment_home.container
import kotlinx.android.synthetic.main.home_content.emptyContainer
import kotlinx.android.synthetic.main.home_content.recyclerView
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
import java.io.File import java.io.File
import java.util.* import java.util.ArrayList
import java.util.Calendar
import java.util.Random
import javax.inject.Inject import javax.inject.Inject
class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallbacks, HomeView { class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallbacks, HomeView {
@ -53,18 +67,22 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
} }
override fun onCreateView(inflater: LayoutInflater, viewGroup: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, viewGroup: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(if (PreferenceUtil.getInstance(requireContext()).isHomeBanner) R.layout.fragment_banner_home else R.layout.fragment_home, viewGroup, false) return inflater.inflate(
if (PreferenceUtil.getInstance(requireContext()).isHomeBanner) R.layout.fragment_banner_home else R.layout.fragment_home,
viewGroup,
false
)
} }
private fun loadImageFromStorage() { private fun loadImageFromStorage() {
Glide.with(requireContext()) Glide.with(requireContext())
.load(File(PreferenceUtil.getInstance(requireContext()).profileImage, Constants.USER_PROFILE)) .load(File(PreferenceUtil.getInstance(requireContext()).profileImage, Constants.USER_PROFILE))
.asBitmap() .asBitmap()
.diskCacheStrategy(DiskCacheStrategy.NONE) .diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true) .skipMemoryCache(true)
.placeholder(R.drawable.ic_person_flat) .placeholder(R.drawable.ic_person_flat)
.error(R.drawable.ic_person_flat) .error(R.drawable.ic_person_flat)
.into(userImage) .into(userImage)
} }
private val displayMetrics: DisplayMetrics private val displayMetrics: DisplayMetrics
@ -81,7 +99,11 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
toolbar = view.findViewById(R.id.toolbar) toolbar = view.findViewById(R.id.toolbar)
bannerImage?.setOnClickListener { bannerImage?.setOnClickListener {
val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, userImage, getString(R.string.transition_user_image)) val options = ActivityOptions.makeSceneTransitionAnimation(
mainActivity,
userImage,
getString(R.string.transition_user_image)
)
NavigationUtil.goToUserInfo(requireActivity(), options) NavigationUtil.goToUserInfo(requireActivity(), options)
} }
@ -104,7 +126,11 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
setupToolbar() setupToolbar()
userImage?.setOnClickListener { userImage?.setOnClickListener {
val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, userImage, getString(R.string.transition_user_image)) val options = ActivityOptions.makeSceneTransitionAnimation(
mainActivity,
userImage,
getString(R.string.transition_user_image)
)
NavigationUtil.goToUserInfo(requireActivity(), options) NavigationUtil.goToUserInfo(requireActivity(), options)
} }
titleWelcome?.text = String.format("%s", PreferenceUtil.getInstance(requireContext()).userName) titleWelcome?.text = String.format("%s", PreferenceUtil.getInstance(requireContext()).userName)
@ -118,14 +144,8 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
} }
homePresenter.attachView(this) homePresenter.attachView(this)
homePresenter.loadSections() homePresenter.loadSections()
}
private fun toolbarColor(): Int { OverScrollDecoratorHelper.setUpOverScroll(container)
return if (PreferenceUtil.getInstance(requireContext()).isHomeBanner) {
ColorUtil.withAlpha(RetroColorUtil.toolbarColor(mainActivity), 0.85f)
} else {
RetroColorUtil.toolbarColor(mainActivity)
}
} }
private fun setupToolbar() { private fun setupToolbar() {
@ -133,7 +153,11 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
backgroundTintList = ColorStateList.valueOf(ATHUtil.resolveColor(requireContext(), R.attr.colorSurface)) backgroundTintList = ColorStateList.valueOf(ATHUtil.resolveColor(requireContext(), R.attr.colorSurface))
setNavigationIcon(R.drawable.ic_menu_white_24dp) setNavigationIcon(R.drawable.ic_menu_white_24dp)
setOnClickListener { setOnClickListener {
val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, toolbarContainer, getString(R.string.transition_toolbar)) val options = ActivityOptions.makeSceneTransitionAnimation(
mainActivity,
toolbarContainer,
getString(R.string.transition_toolbar)
)
NavigationUtil.goToSearch(requireActivity(), options) NavigationUtil.goToSearch(requireActivity(), options)
} }
@ -164,7 +188,12 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
super.onCreateOptionsMenu(menu, inflater) super.onCreateOptionsMenu(menu, inflater)
inflater.inflate(R.menu.menu_search, menu) inflater.inflate(R.menu.menu_search, menu)
ToolbarContentTintHelper.handleOnCreateOptionsMenu(requireActivity(), toolbar, menu, ATHToolbarActivity.getToolbarBackgroundColor(toolbar)) ToolbarContentTintHelper.handleOnCreateOptionsMenu(
requireActivity(),
toolbar,
menu,
ATHToolbarActivity.getToolbarBackgroundColor(toolbar)
)
} }
override fun onPrepareOptionsMenu(menu: Menu) { override fun onPrepareOptionsMenu(menu: Menu) {
@ -174,7 +203,11 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == R.id.action_search) { if (item.itemId == R.id.action_search) {
val options = ActivityOptions.makeSceneTransitionAnimation(mainActivity, toolbarContainer, getString(R.string.transition_toolbar)) val options = ActivityOptions.makeSceneTransitionAnimation(
mainActivity,
toolbarContainer,
getString(R.string.transition_toolbar)
)
NavigationUtil.goToSearch(requireActivity(), true, options) NavigationUtil.goToSearch(requireActivity(), true, options)
} }
return super.onOptionsItemSelected(item) return super.onOptionsItemSelected(item)
@ -195,25 +228,24 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
loadTimeImage(day) loadTimeImage(day)
} }
private fun loadTimeImage(day: String) { private fun loadTimeImage(day: String) {
bannerImage?.let { bannerImage?.let {
val request = Glide.with(requireContext()) val request = Glide.with(requireContext())
if (PreferenceUtil.getInstance(requireContext()).bannerImage.isEmpty()) { if (PreferenceUtil.getInstance(requireContext()).bannerImage.isEmpty()) {
request.load(day) request.load(day)
.diskCacheStrategy(DiskCacheStrategy.NONE) .diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true) .skipMemoryCache(true)
.placeholder(R.drawable.material_design_default) .placeholder(R.drawable.material_design_default)
.error(R.drawable.material_design_default) .error(R.drawable.material_design_default)
.into(it) .into(it)
} else { } else {
request.load(File(PreferenceUtil.getInstance(requireContext()).bannerImage, USER_BANNER)) request.load(File(PreferenceUtil.getInstance(requireContext()).bannerImage, USER_BANNER))
.asBitmap() .asBitmap()
.diskCacheStrategy(DiskCacheStrategy.NONE) .diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true) .skipMemoryCache(true)
.placeholder(R.drawable.material_design_default) .placeholder(R.drawable.material_design_default)
.error(R.drawable.material_design_default) .error(R.drawable.material_design_default)
.into(it) .into(it)
} }
} }
loadImageFromStorage() loadImageFromStorage()

View file

@ -26,8 +26,18 @@ import androidx.preference.PreferenceManager
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceFragmentCompat import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceFragmentCompat
import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.preferences.* import code.name.monkey.retromusic.preferences.AlbumCoverStylePreference
import code.name.monkey.retromusic.preferences.AlbumCoverStylePreferenceDialog
import code.name.monkey.retromusic.preferences.BlacklistPreference
import code.name.monkey.retromusic.preferences.BlacklistPreferenceDialog
import code.name.monkey.retromusic.preferences.LibraryPreference
import code.name.monkey.retromusic.preferences.LibraryPreferenceDialog
import code.name.monkey.retromusic.preferences.MaterialListPreference
import code.name.monkey.retromusic.preferences.MaterialListPreferenceDialog
import code.name.monkey.retromusic.preferences.NowPlayingScreenPreference
import code.name.monkey.retromusic.preferences.NowPlayingScreenPreferenceDialog
import code.name.monkey.retromusic.util.NavigationUtil import code.name.monkey.retromusic.util.NavigationUtil
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
/** /**
* @author Hemanth S (h4h13). * @author Hemanth S (h4h13).
@ -54,9 +64,11 @@ abstract class AbsSettingsFragment : ATEPreferenceFragmentCompat() {
protected fun setSummary(preference: Preference?) { protected fun setSummary(preference: Preference?) {
preference?.let { preference?.let {
setSummary(it, PreferenceManager setSummary(
it, PreferenceManager
.getDefaultSharedPreferences(it.context) .getDefaultSharedPreferences(it.context)
.getString(it.key, "")) .getString(it.key, "")
)
} }
} }
@ -68,6 +80,7 @@ abstract class AbsSettingsFragment : ATEPreferenceFragmentCompat() {
listView.setPadding(0, 0, 0, 0) listView.setPadding(0, 0, 0, 0)
listView.setPaddingRelative(0, 0, 0, 0) listView.setPaddingRelative(0, 0, 0, 0)
invalidateSettings() invalidateSettings()
OverScrollDecoratorHelper.setUpOverScroll(listView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL)
} }
override fun onCreatePreferenceDialog(preference: Preference): DialogFragment? { override fun onCreatePreferenceDialog(preference: Preference): DialogFragment? {

View file

@ -28,12 +28,23 @@ import code.name.monkey.retromusic.activities.SettingsActivity
import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.hide
import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.extensions.show
import code.name.monkey.retromusic.util.NavigationUtil import code.name.monkey.retromusic.util.NavigationUtil
import kotlinx.android.synthetic.main.fragment_main_settings.* import kotlinx.android.synthetic.main.fragment_main_settings.aboutSettings
import kotlinx.android.synthetic.main.fragment_main_settings.audioSettings
import kotlinx.android.synthetic.main.fragment_main_settings.buyPremium
import kotlinx.android.synthetic.main.fragment_main_settings.buyProContainer
import kotlinx.android.synthetic.main.fragment_main_settings.container
import kotlinx.android.synthetic.main.fragment_main_settings.diamondIcon
import kotlinx.android.synthetic.main.fragment_main_settings.generalSettings
import kotlinx.android.synthetic.main.fragment_main_settings.imageSettings
import kotlinx.android.synthetic.main.fragment_main_settings.notificationSettings
import kotlinx.android.synthetic.main.fragment_main_settings.nowPlayingSettings
import kotlinx.android.synthetic.main.fragment_main_settings.otherSettings
import kotlinx.android.synthetic.main.fragment_main_settings.personalizeSettings
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
class MainSettingsFragment : Fragment(), View.OnClickListener { class MainSettingsFragment : Fragment(), View.OnClickListener {
override fun onClick(v: View) { override fun onClick(view: View) {
when (v.id) { when (view.id) {
R.id.generalSettings -> inflateFragment(ThemeSettingsFragment(), R.string.general_settings_title) R.id.generalSettings -> inflateFragment(ThemeSettingsFragment(), R.string.general_settings_title)
R.id.audioSettings -> inflateFragment(AudioSettings(), R.string.pref_header_audio) R.id.audioSettings -> inflateFragment(AudioSettings(), R.string.pref_header_audio)
R.id.nowPlayingSettings -> inflateFragment(NowPlayingSettingsFragment(), R.string.now_playing) R.id.nowPlayingSettings -> inflateFragment(NowPlayingSettingsFragment(), R.string.now_playing)
@ -45,8 +56,10 @@ class MainSettingsFragment : Fragment(), View.OnClickListener {
} }
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, override fun onCreateView(
savedInstanceState: Bundle?): View? { inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_main_settings, container, false) return inflater.inflate(R.layout.fragment_main_settings, container, false)
} }
@ -75,7 +88,7 @@ class MainSettingsFragment : Fragment(), View.OnClickListener {
buyPremium.setTextColor(it) buyPremium.setTextColor(it)
diamondIcon.imageTintList = ColorStateList.valueOf(it) diamondIcon.imageTintList = ColorStateList.valueOf(it)
} }
OverScrollDecoratorHelper.setUpOverScroll(container)
} }
private fun inflateFragment(fragment: Fragment, @StringRes title: Int) { private fun inflateFragment(fragment: Fragment, @StringRes title: Int) {

View file

@ -67,6 +67,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:fillViewport="true" android:fillViewport="true"
android:id="@+id/container"
android:overScrollMode="never"> android:overScrollMode="never">
<LinearLayout <LinearLayout

View file

@ -61,6 +61,7 @@
</LinearLayout> </LinearLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
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_weight="1" android:layout_weight="1"
@ -115,5 +116,4 @@
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -28,11 +28,11 @@
</FrameLayout> </FrameLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/toolbar_margin_horizontal" android:layout_marginStart="@dimen/toolbar_margin_horizontal"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal" android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
app:behavior_overlapTop="72dp"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<LinearLayout <LinearLayout

View file

@ -71,6 +71,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/toolbar_margin_horizontal" android:layout_marginStart="@dimen/toolbar_margin_horizontal"

View file

@ -19,7 +19,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/background" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
@ -48,7 +48,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
style="@style/Toolbar" style="@style/Toolbar"

View file

@ -54,6 +54,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"

View file

@ -53,6 +53,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"

View file

@ -114,6 +114,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:behavior_overlapTop="52dp" app:behavior_overlapTop="52dp"

View file

@ -17,8 +17,8 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_fragment_content" android:id="@+id/main_fragment_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="?attr/colorSurface"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
@ -71,6 +71,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
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_marginStart="@dimen/toolbar_margin_horizontal" android:layout_marginStart="@dimen/toolbar_margin_horizontal"

View file

@ -54,6 +54,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"

View file

@ -54,6 +54,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"

View file

@ -111,6 +111,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:behavior_overlapTop="52dp" app:behavior_overlapTop="52dp"

View file

@ -72,11 +72,11 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/toolbar_margin_horizontal" android:layout_marginStart="@dimen/toolbar_margin_horizontal"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal" android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
android:layout_weight="1"
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

View file

@ -35,6 +35,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

View file

@ -43,6 +43,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
@ -50,7 +51,6 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<code.name.monkey.retromusic.views.WidthFitSquareCardView <code.name.monkey.retromusic.views.WidthFitSquareCardView

View file

@ -14,6 +14,7 @@
android:layout_marginStart="@dimen/button_margin_horizontal" android:layout_marginStart="@dimen/button_margin_horizontal"
android:layout_marginEnd="@dimen/button_margin_horizontal" android:layout_marginEnd="@dimen/button_margin_horizontal"
android:text="@string/action_play_all" android:text="@string/action_play_all"
app:backgroundTint="?attr/colorSurface"
app:icon="@drawable/ic_play_arrow_white_24dp" app:icon="@drawable/ic_play_arrow_white_24dp"
app:layout_constraintEnd_toStartOf="@+id/shuffleAction" app:layout_constraintEnd_toStartOf="@+id/shuffleAction"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
@ -27,6 +28,7 @@
android:layout_marginStart="@dimen/button_margin_horizontal" android:layout_marginStart="@dimen/button_margin_horizontal"
android:layout_marginEnd="@dimen/button_margin_horizontal" android:layout_marginEnd="@dimen/button_margin_horizontal"
android:text="@string/shuffle" android:text="@string/shuffle"
app:backgroundTint="?attr/colorSurface"
app:icon="@drawable/ic_shuffle_white_24dp" app:icon="@drawable/ic_shuffle_white_24dp"
app:layout_constraintBottom_toBottomOf="@+id/playAction" app:layout_constraintBottom_toBottomOf="@+id/playAction"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View file

@ -32,7 +32,8 @@
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
style="@style/Toolbar" style="@style/Toolbar"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp" /> app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
tools:background="?attr/colorSurface" />
<ViewStub <ViewStub
android:id="@+id/cab_stub" android:id="@+id/cab_stub"
@ -42,6 +43,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
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:overScrollMode="never" android:overScrollMode="never"

View file

@ -18,6 +18,7 @@
android:background="?attr/colorSurface"> android:background="?attr/colorSurface">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

View file

@ -42,6 +42,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill_vertical" android:layout_gravity="fill_vertical"
android:id="@+id/container"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<code.name.monkey.retromusic.views.LollipopFixedWebView <code.name.monkey.retromusic.views.LollipopFixedWebView

View file

@ -28,6 +28,7 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:id="@+id/container"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

View file

@ -70,6 +70,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

View file

@ -0,0 +1,40 @@
/*
* Copyright (c) 2020 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 me.everything.android.ui.overscroll.adapters;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.core.widget.NestedScrollView;
public class NestedScrollViewOverScrollDecorAdapter implements IOverScrollDecoratorAdapter {
protected final NestedScrollView mView;
public NestedScrollViewOverScrollDecorAdapter(@NonNull NestedScrollView view) {
this.mView = view;
}
public View getView() {
return this.mView;
}
public boolean isInAbsoluteEnd() {
return !this.mView.canScrollVertically(1);
}
public boolean isInAbsoluteStart() {
return !this.mView.canScrollVertically(-1);
}
}

View file

@ -1 +1 @@
include ':app', ':appthemehelper', ':core' include ':app', ':appthemehelper', ':liboverscroll'