mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-20 00:55:20 +01:00
Added ability to set Playback speed and pitch
This commit is contained in:
parent
3a6645ab35
commit
943de60f23
12 changed files with 229 additions and 18 deletions
|
@ -43,6 +43,7 @@ import com.google.android.material.button.MaterialButton
|
|||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
import com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
import com.google.android.material.slider.Slider
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
fun Int.ripAlpha(): Int {
|
||||
|
@ -112,6 +113,12 @@ fun SeekBar.addAccentColor() {
|
|||
thumbTintList = colorState
|
||||
}
|
||||
|
||||
fun Slider.accent() {
|
||||
if (materialYou) return
|
||||
trackActiveTintList = context.accentColor().colorStateList
|
||||
trackInactiveTintList = context.accentColorVariant().colorStateList
|
||||
}
|
||||
|
||||
fun Button.accentTextColor() {
|
||||
if (materialYou) return
|
||||
setTextColor(ThemeStore.accentColor(App.getContext()))
|
||||
|
@ -269,6 +276,15 @@ fun Context.darkAccentColorVariant(): Int {
|
|||
)
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
fun Context.accentColorVariant(): Int {
|
||||
return if (surfaceColor().isColorLight) {
|
||||
accentColor().darkerColor
|
||||
} else {
|
||||
accentColor().lighterColor
|
||||
}
|
||||
}
|
||||
|
||||
inline val @receiver:ColorInt Int.isColorLight
|
||||
get() = ColorUtil.isColorLight(this)
|
||||
|
||||
|
@ -276,4 +292,7 @@ inline val @receiver:ColorInt Int.lighterColor
|
|||
get() = ColorUtil.lightenColor(this)
|
||||
|
||||
inline val @receiver:ColorInt Int.darkerColor
|
||||
get() = ColorUtil.darkenColor(this)
|
||||
get() = ColorUtil.darkenColor(this)
|
||||
|
||||
inline val Int.colorStateList : ColorStateList
|
||||
get() = ColorStateList.valueOf(this)
|
Loading…
Add table
Add a link
Reference in a new issue