summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util/CameraUtil.java
diff options
context:
space:
mode:
authorSpike Sprague <spikuru@google.com>2014-01-28 18:48:22 -0800
committerSpike Sprague <spikuru@google.com>2014-01-29 14:39:22 -0800
commit79718f6c6fb60aedd09edeedb2c16d1e2f9fe02d (patch)
tree951967e4444f83d6c0f9049b1cab4405460c9c2b /src/com/android/camera/util/CameraUtil.java
parent7f749f2c7a4061bd4426561b2b4dcbd3b9246640 (diff)
downloadandroid_packages_apps_Camera2-79718f6c6fb60aedd09edeedb2c16d1e2f9fe02d.tar.gz
android_packages_apps_Camera2-79718f6c6fb60aedd09edeedb2c16d1e2f9fe02d.tar.bz2
android_packages_apps_Camera2-79718f6c6fb60aedd09edeedb2c16d1e2f9fe02d.zip
adding accessibilty strings to ui items
Change-Id: I3f2356c765bd2799dfa1009ff6707fc3af87383e
Diffstat (limited to 'src/com/android/camera/util/CameraUtil.java')
-rw-r--r--src/com/android/camera/util/CameraUtil.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 7af8670f6..fbce28e1b 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -1053,6 +1053,23 @@ public class CameraUtil {
}
/**
+ * Gets the mode content description of a specific mode.
+ *
+ * @param modeIndex index of the mode
+ * @param context current context
+ * @return mode content description if the index is valid, otherwise a new empty string
+ */
+ public static String getCameraModeContentDescription(int modeIndex, Context context) {
+ String[] cameraModesDesc = context.getResources()
+ .getStringArray(R.array.camera_mode_content_description);
+ if (modeIndex < 0 || modeIndex >= cameraModesDesc.length) {
+ Log.e(TAG, "Invalid mode index: " + modeIndex);
+ return new String();
+ }
+ return cameraModesDesc[modeIndex];
+ }
+
+ /**
* Gets the shutter icon res id for a specific mode.
*
* @param modeIndex index of the mode