diff options
-rw-r--r-- | res/values/bool.xml | 1 | ||||
-rw-r--r-- | src/com/android/camera/ui/BottomBar.java | 14 |
2 files changed, 4 insertions, 11 deletions
diff --git a/res/values/bool.xml b/res/values/bool.xml index bcb30dedf..464842ab4 100644 --- a/res/values/bool.xml +++ b/res/values/bool.xml @@ -15,5 +15,4 @@ --> <resources> <bool name="show_action_bar_title">false</bool> - <bool name="is_os_version_l">false</bool> </resources>
\ No newline at end of file diff --git a/src/com/android/camera/ui/BottomBar.java b/src/com/android/camera/ui/BottomBar.java index cfc6a1448..551cc094f 100644 --- a/src/com/android/camera/ui/BottomBar.java +++ b/src/com/android/camera/ui/BottomBar.java @@ -32,6 +32,7 @@ import android.widget.ImageButton; import com.android.camera.CaptureLayoutHelper; import com.android.camera.ShutterButton; import com.android.camera.debug.Log; +import com.android.camera.util.ApiHelper; import com.android.camera.util.CameraUtil; import com.android.camera2.R; @@ -74,7 +75,6 @@ public class BottomBar extends FrameLayout { private final float mCircleRadius; private CaptureLayoutHelper mCaptureLayoutHelper = null; - private final boolean mIsOsVersionL; // for Android L, these backgrounds are RippleDrawables (ISA LayerDrawable) // pre-L, they're plain old LayerDrawables private final LayerDrawable[] mShutterButtonBackgrounds; @@ -96,8 +96,6 @@ public class BottomBar extends FrameLayout { mBackgroundAlphaDefault = getResources() .getInteger(R.integer.bottom_bar_background_alpha); - mIsOsVersionL = context.getResources().getBoolean(R.bool.is_os_version_l); - // preload all the drawable BGs TypedArray ar = context.getResources() .obtainTypedArray(R.array.shutter_button_backgrounds); @@ -129,13 +127,9 @@ public class BottomBar extends FrameLayout { if (mAnimatedCircleDrawable != null) { mAnimatedCircleDrawable.setColor(color); mAnimatedCircleDrawable.setAlpha(alpha); - invalidateDrawable(mAnimatedCircleDrawable); - invalidate(); } else if (mColorDrawable != null) { mColorDrawable.setColor(color); mColorDrawable.setAlpha(alpha); - invalidateDrawable(mColorDrawable); - invalidate(); } if (mIntentReviewLayout != null) { @@ -153,7 +147,7 @@ public class BottomBar extends FrameLayout { private void setCancelBackgroundColor(int alpha, int color) { LayerDrawable layerDrawable = (LayerDrawable) mCancelButton.getBackground(); ColorDrawable colorDrawable = (ColorDrawable) layerDrawable.getDrawable(0); - if (!mIsOsVersionL) { + if (!ApiHelper.isLOrHigher()) { colorDrawable.setColor(color); } colorDrawable.setAlpha(alpha); @@ -164,7 +158,7 @@ public class BottomBar extends FrameLayout { } private void setCaptureButtonDown() { - if (!mIsOsVersionL) { + if (!ApiHelper.isLOrHigher()) { setPaintColor(mBackgroundAlpha, mBackgroundPressedColor); } } @@ -346,7 +340,7 @@ public class BottomBar extends FrameLayout { } private void setBackgroundPressedColor(int color) { - if (mIsOsVersionL) { + if (ApiHelper.isLOrHigher()) { // not supported (setting a color on a RippleDrawable is hard =[ ) } else { mBackgroundPressedColor = color; |