Merge branch 'master' into icon

This commit is contained in:
Bnyro 2022-05-23 21:21:31 +02:00 committed by GitHub
commit 519149ce08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View File

@ -46,7 +46,9 @@ class MainActivity : AppCompatActivity() {
RetrofitInstance.url =
sharedPreferences.getString("instance", "https://pipedapi.kavin.rocks/")!!
SponsorBlockSettings.sponsorBlockEnabled =
sharedPreferences.getBoolean("sponsorblock_enabled_key", false)
sharedPreferences.getBoolean("sb_enabled_key", false)
SponsorBlockSettings.sponsorNotificationsEnabled =
sharedPreferences.getBoolean("sb_notifications_key", false)
SponsorBlockSettings.introEnabled =
sharedPreferences.getBoolean("intro_category_key", false)
SponsorBlockSettings.selfPromoEnabled =

View File

@ -306,7 +306,6 @@ class PlayerFragment : Fragment() {
override fun onDestroy() {
super.onDestroy()
try {
exoPlayer.stop()
exoPlayer.release()
} catch (e: Exception) {
}
@ -317,7 +316,7 @@ class PlayerFragment : Fragment() {
exoPlayerView.postDelayed(this::checkForSegments, 100)
if (segmentData.segments.isEmpty())
if (!::segmentData.isInitialized || segmentData.segments.isEmpty())
return
segmentData.segments.forEach { segment: Segment ->

View File

@ -111,4 +111,6 @@
<string name="material_you">Material You</string>
<string name="sponsorblock_notifications">Notifications</string>
<string name="app_icon">App Icon</string>
<string name="enabled">Enabled</string>
<string name="disabled">Disabled</string>
</resources>

View File

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/sponsorblock">
<SwitchPreferenceCompat
app:key="sb_enabled_key"
app:title="@string/sponsorblock_state"/>
app:title="@string/sponsorblock"
android:summaryOff="@string/disabled"
android:summaryOn="@string/enabled"/>
<SwitchPreferenceCompat
app:key="sb_notifications_key"
app:title="@string/sponsorblock_notifications"/>
</PreferenceCategory>
app:title="@string/sponsorblock_notifications"
android:summaryOff="@string/disabled"
android:summaryOn="@string/enabled"/>
<PreferenceCategory app:title="@string/category_segments">