Fix plain text links and NPE when opening link from external source

This commit is contained in:
Krunal Patel 2022-11-26 23:16:49 +05:30
parent 588b3e9bbb
commit d7436aaf2c
2 changed files with 4 additions and 1 deletions

View File

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

View File

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