Merge pull request #7165 from FineFindus/feat/rounded-progress

feat: increase corner-radius of watch-progressbar
This commit is contained in:
Bnyro 2025-03-05 11:57:06 +01:00 committed by GitHub
commit 71f0d48e24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,9 @@
package com.github.libretube.ui.extensions
import android.graphics.Color
import android.graphics.Outline
import android.view.View
import android.view.ViewOutlineProvider
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.graphics.ColorUtils
import androidx.core.view.isGone
@ -36,5 +38,14 @@ fun View.setWatchProgressLength(videoId: String, duration: Long) {
}
setBackgroundColor(backgroundColor)
// set corner-radius
clipToOutline = true
outlineProvider = object : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setRoundRect(0, 0, view.width, view.height, 16f)
}
}
isVisible = true
}