3
3
Fork 1
mirror of https://github.com/recloudstream/cloudstream.git synced 2024-08-15 01:53:11 +00:00

Use BackPressedCallbackHelper in DownloadedPlayerActivity

This commit is contained in:
Luna712 2024-07-11 16:25:29 -06:00 committed by GitHub
parent d95af138b8
commit c9567c9694
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,15 +4,13 @@ import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.KeyEvent
import androidx.activity.OnBackPressedCallback
import androidx.appcompat.app.AppCompatActivity
import com.lagradost.cloudstream3.CommonActivity
import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.utils.UIHelper.navigate
import com.lagradost.safefile.SafeFile
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
import com.lagradost.cloudstream3.ui.player.OfflinePlaybackHelper.playLink
import com.lagradost.cloudstream3.ui.player.OfflinePlaybackHelper.playUri
import com.lagradost.cloudstream3.utils.BackPressedCallbackHelper.attachBackPressedCallback
const val DTAG = "PlayerActivity"
@ -74,14 +72,7 @@ class DownloadedPlayerActivity : AppCompatActivity() {
return
}
onBackPressedDispatcher.addCallback(
this,
object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
finish()
}
}
)
attachBackPressedCallback { finish() }
}
override fun onResume() {