From fe74b12da5c7f40bfbbce1a8789694f931eb2b82 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Tue, 4 Mar 2025 20:30:03 +0100 Subject: [PATCH] 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. --- .../libretube/ui/extensions/SetWatchProgressLength.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/com/github/libretube/ui/extensions/SetWatchProgressLength.kt b/app/src/main/java/com/github/libretube/ui/extensions/SetWatchProgressLength.kt index eb723e9d0..111231f4e 100644 --- a/app/src/main/java/com/github/libretube/ui/extensions/SetWatchProgressLength.kt +++ b/app/src/main/java/com/github/libretube/ui/extensions/SetWatchProgressLength.kt @@ -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 }