mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Merge pull request #4726 from Bnyro/master
feat: preference to disable sponsorblock submit button
This commit is contained in:
commit
0bf19d9437
@ -144,6 +144,7 @@ object PreferenceKeys {
|
||||
const val CLEAR_BOOKMARKS = "clear_bookmarks"
|
||||
const val MAX_CONCURRENT_DOWNLOADS = "max_concurrent_downloads"
|
||||
const val DISABLE_VIDEO_IMAGE_PROXY = "disable_video_image_proxy"
|
||||
const val CONTRIBUTE_TO_SB = "sb_contribute_key"
|
||||
|
||||
/**
|
||||
* History
|
||||
|
@ -13,8 +13,10 @@ import androidx.media3.exoplayer.trackselection.TrackSelector
|
||||
import androidx.media3.ui.PlayerView.ControllerVisibilityListener
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.constants.IntentData
|
||||
import com.github.libretube.constants.PreferenceKeys
|
||||
import com.github.libretube.extensions.toID
|
||||
import com.github.libretube.helpers.PlayerHelper
|
||||
import com.github.libretube.helpers.PreferenceHelper
|
||||
import com.github.libretube.helpers.WindowHelper
|
||||
import com.github.libretube.obj.BottomSheetItem
|
||||
import com.github.libretube.ui.base.BaseActivity
|
||||
@ -166,7 +168,7 @@ class OnlinePlayerView(
|
||||
PlayerHelper.autoPlayEnabled = isChecked
|
||||
}
|
||||
|
||||
binding.sbSubmit.isVisible = PlayerHelper.sponsorBlockEnabled
|
||||
binding.sbSubmit.isVisible = PreferenceHelper.getBoolean(PreferenceKeys.CONTRIBUTE_TO_SB, false)
|
||||
binding.sbSubmit.setOnClickListener {
|
||||
val currentPosition = player?.currentPosition?.takeIf { it != C.TIME_UNSET } ?: 0
|
||||
val duration = player?.duration?.takeIf { it != C.TIME_UNSET }
|
||||
|
@ -471,6 +471,7 @@
|
||||
<string name="sb_create_segment">Create segment</string>
|
||||
<string name="segment_type">Segment type</string>
|
||||
<string name="sb_invalid_segment">Invalid segment start or end</string>
|
||||
<string name="contribute_to_sponsorblock">Contribute to SponsorBlock</string>
|
||||
|
||||
<!-- Notification channel strings -->
|
||||
<string name="download_channel_name">Download Service</string>
|
||||
|
@ -17,6 +17,14 @@
|
||||
app:key="sb_notifications_key"
|
||||
app:title="@string/sponsorblock_notifications" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:dependency="sb_contribute_key"
|
||||
android:summaryOff="@string/disabled"
|
||||
android:summaryOn="@string/enabled"
|
||||
app:defaultValue="false"
|
||||
app:key="sb_contribute_key"
|
||||
app:title="@string/contribute_to_sponsorblock" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
app:defaultValue="false"
|
||||
app:key="dearrow"
|
||||
|
Loading…
Reference in New Issue
Block a user