OSDN Git Service

Load correct localized album names after language change
authorBobby Georgescu <georgescu@google.com>
Mon, 5 Nov 2012 21:31:42 +0000 (13:31 -0800)
committerBobby Georgescu <georgescu@google.com>
Mon, 5 Nov 2012 21:33:27 +0000 (13:33 -0800)
Bug: 7459805
Change-Id: I484ffea5b07488ffdda2e265c4efa32a3333ea03

src/com/android/gallery3d/data/LocalAlbum.java
src/com/android/gallery3d/data/LocalMergeAlbum.java

index e05aac0..6c5feb5 100644 (file)
@@ -61,7 +61,7 @@ public class LocalAlbum extends MediaSet {
         mApplication = application;
         mResolver = application.getContentResolver();
         mBucketId = bucketId;
-        mName = getLocalizedName(application.getResources(), bucketId, name);
+        mName = name;
         mIsImage = isImage;
 
         if (isImage) {
@@ -245,7 +245,7 @@ public class LocalAlbum extends MediaSet {
 
     @Override
     public String getName() {
-        return mName;
+        return getLocalizedName(mApplication.getResources(), mBucketId, mName);
     }
 
     @Override
index cbaf82f..f0b5e57 100644 (file)
@@ -41,7 +41,6 @@ public class LocalMergeAlbum extends MediaSet implements ContentListener {
     private final Comparator<MediaItem> mComparator;
     private final MediaSet[] mSources;
 
-    private String mName;
     private FetchCache[] mFetcher;
     private int mSupportedOperation;
     private int mBucketId;
@@ -54,7 +53,6 @@ public class LocalMergeAlbum extends MediaSet implements ContentListener {
         super(path, INVALID_DATA_VERSION);
         mComparator = comparator;
         mSources = sources;
-        mName = sources.length == 0 ? "" : sources[0].getName();
         mBucketId = bucketId;
         for (MediaSet set : mSources) {
             set.addContentListener(this);
@@ -82,7 +80,6 @@ public class LocalMergeAlbum extends MediaSet implements ContentListener {
         mSupportedOperation = supported;
         mIndex.clear();
         mIndex.put(0, new int[mSources.length]);
-        mName = mSources.length == 0 ? "" : mSources[0].getName();
     }
 
     private void invalidateCache() {
@@ -111,7 +108,7 @@ public class LocalMergeAlbum extends MediaSet implements ContentListener {
 
     @Override
     public String getName() {
-        return mName;
+        return mSources.length == 0 ? "" : mSources[0].getName();
     }
 
     @Override