Fix visual bugs
This commit is contained in:
parent
4bcf9b202e
commit
336f67fd48
15 changed files with 82 additions and 99 deletions
|
@ -24,7 +24,7 @@ android {
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
applicationId "code.name.monkey.retromusic"
|
applicationId "code.name.monkey.retromusic"
|
||||||
versionCode 425
|
versionCode 426
|
||||||
versionName '3.5.210'
|
versionName '3.5.210'
|
||||||
|
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Lennart Glamann",
|
"name": "Lennart Glamann",
|
||||||
"summary": "Designer",
|
"summary": "Play Store banner and Images",
|
||||||
"link": "https://t.me/FlixbusLennart",
|
"link": "https://t.me/FlixbusLennart",
|
||||||
"profile_image": "https://i.imgur.com/Q5Nsx1R.jpg"
|
"profile_image": "https://i.imgur.com/Q5Nsx1R.jpg"
|
||||||
},
|
},
|
||||||
|
|
|
@ -94,11 +94,11 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
setDrawUnderStatusBar()
|
setDrawUnderStatusBar()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
toggleBottomNavigationView(true)
|
|
||||||
setStatusbarColorAuto()
|
setStatusbarColorAuto()
|
||||||
setNavigationbarColorAuto()
|
setNavigationbarColorAuto()
|
||||||
setTaskDescriptionColorAuto()
|
setTaskDescriptionColorAuto()
|
||||||
setLightNavigationBar(true)
|
setLightNavigationBar(true)
|
||||||
|
setBottomBarVisibility(View.GONE)
|
||||||
window.sharedElementsUseOverlay = true
|
window.sharedElementsUseOverlay = true
|
||||||
|
|
||||||
App.musicComponent.inject(this)
|
App.musicComponent.inject(this)
|
||||||
|
|
|
@ -88,11 +88,11 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
setDrawUnderStatusBar()
|
setDrawUnderStatusBar()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
toggleBottomNavigationView(true)
|
|
||||||
setStatusbarColorAuto()
|
setStatusbarColorAuto()
|
||||||
setNavigationbarColorAuto()
|
setNavigationbarColorAuto()
|
||||||
setTaskDescriptionColorAuto()
|
setTaskDescriptionColorAuto()
|
||||||
setLightNavigationBar(true)
|
setLightNavigationBar(true)
|
||||||
|
setBottomBarVisibility(View.GONE)
|
||||||
window.sharedElementsUseOverlay = true
|
window.sharedElementsUseOverlay = true
|
||||||
|
|
||||||
App.musicComponent.inject(this)
|
App.musicComponent.inject(this)
|
||||||
|
|
|
@ -60,8 +60,7 @@ class GenreDetailsActivity : AbsSlidingMusicPanelActivity(), CabHolder, GenreDet
|
||||||
setNavigationbarColorAuto()
|
setNavigationbarColorAuto()
|
||||||
setTaskDescriptionColorAuto()
|
setTaskDescriptionColorAuto()
|
||||||
setLightNavigationBar(true)
|
setLightNavigationBar(true)
|
||||||
toggleBottomNavigationView(true)
|
setBottomBarVisibility(View.GONE)
|
||||||
|
|
||||||
if (intent.extras != null) {
|
if (intent.extras != null) {
|
||||||
genre = intent?.extras?.getParcelable(EXTRA_GENRE_ID)!!
|
genre = intent?.extras?.getParcelable(EXTRA_GENRE_ID)!!
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -23,11 +23,8 @@ import android.content.IntentSender;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -39,14 +36,11 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.transition.TransitionManager;
|
|
||||||
|
|
||||||
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.appbar.AppBarLayout;
|
||||||
import com.google.android.material.card.MaterialCardView;
|
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.google.android.material.textview.MaterialTextView;
|
|
||||||
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;
|
||||||
import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
|
import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
|
||||||
|
@ -93,7 +87,6 @@ import code.name.monkey.retromusic.service.MusicService;
|
||||||
import code.name.monkey.retromusic.util.AppRater;
|
import code.name.monkey.retromusic.util.AppRater;
|
||||||
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.PremiumShow;
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -184,8 +177,10 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
||||||
//PremiumShow.launch(this);
|
//PremiumShow.launch(this);
|
||||||
setupToolbar();
|
setupToolbar();
|
||||||
checkUpdate();
|
checkUpdate();
|
||||||
|
updateTabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void checkUpdate() {
|
private void checkUpdate() {
|
||||||
appUpdateManager = AppUpdateManagerFactory.create(this);
|
appUpdateManager = AppUpdateManagerFactory.create(this);
|
||||||
appUpdateManager.registerListener(listener);
|
appUpdateManager.registerListener(listener);
|
||||||
|
@ -832,11 +827,7 @@ 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);
|
||||||
mToolbar.setOnClickListener(v -> {
|
|
||||||
ActivityOptions options = ActivityOptions
|
|
||||||
.makeSceneTransitionAnimation(this, mToolbar, getString(R.string.transition_toolbar));
|
|
||||||
NavigationUtil.goToSearch(this, options);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
|
||||||
setNavigationbarColorAuto()
|
setNavigationbarColorAuto()
|
||||||
setTaskDescriptionColorAuto()
|
setTaskDescriptionColorAuto()
|
||||||
setLightNavigationBar(true)
|
setLightNavigationBar(true)
|
||||||
toggleBottomNavigationView(true)
|
setBottomBarVisibility(View.GONE)
|
||||||
|
|
||||||
App.musicComponent.inject(this)
|
App.musicComponent.inject(this)
|
||||||
playlistSongsPresenter.attachView(this)
|
playlistSongsPresenter.attachView(this)
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package code.name.monkey.retromusic.activities.base
|
package code.name.monkey.retromusic.activities.base
|
||||||
|
|
||||||
import android.animation.ValueAnimator
|
import android.animation.ValueAnimator
|
||||||
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
|
import android.widget.FrameLayout
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
|
@ -40,7 +42,6 @@ import code.name.monkey.retromusic.util.DensityUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
import code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.card.MaterialCardView
|
|
||||||
import com.google.android.material.shape.MaterialShapeDrawable
|
import com.google.android.material.shape.MaterialShapeDrawable
|
||||||
import com.google.android.material.shape.ShapeAppearanceModel
|
import com.google.android.material.shape.ShapeAppearanceModel
|
||||||
import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
|
import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
|
||||||
|
@ -51,7 +52,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
|
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
|
||||||
}
|
}
|
||||||
|
|
||||||
private lateinit var bottomSheetBehavior: RetroBottomSheetBehavior<MaterialCardView>
|
private lateinit var behavior: RetroBottomSheetBehavior<FrameLayout>
|
||||||
private var miniPlayerFragment: MiniPlayerFragment? = null
|
private var miniPlayerFragment: MiniPlayerFragment? = null
|
||||||
private var playerFragment: AbsPlayerFragment? = null
|
private var playerFragment: AbsPlayerFragment? = null
|
||||||
private var cps: NowPlayingScreen? = null
|
private var cps: NowPlayingScreen? = null
|
||||||
|
@ -63,7 +64,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
protected abstract fun createContentView(): View
|
protected abstract fun createContentView(): View
|
||||||
private lateinit var shapeDrawable: MaterialShapeDrawable
|
private lateinit var shapeDrawable: MaterialShapeDrawable
|
||||||
private val panelState: Int
|
private val panelState: Int
|
||||||
get() = bottomSheetBehavior.state
|
get() = behavior.state
|
||||||
|
|
||||||
private val bottomSheetCallbackList = object : BottomSheetBehavior.BottomSheetCallback() {
|
private val bottomSheetCallbackList = object : BottomSheetBehavior.BottomSheetCallback() {
|
||||||
|
|
||||||
|
@ -90,18 +91,17 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getBottomSheetBehavior() = bottomSheetBehavior
|
fun getBottomSheetBehavior() = behavior
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(createContentView())
|
setContentView(createContentView())
|
||||||
|
|
||||||
chooseFragmentForTheme()
|
chooseFragmentForTheme()
|
||||||
setupSlidingUpPanel()
|
setupSlidingUpPanel()
|
||||||
|
|
||||||
updateTabs()
|
|
||||||
|
|
||||||
bottomSheetBehavior = BottomSheetBehavior.from(slidingPanel) as RetroBottomSheetBehavior
|
|
||||||
|
behavior = BottomSheetBehavior.from(slidingPanel) as RetroBottomSheetBehavior
|
||||||
|
|
||||||
val themeColor = ATHUtil.resolveColor(this, android.R.attr.windowBackground, Color.GRAY)
|
val themeColor = ATHUtil.resolveColor(this, android.R.attr.windowBackground, Color.GRAY)
|
||||||
dimBackground.setBackgroundColor(ColorUtil.withAlpha(themeColor, 0.5f))
|
dimBackground.setBackgroundColor(ColorUtil.withAlpha(themeColor, 0.5f))
|
||||||
|
@ -120,16 +120,16 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
if (cps != PreferenceUtil.getInstance(this).nowPlayingScreen) {
|
if (cps != PreferenceUtil.getInstance(this).nowPlayingScreen) {
|
||||||
postRecreate()
|
postRecreate()
|
||||||
}
|
}
|
||||||
bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallbackList)
|
behavior.addBottomSheetCallback(bottomSheetCallbackList)
|
||||||
|
|
||||||
if (bottomSheetBehavior.state == BottomSheetBehavior.STATE_EXPANDED) {
|
if (behavior.state == BottomSheetBehavior.STATE_EXPANDED) {
|
||||||
setMiniPlayerAlphaProgress(1f)
|
setMiniPlayerAlphaProgress(1f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallbackList)
|
behavior.removeBottomSheetCallback(bottomSheetCallbackList)
|
||||||
if (navigationBarColorAnimator != null) navigationBarColorAnimator?.cancel() // just in case
|
if (navigationBarColorAnimator != null) navigationBarColorAnimator?.cancel() // just in case
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,11 +143,11 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun collapsePanel() {
|
private fun collapsePanel() {
|
||||||
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun expandPanel() {
|
fun expandPanel() {
|
||||||
bottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
|
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||||
setMiniPlayerAlphaProgress(1f)
|
setMiniPlayerAlphaProgress(1f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,40 +204,40 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toggleBottomNavigationView(toggle: Boolean) {
|
|
||||||
bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getBottomNavigationView(): BottomNavigationBarTinted {
|
fun getBottomNavigationView(): BottomNavigationBarTinted {
|
||||||
return bottomNavigationView
|
return bottomNavigationView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setBottomBarVisibility(visible: Int) {
|
||||||
|
bottomNavigationView.visibility = visible
|
||||||
|
hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty())
|
||||||
|
}
|
||||||
|
|
||||||
private fun hideBottomBar(hide: Boolean) {
|
private fun hideBottomBar(hide: Boolean) {
|
||||||
val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height)
|
val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height)
|
||||||
val heightOfBarWithTabs =
|
val heightOfBarWithTabs =
|
||||||
resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded)
|
resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded)
|
||||||
|
|
||||||
if (hide) {
|
if (hide) {
|
||||||
bottomSheetBehavior.isHideable = true
|
behavior.isHideable = true
|
||||||
bottomSheetBehavior.peekHeight = 0
|
behavior.peekHeight = 0
|
||||||
collapsePanel()
|
|
||||||
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
|
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
|
||||||
|
playerFragmentContainer.removeAllViews()
|
||||||
} else {
|
} else {
|
||||||
if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
||||||
slidingPanel.elevation = DensityUtil.dip2px(this, 10f).toFloat()
|
slidingPanel.elevation = DensityUtil.dip2px(this, 10f).toFloat()
|
||||||
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
|
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
|
||||||
bottomSheetBehavior.isHideable = false
|
behavior.isHideable = false
|
||||||
bottomSheetBehavior.peekHeight =
|
behavior.peekHeight =
|
||||||
if (bottomNavigationView.visibility == View.VISIBLE) heightOfBarWithTabs else heightOfBar
|
if (bottomNavigationView.visibility == View.VISIBLE) {
|
||||||
|
heightOfBarWithTabs
|
||||||
|
} else {
|
||||||
|
heightOfBar
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setBottomBarVisibility(gone: Int) {
|
|
||||||
bottomNavigationView.visibility = gone
|
|
||||||
hideBottomBar(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun chooseFragmentForTheme() {
|
private fun chooseFragmentForTheme() {
|
||||||
cps = PreferenceUtil.getInstance(this).nowPlayingScreen
|
cps = PreferenceUtil.getInstance(this).nowPlayingScreen
|
||||||
|
|
||||||
|
@ -260,7 +260,8 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
CLASSIC -> ClassicPlayerFragment()
|
CLASSIC -> ClassicPlayerFragment()
|
||||||
else -> PlayerFragment()
|
else -> PlayerFragment()
|
||||||
} // must implement AbsPlayerFragment
|
} // must implement AbsPlayerFragment
|
||||||
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment)
|
supportFragmentManager.beginTransaction()
|
||||||
|
.replace(R.id.playerFragmentContainer, fragment)
|
||||||
.commit()
|
.commit()
|
||||||
supportFragmentManager.executePendingTransactions()
|
supportFragmentManager.executePendingTransactions()
|
||||||
|
|
||||||
|
@ -294,7 +295,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun handleBackPress(): Boolean {
|
open fun handleBackPress(): Boolean {
|
||||||
if (bottomSheetBehavior.peekHeight != 0 && playerFragment!!.onBackPressed()) return true
|
if (behavior.peekHeight != 0 && playerFragment!!.onBackPressed()) return true
|
||||||
if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
|
if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
|
||||||
collapsePanel()
|
collapsePanel()
|
||||||
return true
|
return true
|
||||||
|
@ -371,30 +372,22 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateTabs() {
|
fun updateTabs() {
|
||||||
bottomNavigationView.menu.clear()
|
bottomNavigationView.menu.clear()
|
||||||
val currentTabs: List<CategoryInfo> = PreferenceUtil.getInstance(this).libraryCategoryInfos
|
val currentTabs: List<CategoryInfo> =
|
||||||
|
PreferenceUtil.getInstance(this).libraryCategoryInfos
|
||||||
for (tab in currentTabs) {
|
for (tab in currentTabs) {
|
||||||
if (tab.visible) {
|
if (tab.visible) {
|
||||||
val menu = tab.category
|
val menu = tab.category
|
||||||
bottomNavigationView.menu.add(0, menu.id, 0, menu.stringRes).setIcon(menu.icon)
|
bottomNavigationView.menu.add(0, menu.id, 0, menu.stringRes).setIcon(menu.icon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currentTabs.size <= 1) {
|
if (bottomNavigationView.menu.size() == 1) {
|
||||||
toggleBottomNavigationView(true)
|
bottomNavigationView.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
|
|
||||||
if (ev?.action == MotionEvent.ACTION_DOWN) {
|
fun Context.dim(dimen: Int) {
|
||||||
if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
|
|
||||||
val outRect = Rect()
|
|
||||||
slidingPanel.getGlobalVisibleRect(outRect)
|
|
||||||
if (!outRect.contains(ev.rawX.toInt(), ev.rawY.toInt())) {
|
|
||||||
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return super.dispatchTouchEvent(ev)
|
|
||||||
}*/
|
|
||||||
}
|
}
|
|
@ -28,7 +28,7 @@ class HorizontalAlbumAdapter(
|
||||||
return ViewHolder(view)
|
return ViewHolder(view)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setColors(color: Int, holder: ViewHolder) {
|
override fun setColors(color: MediaNotificationProcessor, holder: ViewHolder) {
|
||||||
holder.title?.setTextColor(ATHUtil.resolveColor(activity, android.R.attr.textColorPrimary))
|
holder.title?.setTextColor(ATHUtil.resolveColor(activity, android.R.attr.textColorPrimary))
|
||||||
holder.text?.setTextColor(ATHUtil.resolveColor(activity, android.R.attr.textColorSecondary))
|
holder.text?.setTextColor(ATHUtil.resolveColor(activity, android.R.attr.textColorSecondary))
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class HorizontalAlbumAdapter(
|
||||||
.into(object : RetroMusicColoredTarget(holder.image!!) {
|
.into(object : RetroMusicColoredTarget(holder.image!!) {
|
||||||
override fun onLoadCleared(placeholder: Drawable?) {
|
override fun onLoadCleared(placeholder: Drawable?) {
|
||||||
super.onLoadCleared(placeholder)
|
super.onLoadCleared(placeholder)
|
||||||
setColors(albumArtistFooterColor, holder)
|
//setColors(albumArtistFooterColor, holder)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onColorReady(colors: MediaNotificationProcessor) {
|
override fun onColorReady(colors: MediaNotificationProcessor) {
|
||||||
|
|
|
@ -16,12 +16,10 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
|
||||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
super.onActivityCreated(savedInstanceState)
|
super.onActivityCreated(savedInstanceState)
|
||||||
setHasOptionsMenu(true)
|
setHasOptionsMenu(true)
|
||||||
|
|
||||||
mainActivity.setNavigationbarColorAuto()
|
mainActivity.setNavigationbarColorAuto()
|
||||||
mainActivity.setLightNavigationBar(true)
|
mainActivity.setLightNavigationBar(true)
|
||||||
mainActivity.setTaskDescriptionColorAuto()
|
mainActivity.setTaskDescriptionColorAuto()
|
||||||
mainActivity.hideStatusBar()
|
mainActivity.hideStatusBar()
|
||||||
mainActivity.setBottomBarVisibility(View.VISIBLE)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setStatusBarColor(view: View, color: Int) {
|
private fun setStatusBarColor(view: View, color: Int) {
|
||||||
|
|
|
@ -11,10 +11,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.*
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.RetroBottomSheetBehavior
|
import code.name.monkey.retromusic.RetroBottomSheetBehavior
|
||||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||||
|
@ -118,6 +115,10 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
0
|
0
|
||||||
).build()
|
).build()
|
||||||
)
|
)
|
||||||
|
shapeDrawable.fillColor =
|
||||||
|
ColorStateList.valueOf(ATHUtil.resolveColor(requireContext(), R.attr.colorSurface))
|
||||||
|
playerQueueSheet.background = shapeDrawable
|
||||||
|
|
||||||
ToolbarContentTintHelper.colorizeToolbar(
|
ToolbarContentTintHelper.colorizeToolbar(
|
||||||
playerToolbar,
|
playerToolbar,
|
||||||
Color.WHITE,
|
Color.WHITE,
|
||||||
|
@ -253,23 +254,29 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
lastColor = color.backgroundColor
|
lastColor = color.backgroundColor
|
||||||
lastPlaybackControlsColor = color.primaryTextColor
|
lastPlaybackControlsColor = color.primaryTextColor
|
||||||
lastDisabledPlaybackControlsColor = ColorUtil.withAlpha(color.primaryTextColor, 0.3f)
|
lastDisabledPlaybackControlsColor = ColorUtil.withAlpha(color.primaryTextColor, 0.3f)
|
||||||
shapeDrawable.fillColor = ColorStateList.valueOf(color.backgroundColor)
|
|
||||||
playerQueueSheet.background = shapeDrawable
|
|
||||||
|
|
||||||
title.setTextColor(color.primaryTextColor)
|
title.setTextColor(color.primaryTextColor)
|
||||||
text.setTextColor(color.secondaryTextColor)
|
|
||||||
songInfo.setTextColor(color.secondaryTextColor)
|
|
||||||
|
|
||||||
songCurrentProgress.setTextColor(lastPlaybackControlsColor)
|
songCurrentProgress.setTextColor(lastPlaybackControlsColor)
|
||||||
songTotalTime.setTextColor(lastPlaybackControlsColor)
|
songTotalTime.setTextColor(lastPlaybackControlsColor)
|
||||||
|
|
||||||
ViewUtil.setProgressDrawable(progressSlider, color.primaryTextColor, true)
|
ViewUtil.setProgressDrawable(progressSlider, color.primaryTextColor, true)
|
||||||
volumeFragment?.setTintableColor(color.primaryTextColor)
|
volumeFragment?.setTintableColor(
|
||||||
|
ATHUtil.resolveColor(
|
||||||
player_queue_sub_header.setTextColor(color.secondaryTextColor)
|
requireContext(),
|
||||||
|
android.R.attr.textColorPrimary
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
TintHelper.setTintAuto(playPauseButton, color.primaryTextColor, true)
|
TintHelper.setTintAuto(playPauseButton, color.primaryTextColor, true)
|
||||||
TintHelper.setTintAuto(playPauseButton, color.backgroundColor, false)
|
TintHelper.setTintAuto(
|
||||||
|
playPauseButton,
|
||||||
|
MaterialValueHelper.getPrimaryTextColor(
|
||||||
|
requireContext(),
|
||||||
|
ColorUtil.isColorLight(color.primaryTextColor)
|
||||||
|
),
|
||||||
|
false
|
||||||
|
)
|
||||||
updateRepeatState()
|
updateRepeatState()
|
||||||
updateShuffleState()
|
updateShuffleState()
|
||||||
updatePrevNextColor()
|
updatePrevNextColor()
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/playerQueueSheet"
|
android:id="@+id/playerQueueSheet"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
app:behavior_hideable="false"
|
app:behavior_hideable="false"
|
||||||
app:cardCornerRadius="0dp"
|
app:cardCornerRadius="0dp"
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
@ -69,7 +69,8 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/colorSurface"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
|
|
@ -92,10 +92,8 @@
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingStart="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingVertical="8dp"
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:textAppearance="@style/TextViewBody1"
|
android:textAppearance="@style/TextViewBody1"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
|
@ -111,10 +109,8 @@
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:paddingStart="16dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingBottom="12dp"
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/playPauseButton"
|
app:layout_constraintBottom_toTopOf="@+id/playPauseButton"
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
android:layout_height="match_parent"
|
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:scrollbars="none"
|
android:scrollbars="none"
|
||||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||||
|
|
||||||
|
|
|
@ -19,17 +19,14 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<FrameLayout
|
||||||
android:id="@+id/slidingPanel"
|
android:id="@+id/slidingPanel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="bottom"
|
android:background="?attr/colorSurface"
|
||||||
app:behavior_hideable="false"
|
app:behavior_hideable="false"
|
||||||
app:behavior_peekHeight="0dp"
|
app:behavior_peekHeight="0dp"
|
||||||
app:cardCornerRadius="0dp"
|
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior">
|
||||||
app:cardElevation="12dp"
|
|
||||||
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior"
|
|
||||||
app:shapeAppearance="@style/ClassicThemeOverLay">
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/playerFragmentContainer"
|
android:id="@+id/playerFragmentContainer"
|
||||||
|
@ -43,7 +40,7 @@
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
tools:layout="@layout/fragment_mini_player" />
|
tools:layout="@layout/fragment_mini_player" />
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</FrameLayout>
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
||||||
android:id="@+id/bottomNavigationView"
|
android:id="@+id/bottomNavigationView"
|
||||||
|
|
Loading…
Reference in a new issue