Merge "capture button disabled states support" into gb-ub-photos-denali
diff --git a/res/drawable/ic_camera.xml b/res/drawable/ic_camera.xml
new file mode 100644
index 0000000..3990132
--- /dev/null
+++ b/res/drawable/ic_camera.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          android:constantSize="true">
+    <item android:state_enabled="false">
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_capture_camera_disabled" />
+    </item>
+    <item>
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_camera_normal" />
+    </item>
+</selector>
diff --git a/res/drawable/ic_panorama.xml b/res/drawable/ic_panorama.xml
new file mode 100644
index 0000000..dc9f1d7
--- /dev/null
+++ b/res/drawable/ic_panorama.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          android:constantSize="true">
+    <item android:state_enabled="false">
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_panorama_disabled" />
+    </item>
+    <item>
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_panorama_normal" />
+    </item>
+</selector>
diff --git a/res/drawable/ic_refocus.xml b/res/drawable/ic_refocus.xml
new file mode 100644
index 0000000..432b0d5
--- /dev/null
+++ b/res/drawable/ic_refocus.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          android:constantSize="true">
+    <item android:state_enabled="false">
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_capture_refocus_disabled" />
+    </item>
+    <item>
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_refocus_normal" />
+    </item>
+</selector>
diff --git a/res/drawable/ic_video.xml b/res/drawable/ic_video.xml
new file mode 100644
index 0000000..b9a2bf4
--- /dev/null
+++ b/res/drawable/ic_video.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          android:constantSize="true">
+    <item android:state_enabled="false">
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_video_disabled" />
+    </item>
+    <item>
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/ic_video_normal" />
+    </item>
+</selector>
diff --git a/res/layout/bottom_bar_contents.xml b/res/layout/bottom_bar_contents.xml
index a4c8d78..1d84b2a 100644
--- a/res/layout/bottom_bar_contents.xml
+++ b/res/layout/bottom_bar_contents.xml
@@ -31,7 +31,7 @@
         android:clickable="true"
         android:contentDescription="@string/accessibility_shutter_button"
         android:focusable="true"
-        android:src="@drawable/ic_camera_normal" />
+        android:src="@drawable/ic_camera" />
   </FrameLayout>
 
   <com.android.camera.ui.TopRightWeightedLayout
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 3d058f7..bb7b0d2 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -631,13 +631,13 @@
     </array>
 
     <array name="camera_mode_shutter_icon">
-        <item>@drawable/ic_camera_normal</item>
-        <item>@drawable/ic_video_normal</item>
-        <item>@drawable/ic_refocus_normal</item>
+        <item>@drawable/ic_camera</item>
+        <item>@drawable/ic_video</item>
+        <item>@drawable/ic_refocus</item>
         <item>@null</item>
-        <item>@drawable/ic_panorama_normal</item>
+        <item>@drawable/ic_panorama</item>
         <item>@null</item>
-        <item>@drawable/ic_camera_normal</item>
+        <item>@drawable/ic_camera</item>
     </array>
 
 </resources>
diff --git a/src/com/android/camera/app/CameraAppUI.java b/src/com/android/camera/app/CameraAppUI.java
index 72215b8..951d79a 100644
--- a/src/com/android/camera/app/CameraAppUI.java
+++ b/src/com/android/camera/app/CameraAppUI.java
@@ -1429,6 +1429,10 @@
         mBottomBar.animateToFullSize(shutterIconId);
     }
 
+    public void setCaptureButtonEnabled(boolean enabled) {
+        mBottomBar.setCaptureButtonEnabled(enabled);
+    }
+
     /**
      * Set the visibility of the bottom bar.
      */
diff --git a/src/com/android/camera/ui/BottomBar.java b/src/com/android/camera/ui/BottomBar.java
index a42a870..6e3cb7f 100644
--- a/src/com/android/camera/ui/BottomBar.java
+++ b/src/com/android/camera/ui/BottomBar.java
@@ -400,6 +400,10 @@
         setPaintColor(mBackgroundAlpha, mBackgroundColor);
     }
 
+    public void setCaptureButtonEnabled(boolean enabled) {
+        mShutterButton.setEnabled(enabled);
+    }
+
     private double diagonalLength(double w, double h) {
         return Math.sqrt((w*w) + (h*h));
     }