summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-02-15 13:38:20 +0800
committerkaiyiz <kaiyiz@codeaurora.org>2015-02-15 13:38:20 +0800
commitb7231bd9b432a62bf8ccb63af7219869ab927c8c (patch)
tree5f2c8563ac0c5bb197038b7277cc9da08876e77d /src
parent12cf0d082018c504db4839b8b162e1d17960c3ff (diff)
downloadandroid_packages_apps_Gallery2-b7231bd9b432a62bf8ccb63af7219869ab927c8c.zip
android_packages_apps_Gallery2-b7231bd9b432a62bf8ccb63af7219869ab927c8c.tar.gz
android_packages_apps_Gallery2-b7231bd9b432a62bf8ccb63af7219869ab927c8c.tar.bz2
Gallery2: Translate image draw to Chinese
The name of FilterDrawRepresentation is set 'Draw' constant. Set name of FilterDrawRepresentation from imageDraw in filter_string. Change-Id: If4ee1c4e96e52cd267c90afde1081d5b68f4d206 CRs-Fixed: 794963
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/GalleryAppImpl.java6
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java3
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java8
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java7
4 files changed, 17 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/app/GalleryAppImpl.java b/src/com/android/gallery3d/app/GalleryAppImpl.java
index c6e7a0b..9c5f232 100644
--- a/src/com/android/gallery3d/app/GalleryAppImpl.java
+++ b/src/com/android/gallery3d/app/GalleryAppImpl.java
@@ -36,6 +36,7 @@ public class GalleryAppImpl extends Application implements GalleryApp {
private static final String DOWNLOAD_FOLDER = "download";
private static final long DOWNLOAD_CAPACITY = 64 * 1024 * 1024; // 64M
+ private static GalleryAppImpl sGalleryAppImpl;
private ImageCacheService mImageCacheService;
private Object mLock = new Object();
@@ -51,6 +52,7 @@ public class GalleryAppImpl extends Application implements GalleryApp {
WidgetUtils.initialize(this);
PicasaSource.initialize(this);
UsageStatistics.initialize(this);
+ sGalleryAppImpl = this;
}
@Override
@@ -58,6 +60,10 @@ public class GalleryAppImpl extends Application implements GalleryApp {
return this;
}
+ public static Context getContext() {
+ return sGalleryAppImpl;
+ }
+
@Override
public synchronized DataManager getDataManager() {
if (mDataManager == null) {
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 6e79012..f001177 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -483,7 +483,8 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
}
}
if (!found) {
- FilterRepresentation representation = new FilterDrawRepresentation();
+ FilterRepresentation representation =
+ new FilterDrawRepresentation(getString(R.string.imageDraw));
Action action = new Action(this, representation);
action.setIsDoubleAction(true);
mCategoryGeometryAdapter.add(action);
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
index 275a404..5c5e561 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java
@@ -157,10 +157,10 @@ public class FilterDrawRepresentation extends FilterRepresentation {
private Vector<StrokeData> mDrawing = new Vector<StrokeData>();
private StrokeData mCurrent; // used in the currently drawing style
- public FilterDrawRepresentation() {
- super("Draw");
+ public FilterDrawRepresentation(String name) {
+ super(name);
setFilterClass(ImageFilterDraw.class);
- setSerializationName("DRAW");
+ setSerializationName(name);
setFilterType(FilterRepresentation.TYPE_VIGNETTE);
setTextId(R.string.imageDraw);
setEditorId(EditorDraw.ID);
@@ -190,7 +190,7 @@ public class FilterDrawRepresentation extends FilterRepresentation {
@Override
public FilterRepresentation copy() {
- FilterDrawRepresentation representation = new FilterDrawRepresentation();
+ FilterDrawRepresentation representation = new FilterDrawRepresentation(getName());
copyAllParameters(representation);
return representation;
}
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
index 8fd5b02..da7de93 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java
@@ -29,6 +29,7 @@ import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import com.android.gallery3d.R;
+import com.android.gallery3d.app.GalleryAppImpl;
import com.android.gallery3d.app.Log;
import com.android.gallery3d.filtershow.cache.ImageLoader;
import com.android.gallery3d.filtershow.filters.FilterDrawRepresentation.StrokeData;
@@ -47,7 +48,8 @@ public class ImageFilterDraw extends ImageFilter {
int mCachedStrokes = -1;
int mCurrentStyle = 0;
- FilterDrawRepresentation mParameters = new FilterDrawRepresentation();
+ FilterDrawRepresentation mParameters = new FilterDrawRepresentation(
+ GalleryAppImpl.getContext().getString(R.string.imageDraw));
public ImageFilterDraw() {
mName = "Image Draw";
@@ -69,7 +71,8 @@ public class ImageFilterDraw extends ImageFilter {
@Override
public FilterRepresentation getDefaultRepresentation() {
- return new FilterDrawRepresentation();
+ return new FilterDrawRepresentation(
+ GalleryAppImpl.getContext().getString(R.string.imageDraw));
}
@Override