[Android] Add the dialog listener to display the certificate errors for streams
Nicolas Pomepuy
git at videolan.org
Fri Apr 30 07:02:48 UTC 2021
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Apr 28 12:29:23 2021 +0200| [78ce29cb43f8ce7fda58df53852a56326c29804c] | committer: Nicolas Pomepuy
Add the dialog listener to display the certificate errors for streams
Fixes #1998
> https://code.videolan.org/videolan/vlc-android/commit/78ce29cb43f8ce7fda58df53852a56326c29804c
---
.../src/org/videolan/vlc/gui/SecondaryActivity.kt | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
index b451108ed..31ea12da8 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
@@ -24,8 +24,6 @@
package org.videolan.vlc.gui
import android.content.Intent
-import android.content.res.Configuration
-import android.os.Build
import android.os.Bundle
import android.view.MenuItem
import android.view.View
@@ -35,6 +33,7 @@ import androidx.fragment.app.Fragment
import com.google.android.material.appbar.AppBarLayout
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
+import org.videolan.libvlc.Dialog
import org.videolan.medialibrary.interfaces.Medialibrary
import org.videolan.medialibrary.interfaces.media.MediaWrapper
import org.videolan.resources.AndroidDevices
@@ -54,14 +53,18 @@ import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.gui.network.MRLPanelFragment
import org.videolan.vlc.gui.video.VideoGridFragment
import org.videolan.vlc.reloadLibrary
+import org.videolan.vlc.util.DialogDelegate
+import org.videolan.vlc.util.IDialogManager
import org.videolan.vlc.util.isSchemeNetwork
@ExperimentalCoroutinesApi
@ObsoleteCoroutinesApi
-class SecondaryActivity : ContentActivity() {
+class SecondaryActivity : ContentActivity(), IDialogManager {
private var fragment: Fragment? = null
override val displayTitle = true
+ private val dialogsDelegate = DialogDelegate()
+
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -91,8 +94,16 @@ class SecondaryActivity : ContentActivity() {
.add(R.id.fragment_placeholder, fragment!!)
.commit()
}
+ dialogsDelegate.observeDialogs(this, this)
+ }
+
+ override fun fireDialog(dialog: Dialog) {
+ DialogActivity.dialog = dialog
+ startActivity(Intent(DialogActivity.KEY_DIALOG, null, this, DialogActivity::class.java))
}
+ override fun dialogCanceled(dialog: Dialog?) {}
+
override fun forceLoadVideoFragment() {
val fragmentId = intent.getStringExtra(KEY_FRAGMENT)
fetchSecondaryFragment(fragmentId)
More information about the Android
mailing list