mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
player fragment on backpressed
This commit is contained in:
parent
c99a1cddd9
commit
8ed17ae695
@ -36,7 +36,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottomNav)
|
bottomNavigationView = findViewById(R.id.bottomNav)
|
||||||
|
|
||||||
|
|
||||||
navController = findNavController(R.id.fragment)
|
navController = findNavController(R.id.fragment)
|
||||||
@ -52,7 +52,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
"Libre<span style='color:$hexColor';>Tube</span>",
|
"Libre<span style='color:$hexColor';>Tube</span>",
|
||||||
HtmlCompat.FROM_HTML_MODE_COMPACT
|
HtmlCompat.FROM_HTML_MODE_COMPACT
|
||||||
)
|
)
|
||||||
toolbar.setTitle(appName)
|
toolbar.title= appName
|
||||||
|
|
||||||
toolbar.setNavigationOnClickListener{
|
toolbar.setNavigationOnClickListener{
|
||||||
//settings fragment stuff
|
//settings fragment stuff
|
||||||
@ -72,11 +72,15 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
|
val mainMotionLayout = findViewById<MotionLayout>(R.id.mainMotionLayout)
|
||||||
|
if (mainMotionLayout.progress == 0.toFloat()){
|
||||||
|
mainMotionLayout.transitionToEnd()
|
||||||
|
findViewById<MotionLayout>(R.id.playerMotionLayout).transitionToEnd()
|
||||||
|
}else{
|
||||||
navController.popBackStack()
|
navController.popBackStack()
|
||||||
if (navController.currentBackStackEntry == null){
|
if (navController.currentBackStackEntry == null){
|
||||||
finish()
|
finish()
|
||||||
}
|
}}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user