diff options
author | Spike Sprague <spikuru@google.com> | 2014-01-13 18:10:54 -0800 |
---|---|---|
committer | Spike Sprague <spikuru@google.com> | 2014-01-13 20:53:56 -0800 |
commit | b92910e04c4da91fc4ea5a9484b83f9ecba1c896 (patch) | |
tree | 7d45248d2158c8162b906334267f35e98263a2a7 /src/com/android/camera/util/CameraUtil.java | |
parent | 39f8a7647aa4051a1c260b9496c2db82f93f8667 (diff) | |
download | android_packages_apps_Camera2-b92910e04c4da91fc4ea5a9484b83f9ecba1c896.tar.gz android_packages_apps_Camera2-b92910e04c4da91fc4ea5a9484b83f9ecba1c896.tar.bz2 android_packages_apps_Camera2-b92910e04c4da91fc4ea5a9484b83f9ecba1c896.zip |
capture button pressed colors
Change-Id: Ia568be11e6f9b6160f3f8332b504866cbe6ac94f
Diffstat (limited to 'src/com/android/camera/util/CameraUtil.java')
-rw-r--r-- | src/com/android/camera/util/CameraUtil.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index 7d54c0414..fb33ae536 100644 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -996,6 +996,26 @@ public class CameraUtil { } /** + * 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 |