mirror of
https://github.com/lizongying/my-tv.git
synced 2026-10-26 22:26:29 +08:00
fix still playing after exit
This commit is contained in:
@@ -50,6 +50,7 @@ class MainActivity : FragmentActivity() {
|
||||
.add(R.id.main_browse_fragment, infoFragment)
|
||||
.hide(infoFragment)
|
||||
.commit()
|
||||
mainFragment.view?.requestFocus()
|
||||
}
|
||||
gestureDetector = GestureDetector(this, GestureListener())
|
||||
}
|
||||
@@ -78,6 +79,7 @@ class MainActivity : FragmentActivity() {
|
||||
fun play(tvViewModel: TVViewModel) {
|
||||
Log.i(TAG, "play: ${tvViewModel.getTV()}")
|
||||
playerFragment.play(tvViewModel)
|
||||
mainFragment.view?.requestFocus()
|
||||
}
|
||||
|
||||
fun prev() {
|
||||
@@ -100,7 +102,7 @@ class MainActivity : FragmentActivity() {
|
||||
val transaction = supportFragmentManager.beginTransaction()
|
||||
|
||||
if (mainFragment.isHidden) {
|
||||
// focusMainFragment()
|
||||
focusMainFragment()
|
||||
transaction.show(mainFragment)
|
||||
} else {
|
||||
transaction.hide(mainFragment)
|
||||
|
||||
Reference in New Issue
Block a user