forked from nextcloud/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
985d4c2
commit 5926e64
Showing
6 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/nmc/android/ui/utils/ProgressBarThemeUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.nmc.android.ui.utils | ||
|
||
import android.widget.ProgressBar | ||
import android.widget.SeekBar | ||
import androidx.annotation.ColorInt | ||
import androidx.core.graphics.BlendModeColorFilterCompat | ||
import androidx.core.graphics.BlendModeCompat | ||
|
||
/** | ||
* theming progress and seek bar for NMC | ||
*/ | ||
object ProgressBarThemeUtils { | ||
|
||
@JvmStatic | ||
fun themeHorizontalSeekBar(seekBar: SeekBar, @ColorInt color: Int) { | ||
themeHorizontalProgressBar(seekBar, color) | ||
seekBar.thumb.colorFilter = | ||
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_IN) | ||
} | ||
|
||
@JvmStatic | ||
fun themeHorizontalProgressBar(progressBar: ProgressBar?, @ColorInt color: Int) { | ||
progressBar?.indeterminateDrawable?.colorFilter = | ||
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_IN) | ||
progressBar?.progressDrawable?.colorFilter = | ||
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_IN) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters