mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
fix closing player
This commit is contained in:
parent
45fb8238db
commit
55272b615d
@ -52,6 +52,7 @@ interface PipedApi {
|
||||
@POST("unsubscribe")
|
||||
suspend fun unsubscribe(@Header("Authorization") token: String, @Body subscribe: Subscribe): String
|
||||
|
||||
//only for fetching servers list
|
||||
@GET("Instances.md")
|
||||
suspend fun getInstances(): String
|
||||
|
||||
|
@ -168,14 +168,18 @@ class PlayerFragment : Fragment() {
|
||||
playerMotionLayout.transitionToStart()
|
||||
fetchJson(view)
|
||||
view.findViewById<ImageView>(R.id.close_imageView).setOnClickListener{
|
||||
motionLayout.transitionToEnd()
|
||||
val mainActivity = activity as MainActivity
|
||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
mainActivity.supportFragmentManager.beginTransaction()
|
||||
.remove(this)
|
||||
.commit()
|
||||
|
||||
}
|
||||
view.findViewById<ImageButton>(R.id.close_imageButton).setOnClickListener{
|
||||
motionLayout.transitionToEnd()
|
||||
val mainActivity = activity as MainActivity
|
||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
mainActivity.supportFragmentManager.beginTransaction()
|
||||
.remove(this)
|
||||
.commit()
|
||||
@ -232,8 +236,6 @@ class PlayerFragment : Fragment() {
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
val mainActivity = activity as MainActivity
|
||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
try {
|
||||
exoPlayer.stop()
|
||||
}catch (e: Exception){}
|
||||
|
@ -21,7 +21,7 @@
|
||||
app:entries="@array/instances"
|
||||
app:entryValues="@array/instancesValue"
|
||||
app:defaultValue="https://pipedapi.kavin.rocks/"
|
||||
app:useSimpleSummaryProvider="true"/>
|
||||
/>
|
||||
<androidx.preference.EditTextPreference
|
||||
app:key="customInstance"
|
||||
app:title="@string/customInstance"
|
||||
|
Loading…
x
Reference in New Issue
Block a user