mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
Fix the SponsorBlock marker size
This commit is contained in:
parent
dd1c215ba7
commit
1109a93d23
@ -8,10 +8,12 @@ import android.util.AttributeSet
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.api.obj.Segment
|
||||
import com.github.libretube.constants.PreferenceKeys
|
||||
import com.github.libretube.extensions.toPixel
|
||||
import com.github.libretube.util.PreferenceHelper
|
||||
import com.github.libretube.util.ThemeHelper
|
||||
import com.google.android.exoplayer2.Player
|
||||
import com.google.android.exoplayer2.ui.DefaultTimeBar
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
* TimeBar that can be marked with SponsorBlock Segments
|
||||
@ -44,7 +46,7 @@ class MarkableTimeBar(
|
||||
canvas.drawRect(
|
||||
Rect(
|
||||
(it.segment.first() + HORIZONTAL_OFFSET).toLength(),
|
||||
marginY - 1,
|
||||
marginY,
|
||||
(it.segment.last() + HORIZONTAL_OFFSET).toLength(),
|
||||
canvas.height - marginY
|
||||
),
|
||||
@ -74,6 +76,6 @@ class MarkableTimeBar(
|
||||
|
||||
companion object {
|
||||
const val HORIZONTAL_OFFSET = 10
|
||||
const val PROGRESS_BAR_HEIGHT = 4
|
||||
val PROGRESS_BAR_HEIGHT = (2).toPixel().roundToInt()
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ object DataSaverMode {
|
||||
return when (pref) {
|
||||
"enabled" -> true
|
||||
"disabled" -> false
|
||||
"metered"-> NetworkHelper.isNetworkMobile(context)
|
||||
"metered" -> NetworkHelper.isNetworkMobile(context)
|
||||
else -> throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
|
@ -298,11 +298,11 @@
|
||||
<com.github.libretube.ui.views.MarkableTimeBar
|
||||
android:id="@id/exo_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dp"
|
||||
android:layout_height="16dp"
|
||||
app:bar_height="2dp"
|
||||
app:played_color="?attr/colorSecondary"
|
||||
app:scrubber_color="?attr/colorSecondary"
|
||||
app:scrubber_dragged_size="15dp"
|
||||
app:scrubber_dragged_size="16dp"
|
||||
app:scrubber_enabled_size="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user