Fixed status bar color when cab is on while switching tabs
This commit is contained in:
parent
1dc310d657
commit
fa191b0cf4
6 changed files with 29 additions and 9 deletions
|
@ -62,7 +62,7 @@ class MainActivity : AbsCastActivity(), OnSharedPreferenceChangeListener {
|
|||
if (!hasPermissions()) {
|
||||
findNavController(R.id.fragment_container).navigate(R.id.permissionFragment)
|
||||
}
|
||||
if (BuildConfig.VERSION_CODE > PreferenceUtil.lastVersion && !BuildConfig.DEBUG){
|
||||
if (BuildConfig.VERSION_CODE > PreferenceUtil.lastVersion && !BuildConfig.DEBUG) {
|
||||
NavigationUtil.gotoWhatNews(this)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.view.MenuItem
|
|||
import androidx.annotation.MenuRes
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.extensions.surfaceColor
|
||||
import code.name.monkey.retromusic.interfaces.ICabCallback
|
||||
|
@ -31,7 +32,10 @@ abstract class AbsMultiSelectAdapter<V : RecyclerView.ViewHolder?, I>(
|
|||
|
||||
override fun onCabFinished(cab: AttachedCab): Boolean {
|
||||
clearChecked()
|
||||
activity.window.statusBarColor = Color.TRANSPARENT
|
||||
activity.window.statusBarColor = when {
|
||||
VersionUtils.hasMarshmallow() -> Color.TRANSPARENT
|
||||
else -> Color.BLACK
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -346,6 +346,13 @@ class AlbumsFragment : AbsRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridL
|
|||
libraryViewModel.forceReload(ReloadType.Albums)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (cab.isActive()) {
|
||||
cab.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleBackPress(): Boolean {
|
||||
cab?.let {
|
||||
if (it.isActive()) {
|
||||
|
|
|
@ -382,4 +382,11 @@ class ArtistsFragment : AbsRecyclerViewCustomGridSizeFragment<ArtistAdapter, Gri
|
|||
super.onResume()
|
||||
libraryViewModel.forceReload(ReloadType.Artists)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (cab.isActive()) {
|
||||
cab.destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,12 +148,8 @@ class FoldersFragment : AbsMainActivityFragment(R.layout.fragment_folder),
|
|||
override fun onPause() {
|
||||
super.onPause()
|
||||
saveScrollPosition()
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
if (_binding != null) {
|
||||
outState.putParcelable(CRUMBS, binding.breadCrumbs.stateWrapper)
|
||||
if (cab.isActive()) {
|
||||
cab.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ class SongsFragment : AbsRecyclerViewCustomGridSizeFragment<SongAdapter, GridLay
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
override val titleRes: Int
|
||||
get() = R.string.songs
|
||||
|
||||
|
@ -346,6 +345,13 @@ class SongsFragment : AbsRecyclerViewCustomGridSizeFragment<SongAdapter, GridLay
|
|||
libraryViewModel.forceReload(ReloadType.Songs)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (cab.isActive()) {
|
||||
cab.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
var TAG: String = SongsFragment::class.java.simpleName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue