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.
NMC-2256: Progress and seek bar customized.
NMC-2041: SwipeRefreshLayout Customized.
- Loading branch information
1 parent
4ecdf79
commit 100be32
Showing
15 changed files
with
235 additions
and
14 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
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/nmc/android/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,35 @@ | ||
/* | ||
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
package com.nmc.android.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) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/nmc/android/utils/SwipeRefreshThemeUtils.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,13 @@ | ||
package com.nmc.android.utils | ||
|
||
import android.content.Context | ||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout | ||
import com.owncloud.android.R | ||
|
||
object SwipeRefreshThemeUtils { | ||
@JvmStatic | ||
fun themeSwipeRefreshLayout(context: Context, swipeRefreshLayout: SwipeRefreshLayout) { | ||
swipeRefreshLayout.setColorSchemeColors(context.resources.getColor(R.color.primary, null)) | ||
swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.refresh_layout_bg_color) | ||
} | ||
} |
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
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
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
Oops, something went wrong.