From b09abb3fd06cefa281c4758d25245808eeea560c Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Sun, 6 Dec 2015 22:51:45 -0500 Subject: [PATCH] Fix crashing on Kitkat --- .../src/main/java/com/moez/QKSMS/ui/ThemeManager.java | 11 +++++++---- QKSMS/src/main/res/values-v19/styles.xml | 4 ---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/QKSMS/src/main/java/com/moez/QKSMS/ui/ThemeManager.java b/QKSMS/src/main/java/com/moez/QKSMS/ui/ThemeManager.java index dffff779..fbba329a 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/ui/ThemeManager.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/ui/ThemeManager.java @@ -30,7 +30,6 @@ import com.moez.QKSMS.ui.dialog.QKDialog; import com.moez.QKSMS.ui.settings.SettingsFragment; import com.moez.QKSMS.ui.view.QKTextView; import com.moez.QKSMS.ui.view.colorpicker.ColorPickerPalette; -import com.moez.QKSMS.ui.view.colorpicker.ColorPickerSwatch; import com.moez.QKSMS.ui.widget.WidgetProvider; import java.util.Set; @@ -265,7 +264,7 @@ public class ThemeManager { status_tint = sPrefs.getBoolean(SettingsFragment.STATUS_TINT, Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP); - if (mActivity != null) { + if (mActivity != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mWindow.setStatusBarColor(status_tint ? sColor : sResources.getColor(R.color.black)); } @@ -566,7 +565,11 @@ public class ThemeManager { ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo); colorAnimation.setDuration(TRANSITION_LENGTH); - colorAnimation.addUpdateListener(animation -> mWindow.setStatusBarColor((Integer) animation.getAnimatedValue())); + colorAnimation.addUpdateListener(animation -> { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + mWindow.setStatusBarColor((Integer) animation.getAnimatedValue()); + } + }); colorAnimation.start(); } } @@ -616,7 +619,7 @@ public class ThemeManager { } } - if (status_tint) { + if (status_tint && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mWindow.setStatusBarColor(color1); } }); diff --git a/QKSMS/src/main/res/values-v19/styles.xml b/QKSMS/src/main/res/values-v19/styles.xml index 5f0b4a91..1ea0d3a6 100644 --- a/QKSMS/src/main/res/values-v19/styles.xml +++ b/QKSMS/src/main/res/values-v19/styles.xml @@ -2,14 +2,10 @@