diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-10-28 17:33:18 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-10-28 17:33:18 +0300 |
commit | 14cc414704fba83c9570d448b8d0f38c184a17ad (patch) | |
tree | 6f1b3f6ca2fbf133dd83aa6c7bb60e6e7df561c9 /app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java | |
parent | 9343be904e3daa3ead65bb79f0447bb017e884f5 (diff) |
Use ColorUtil from android-commons where possible
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java index 047b6c270..6aa03b811 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java @@ -20,6 +20,7 @@ import androidx.viewpager2.widget.ViewPager2; import com.google.android.material.tabs.TabLayoutMediator; +import it.niedermann.android.util.ColorUtil; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.databinding.DialogFilterBinding; import it.niedermann.nextcloud.deck.model.enums.EDueType; @@ -28,7 +29,6 @@ import it.niedermann.nextcloud.deck.ui.branding.BrandedAlertDialogBuilder; import it.niedermann.nextcloud.deck.ui.branding.BrandedDialogFragment; import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.getSecondaryForegroundColorDependingOnTheme; -import static it.niedermann.nextcloud.deck.util.ColorUtil.getContrastRatio; public class FilterDialogFragment extends BrandedDialogFragment { @@ -107,7 +107,7 @@ public class FilterDialogFragment extends BrandedDialogFragment { @Override public void applyBrand(int mainColor) { @ColorInt final int finalMainColor = getSecondaryForegroundColorDependingOnTheme(binding.tabLayout.getContext(), mainColor); - final boolean contrastRatioIsSufficient = getContrastRatio(mainColor, ContextCompat.getColor(binding.tabLayout.getContext(), R.color.primary)) > 1.7d; + final boolean contrastRatioIsSufficient = ColorUtil.INSTANCE.getContrastRatio(mainColor, ContextCompat.getColor(binding.tabLayout.getContext(), R.color.primary)) > 1.7d; binding.tabLayout.setSelectedTabIndicatorColor(contrastRatioIsSufficient ? mainColor : finalMainColor); indicator.setColorFilter(contrastRatioIsSufficient ? mainColor : finalMainColor, PorterDuff.Mode.SRC_ATOP); } |