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",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 1,
|
"versionCode": 2,
|
||||||
"versionName": "1.0",
|
"versionName": "0.2",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -22,6 +22,7 @@ import androidx.navigation.ui.NavigationUI.onNavDestinationSelected
|
|||||||
import androidx.navigation.ui.setupWithNavController
|
import androidx.navigation.ui.setupWithNavController
|
||||||
import com.google.android.exoplayer2.ExoPlayer
|
import com.google.android.exoplayer2.ExoPlayer
|
||||||
import com.google.android.material.color.DynamicColors
|
import com.google.android.material.color.DynamicColors
|
||||||
|
import java.lang.Exception
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
lateinit var bottomNavigationView: BottomNavigationView
|
lateinit var bottomNavigationView: BottomNavigationView
|
||||||
@ -72,15 +73,23 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
val mainMotionLayout = findViewById<MotionLayout>(R.id.mainMotionLayout)
|
try{
|
||||||
if (mainMotionLayout.progress == 0.toFloat()){
|
val mainMotionLayout = findViewById<MotionLayout>(R.id.mainMotionLayout)
|
||||||
mainMotionLayout.transitionToEnd()
|
if (mainMotionLayout.progress == 0.toFloat()){
|
||||||
findViewById<MotionLayout>(R.id.playerMotionLayout).transitionToEnd()
|
mainMotionLayout.transitionToEnd()
|
||||||
}else{
|
findViewById<MotionLayout>(R.id.playerMotionLayout).transitionToEnd()
|
||||||
navController.popBackStack()
|
}else{
|
||||||
if (navController.currentBackStackEntry == null){
|
navController.popBackStack()
|
||||||
finish()
|
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 {
|
object RetrofitInstance {
|
||||||
val api: PipedApi by lazy {
|
val api: PipedApi by lazy {
|
||||||
Retrofit.Builder()
|
Retrofit.Builder()
|
||||||
.baseUrl("https://pipedapi.tokhmi.xyz/")
|
.baseUrl("https://pipedapi.kavin.rocks/")
|
||||||
.addConverterFactory(JacksonConverterFactory.create())
|
.addConverterFactory(JacksonConverterFactory.create())
|
||||||
.build()
|
.build()
|
||||||
.create(PipedApi::class.java)
|
.create(PipedApi::class.java)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user