mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
back button null exception
This commit is contained in:
parent
7c635555cd
commit
7a94c08331
@ -11,8 +11,8 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"versionCode": 2,
|
||||
"versionName": "0.2",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
@ -22,6 +22,7 @@ import androidx.navigation.ui.NavigationUI.onNavDestinationSelected
|
||||
import androidx.navigation.ui.setupWithNavController
|
||||
import com.google.android.exoplayer2.ExoPlayer
|
||||
import com.google.android.material.color.DynamicColors
|
||||
import java.lang.Exception
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
lateinit var bottomNavigationView: BottomNavigationView
|
||||
@ -72,15 +73,23 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
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()
|
||||
if (navController.currentBackStackEntry == null){
|
||||
finish()
|
||||
}}
|
||||
try{
|
||||
val mainMotionLayout = findViewById<MotionLayout>(R.id.mainMotionLayout)
|
||||
if (mainMotionLayout.progress == 0.toFloat()){
|
||||
mainMotionLayout.transitionToEnd()
|
||||
findViewById<MotionLayout>(R.id.playerMotionLayout).transitionToEnd()
|
||||
}else{
|
||||
navController.popBackStack()
|
||||
if (navController.currentBackStackEntry == null){
|
||||
finish()
|
||||
}}
|
||||
}catch (e: Exception){
|
||||
navController.popBackStack()
|
||||
if (navController.currentBackStackEntry == null){
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import retrofit2.converter.jackson.JacksonConverterFactory
|
||||
object RetrofitInstance {
|
||||
val api: PipedApi by lazy {
|
||||
Retrofit.Builder()
|
||||
.baseUrl("https://pipedapi.tokhmi.xyz/")
|
||||
.baseUrl("https://pipedapi.kavin.rocks/")
|
||||
.addConverterFactory(JacksonConverterFactory.create())
|
||||
.build()
|
||||
.create(PipedApi::class.java)
|
||||
|
Loading…
x
Reference in New Issue
Block a user