summaryrefslogtreecommitdiffstats
path: root/gallerycommon
diff options
context:
space:
mode:
authorwqi <wqi@codeaurora.org>2016-05-12 16:44:09 +0800
committerLinux Build Service Account <lnxbuild@localhost>2016-07-06 22:42:12 -0600
commit1e6342d96838f4d922ac26a901f914a5807f494d (patch)
treec483389af012964dcdfb3905611ee8fd08c51869 /gallerycommon
parente94e766335f3689d2bbee84c7c003207149cbc8f (diff)
downloadandroid_packages_apps_Gallery2-1e6342d96838f4d922ac26a901f914a5807f494d.tar.gz
android_packages_apps_Gallery2-1e6342d96838f4d922ac26a901f914a5807f494d.tar.bz2
android_packages_apps_Gallery2-1e6342d96838f4d922ac26a901f914a5807f494d.zip
Gallery2: Fix the strings not translated in editor interface.
Some of strings not translated after user change language, because of the strings not update. Change-Id: I5e6fa05e38f4c45caf72173ce69864f238470ac1 CRs-Fixed: 1002787
Diffstat (limited to 'gallerycommon')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index 06bace867..da36f9d4e 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -207,6 +207,17 @@ public class ApiHelper {
}
}
+ public static boolean getBooleanFieldIfExists(Object obj, String fieldName,
+ boolean defaultVal) {
+ Class<?> klass = obj.getClass();
+ try {
+ Field f = klass.getDeclaredField(fieldName);
+ return f.getBoolean(obj);
+ } catch (Exception e) {
+ return defaultVal;
+ }
+ }
+
private static boolean hasField(Class<?> klass, String fieldName) {
try {
klass.getDeclaredField(fieldName);