OSDN Git Service

remove stray bool resource for determining if OS is L or not,
authorSpike Sprague <spikuru@google.com>
Thu, 4 Sep 2014 18:54:26 +0000 (11:54 -0700)
committerSpike Sprague <spikuru@google.com>
Thu, 4 Sep 2014 21:54:41 +0000 (21:54 +0000)
moved to more universal ApiHelper for that.

this brings back the fade-in on shutter button touchDown.

bug: 17389859

Change-Id: I7c7d24db30bfbb149f84e6f5acf3e211c282c1ec

res/values/bool.xml
src/com/android/camera/ui/BottomBar.java

index bcb30de..464842a 100644 (file)
@@ -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
index cfc6a14..551cc09 100644 (file)
@@ -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;