summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-03-02 15:54:50 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-03-23 19:13:27 -0700
commit6793597161676e452c2a09dc59a5aae816cddfde (patch)
treef940987976698835e9124717668527dd06f03495 /src
parent65aa4964bd869d0aeb63f82e87ff2dab11755725 (diff)
downloadandroid_packages_apps_Gallery2-6793597161676e452c2a09dc59a5aae816cddfde.tar.gz
android_packages_apps_Gallery2-6793597161676e452c2a09dc59a5aae816cddfde.tar.bz2
android_packages_apps_Gallery2-6793597161676e452c2a09dc59a5aae816cddfde.zip
Gallery2: Modify the action of rewind and forward button
When change to arabic language, the rewind and forward button should exchange their behavior due to the direction of progress bar is changed. Change default behavior of the media button for RTL. Change-Id: I5254fbf8329d74344e7c2f159c55473169c5c2ae
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/MovieControllerOverlay.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java
index bb25882c8..168cbe102 100644
--- a/src/com/android/gallery3d/app/MovieControllerOverlay.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java
@@ -22,6 +22,7 @@ import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Handler;
+import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.KeyEvent;
@@ -50,6 +51,7 @@ import org.codeaurora.gallery3d.video.ExtensionHelper;
import org.codeaurora.gallery3d.video.ScreenModeManager;
import org.codeaurora.gallery3d.video.ScreenModeManager.ScreenModeListener;
+import java.util.Locale;
/**
* The playback controller for the Movie Player.
@@ -840,10 +842,20 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
mListenerForRewind.onStopVideo();
} else if (v == mRewind) {
Log.v(TAG, "ControllerRewindAndForwardExt onClick mRewind");
- mListenerForRewind.onRewind();
+ if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault())
+ == View.LAYOUT_DIRECTION_RTL) {
+ mListenerForRewind.onForward();
+ } else {
+ mListenerForRewind.onRewind();
+ }
} else if (v == mForward) {
Log.v(TAG, "ControllerRewindAndForwardExt onClick mForward");
- mListenerForRewind.onForward();
+ if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault())
+ == View.LAYOUT_DIRECTION_RTL) {
+ mListenerForRewind.onRewind();
+ } else {
+ mListenerForRewind.onForward();
+ }
}
}