Fixed Lyrics dialog when clicked on Navigation Bar
This commit is contained in:
parent
2cb8ed4ade
commit
34c2f6e3d3
1 changed files with 6 additions and 1 deletions
|
@ -24,6 +24,7 @@ import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.activities.MainActivity
|
||||||
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.glide.GlideApp
|
import code.name.monkey.retromusic.glide.GlideApp
|
||||||
|
@ -35,6 +36,7 @@ import code.name.monkey.retromusic.util.MusicUtil
|
||||||
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.color.MediaNotificationProcessor
|
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDED
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
@ -89,6 +91,7 @@ class AlbumCoverPagerAdapter(
|
||||||
private lateinit var song: Song
|
private lateinit var song: Song
|
||||||
private var colorReceiver: ColorReceiver? = null
|
private var colorReceiver: ColorReceiver? = null
|
||||||
private var request: Int = 0
|
private var request: Int = 0
|
||||||
|
private val mainActivity get() = activity as MainActivity
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -106,7 +109,9 @@ class AlbumCoverPagerAdapter(
|
||||||
ViewCompat.setTransitionName(view, "lyrics")
|
ViewCompat.setTransitionName(view, "lyrics")
|
||||||
albumCover = view.findViewById(R.id.player_image)
|
albumCover = view.findViewById(R.id.player_image)
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
showLyricsDialog()
|
if (mainActivity.getBottomSheetBehavior().state == STATE_EXPANDED) {
|
||||||
|
showLyricsDialog()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue