Fix crashing on Kitkat

This commit is contained in:
Moez Bhatti
2015-12-06 22:51:45 -05:00
parent 20dadedd83
commit b09abb3fd0
2 changed files with 7 additions and 8 deletions
@@ -30,7 +30,6 @@ import com.moez.QKSMS.ui.dialog.QKDialog;
import com.moez.QKSMS.ui.settings.SettingsFragment; import com.moez.QKSMS.ui.settings.SettingsFragment;
import com.moez.QKSMS.ui.view.QKTextView; import com.moez.QKSMS.ui.view.QKTextView;
import com.moez.QKSMS.ui.view.colorpicker.ColorPickerPalette; import com.moez.QKSMS.ui.view.colorpicker.ColorPickerPalette;
import com.moez.QKSMS.ui.view.colorpicker.ColorPickerSwatch;
import com.moez.QKSMS.ui.widget.WidgetProvider; import com.moez.QKSMS.ui.widget.WidgetProvider;
import java.util.Set; 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); 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)); 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); ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo);
colorAnimation.setDuration(TRANSITION_LENGTH); 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(); 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); mWindow.setStatusBarColor(color1);
} }
}); });
-4
View File
@@ -2,14 +2,10 @@
<resources> <resources>
<style name="AppThemeLight" parent="AppBaseThemeLight"> <style name="AppThemeLight" parent="AppBaseThemeLight">
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowContentOverlay">@null</item> <item name="android:windowContentOverlay">@null</item>
</style> </style>
<style name="AppThemeDark" parent="AppBaseThemeDark"> <style name="AppThemeDark" parent="AppBaseThemeDark">
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowContentOverlay">@null</item> <item name="android:windowContentOverlay">@null</item>
</style> </style>