Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSwitchPreference.java')
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSwitchPreference.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSwitchPreference.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSwitchPreference.java
index a0b2c222e..2eb82026c 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSwitchPreference.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSwitchPreference.java
@@ -16,8 +16,6 @@ import androidx.preference.SwitchPreference;
import it.niedermann.nextcloud.deck.Application;
import it.niedermann.nextcloud.deck.R;
-import static android.os.Build.VERSION.SDK_INT;
-import static android.os.Build.VERSION_CODES.JELLY_BEAN;
import static it.niedermann.nextcloud.deck.ui.branding.BrandedActivity.getSecondaryForegroundColorDependingOnTheme;
public class BrandedSwitchPreference extends SwitchPreference implements Branded {
@@ -25,9 +23,6 @@ public class BrandedSwitchPreference extends SwitchPreference implements Branded
@ColorInt
private Integer mainColor = null;
- @ColorInt
- private Integer textColor = null;
-
@Nullable
private Switch switchView;
@@ -53,16 +48,15 @@ public class BrandedSwitchPreference extends SwitchPreference implements Branded
if (Application.isBrandingEnabled(getContext()) && holder.itemView instanceof ViewGroup) {
switchView = findSwitchWidget(holder.itemView);
- if (mainColor != null && textColor != null) {
+ if (mainColor != null) {
applyBrand();
}
}
}
@Override
- public void applyBrand(@ColorInt int mainColor, @ColorInt int textColor) {
+ public void applyBrand(@ColorInt int mainColor) {
this.mainColor = mainColor;
- this.textColor = textColor;
// onBindViewHolder is called after applyBrand, therefore we have to store the given values and apply them later.
if (Application.isBrandingEnabled(getContext())) {
applyBrand();
@@ -70,7 +64,7 @@ public class BrandedSwitchPreference extends SwitchPreference implements Branded
}
private void applyBrand() {
- if (switchView != null && SDK_INT >= JELLY_BEAN) {
+ if (switchView != null) {
final int finalMainColor = getSecondaryForegroundColorDependingOnTheme(getContext(), mainColor);
// int trackColor = Color.argb(77, Color.red(finalMainColor), Color.green(finalMainColor), Color.blue(finalMainColor));
DrawableCompat.setTintList(switchView.getThumbDrawable(), new ColorStateList(