Merge pull request #2091 from Kruna1Pate1/fix/link-open-issue

Fix plain text links and NPE when opening link from external source
This commit is contained in:
Bnyro 2022-11-26 19:02:06 +01:00 committed by GitHub
commit 2ca8cdee71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import android.os.Handler
import android.os.Looper import android.os.Looper
import android.os.PowerManager import android.os.PowerManager
import android.text.format.DateUtils import android.text.format.DateUtils
import android.text.util.Linkify
import android.util.Base64 import android.util.Base64
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
@ -893,6 +894,8 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
if (description.contains("<") && description.contains(">")) { if (description.contains("<") && description.contains(">")) {
binding.playerDescription.setFormattedHtml(description) binding.playerDescription.setFormattedHtml(description)
} else { } else {
// Links can be present as plain text
binding.playerDescription.autoLinkMask = Linkify.WEB_URLS
binding.playerDescription.text = description binding.playerDescription.text = description
} }

View File

@ -442,7 +442,7 @@ internal class CustomExoPlayerView(
it.layoutParams = params it.layoutParams = params
} }
if (PlayerHelper.swipeGestureEnabled) { if (PlayerHelper.swipeGestureEnabled && this::brightnessHelper.isInitialized) {
when (newConfig?.orientation) { when (newConfig?.orientation) {
Configuration.ORIENTATION_LANDSCAPE -> brightnessHelper.restoreSavedBrightness() Configuration.ORIENTATION_LANDSCAPE -> brightnessHelper.restoreSavedBrightness()
else -> brightnessHelper.resetToSystemBrightness(false) else -> brightnessHelper.resetToSystemBrightness(false)