Set bottom bar to a consistent color across app.
Change-Id: Ieda492a9dbc122a828d8b5d8df831fbe99e6295f
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 384b621..e191859 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -617,18 +617,6 @@
<item>@color/craft_mode_color</item>
</array>
- <array name="camera_mode_theme_pressed_color">
- <item>@color/camera_mode_pressed_color</item>
- <item>@color/video_mode_pressed_color</item>
- <item>@color/craft_mode_pressed_color</item>
- <item>@color/photosphere_mode_pressed_color</item>
- <item>@color/panorama_mode_pressed_color</item>
- <item>@color/timelapse_mode_pressed_color</item>
- <item>@color/settings_mode_pressed_color</item>
- <item>@color/craft_mode_pressed_color</item>
- <item>@color/craft_mode_pressed_color</item>
- </array>
-
<string-array name="camera_mode_text">
<item>@string/mode_camera</item>
<item>@string/mode_video</item>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 79c37ab..e9dcf50 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -85,13 +85,8 @@
<color name="panorama_mode_color">#f1c938</color>
<color name="settings_mode_color">#58595b</color>
- <color name="camera_mode_pressed_color">#9ec0fa</color>
- <color name="video_mode_pressed_color">#e5948c</color>
- <color name="craft_mode_pressed_color">#a1c493</color>
- <color name="photosphere_mode_pressed_color">#9b7baa</color>
- <color name="timelapse_mode_pressed_color">#88695e</color>
- <color name="panorama_mode_pressed_color">#fbd569</color>
- <color name="settings_mode_pressed_color">#58595b</color>
+ <color name="bottombar_unpressed">#191919</color>
+ <color name="bottombar_pressed">#262626</color>
<color name="filmstrip_background">#000000</color>
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index ae9ab75..3d2d0c5 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1083,8 +1083,8 @@
mCameraAppUI.prepareModuleUI();
}
- syncBottomBarColor();
- syncBottomBarShutterIcon();
+ setBottomBarColor();
+ setBottomBarShutterIcon();
mCurrentModule.init(this, isSecureCamera(), isCaptureIntent());
if (!mSecureCamera) {
@@ -1639,22 +1639,20 @@
fragment.show(getFragmentManager(), "tiny_planet");
}
- private void syncBottomBarColor() {
+ private void setBottomBarColor() {
// Currently not all modules use the generic_module UI.
// TODO: once all modules have a bottom bar, remove
// isUsingBottomBar check.
if (mCurrentModule.isUsingBottomBar()) {
- int color = getResources().getColor(
- CameraUtil.getCameraThemeColorId(mCurrentModeIndex, this));
+ int color = getResources().getColor(R.color.bottombar_unpressed);
mCameraAppUI.setBottomBarColor(color);
- int pressedColor = getResources().getColor(
- CameraUtil.getCameraThemePressedColorId(mCurrentModeIndex, this));
+ int pressedColor = getResources().getColor(R.color.bottombar_pressed);
mCameraAppUI.setBottomBarPressedColor(pressedColor);
}
}
- private void syncBottomBarShutterIcon() {
+ private void setBottomBarShutterIcon() {
// Currently not all modules use the generic_module UI.
// TODO: once all modules have a bottom bar, remove
// isUsingBottomBar check.
@@ -1665,8 +1663,9 @@
}
private void openModule(CameraModule module) {
- syncBottomBarColor();
- syncBottomBarShutterIcon();
+ // TODO: Remove setting color here when all modules use CameraAppUI.
+ setBottomBarColor();
+ setBottomBarShutterIcon();
module.init(this, isSecureCamera(), isCaptureIntent());
module.resume();
module.onPreviewVisibilityChanged(!mFilmstripVisible);
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index f110317..0e1cd96 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -994,26 +994,6 @@
}
/**
- * Gets the theme pressed color of a specific mode.
- *
- * @param modeIndex index of the mode
- * @param context current context
- * @return theme pressed color of the mode if input index is valid, otherwise 0
- */
- public static int getCameraThemePressedColorId(int modeIndex, Context context) {
-
- // Find the theme color using id from the color array
- TypedArray colorRes = context.getResources()
- .obtainTypedArray(R.array.camera_mode_theme_pressed_color);
- if (modeIndex >= colorRes.length() || modeIndex < 0) {
- // Mode index not found
- Log.e(TAG, "Invalid mode index: " + modeIndex);
- return 0;
- }
- return colorRes.getResourceId(modeIndex, 0);
- }
-
- /**
* Gets the mode icon resource id of a specific mode.
*
* @param modeIndex index of the mode