mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
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:
parent
8bb7fdc58f
commit
fe74b12da5
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user