feat: increase corner-radius of watch-progressbar

Adds a rounded corner to the watch-progressbar, making it more inline
with the general design of the app, as well as how other progressbars
are styled.
This commit is contained in:
FineFindus 2025-03-04 20:30:03 +01:00
parent 8bb7fdc58f
commit fe74b12da5
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B

View File

@ -1,7 +1,9 @@
package com.github.libretube.ui.extensions package com.github.libretube.ui.extensions
import android.graphics.Color import android.graphics.Color
import android.graphics.Outline
import android.view.View import android.view.View
import android.view.ViewOutlineProvider
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.graphics.ColorUtils import androidx.core.graphics.ColorUtils
import androidx.core.view.isGone import androidx.core.view.isGone
@ -36,5 +38,14 @@ fun View.setWatchProgressLength(videoId: String, duration: Long) {
} }
setBackgroundColor(backgroundColor) 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 isVisible = true
} }