summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwangjing <wangjing@codeaurora.org>2015-04-03 14:42:17 +0800
committerwangjing <wangjing@codeaurora.org>2015-04-03 14:53:20 +0800
commit03d43a0b10b14882936e4083dab53516e69aaaae (patch)
treebf5a9e7e93165d92f36f8a40102b832b45416f23
parente397d60bd093f7e91f1c6cf82b0d3ecdd800659c (diff)
downloadandroid_packages_apps_Gallery2-03d43a0b10b14882936e4083dab53516e69aaaae.tar.gz
android_packages_apps_Gallery2-03d43a0b10b14882936e4083dab53516e69aaaae.tar.bz2
android_packages_apps_Gallery2-03d43a0b10b14882936e4083dab53516e69aaaae.zip
Gallery2: Gallery2 can't show the newest picture
Camera give Gallery2 the newest picture's index is wrong in RTL mode. Give the newest picture's index in RTL mode. Change-Id: I6c23da7699f177b901b15abe859ce07ebb409c16 CRs-Fixed: 816284
-rw-r--r--src/com/android/gallery3d/app/GalleryActivity.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/GalleryActivity.java b/src/com/android/gallery3d/app/GalleryActivity.java
index d918e1457..4ce0d8405 100644
--- a/src/com/android/gallery3d/app/GalleryActivity.java
+++ b/src/com/android/gallery3d/app/GalleryActivity.java
@@ -37,6 +37,8 @@ import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
+import android.text.TextUtils;
+import java.util.Locale;
import com.android.gallery3d.R;
import com.android.gallery3d.common.Utils;
@@ -61,6 +63,7 @@ public final class GalleryActivity extends AbstractGalleryActivity implements On
public static final String KEY_MEDIA_TYPES = "mediaTypes";
public static final String KEY_DISMISS_KEYGUARD = "dismiss-keyguard";
public static final String KEY_FROM_SNAPCAM = "from-snapcam";
+ public static final String KEY_TOTAL_NUMBER = "total-number";
private static final String TAG = "GalleryActivity";
private Dialog mVersionCheckDialog;
@@ -289,6 +292,13 @@ public final class GalleryActivity extends AbstractGalleryActivity implements On
data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, itemPath.toString());
if (!intent.getBooleanExtra(KEY_FROM_SNAPCAM, false)) {
data.putBoolean(PhotoPage.KEY_READONLY, true);
+ } else {
+ int hintIndex = 0;
+ if (View.LAYOUT_DIRECTION_RTL == TextUtils
+ .getLayoutDirectionFromLocale(Locale.getDefault())) {
+ hintIndex = intent.getIntExtra(KEY_TOTAL_NUMBER, 1) - 1;
+ }
+ data.putInt(PhotoPage.KEY_INDEX_HINT, hintIndex);
}
// TODO: Make the parameter "SingleItemOnly" public so other