Skip to content

Commit 3eb3dd2

Browse files
committed
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.
1 parent 970fc63 commit 3eb3dd2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

app/src/main/java/com/github/libretube/ui/extensions/SetWatchProgressLength.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.github.libretube.ui.extensions
22

33
import android.graphics.Color
4+
import android.graphics.Outline
45
import android.view.View
6+
import android.view.ViewOutlineProvider
57
import androidx.constraintlayout.widget.ConstraintLayout
68
import androidx.core.graphics.ColorUtils
79
import androidx.core.view.isGone
@@ -36,5 +38,14 @@ fun View.setWatchProgressLength(videoId: String, duration: Long) {
3638
}
3739
setBackgroundColor(backgroundColor)
3840

41+
// set corner-radius
42+
clipToOutline = true
43+
outlineProvider = object : ViewOutlineProvider() {
44+
override fun getOutline(view: View, outline: Outline) {
45+
outline.setRoundRect(0, 0, view.width, view.height, 16f)
46+
}
47+
}
48+
49+
3950
isVisible = true
4051
}

0 commit comments

Comments
 (0)