summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-10-30 21:04:38 +0100
committerSelim Cinek <cinek@google.com>2014-10-31 16:11:40 +0100
commit1d59af45f699f11ee559c38698369fd6d159e87a (patch)
tree9365c68f4a5c4bfa1413565925f829129434ced1 /packages/SystemUI
parentab1dc954b2b97b59f868c96921f2daabc3336034 (diff)
downloadframeworks_base-1d59af45f699f11ee559c38698369fd6d159e87a.zip
frameworks_base-1d59af45f699f11ee559c38698369fd6d159e87a.tar.gz
frameworks_base-1d59af45f699f11ee559c38698369fd6d159e87a.tar.bz2
Mirrored clear all animation for RTL
Also automirrored the icon. Bug: 18173905 Change-Id: I510efaf18b89a676959d72ad1b9e9a8edd417e60
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/res/drawable/ic_dismiss_all.xml1
-rw-r--r--packages/SystemUI/src/com/android/systemui/SwipeHelper.java5
2 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/res/drawable/ic_dismiss_all.xml b/packages/SystemUI/res/drawable/ic_dismiss_all.xml
index 8e5e572..c32e5b11 100644
--- a/packages/SystemUI/res/drawable/ic_dismiss_all.xml
+++ b/packages/SystemUI/res/drawable/ic_dismiss_all.xml
@@ -16,6 +16,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
+ android:autoMirrored="true"
android:viewportWidth="48.0"
android:viewportHeight="48.0">
<path
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index 0d393bf..f206e56 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -311,11 +311,14 @@ public class SwipeHelper implements Gefingerpoken {
final View animView = mCallback.getChildContentView(view);
final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view);
float newPos;
+ boolean isLayoutRtl = view.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
if (velocity < 0
|| (velocity == 0 && getTranslation(animView) < 0)
// if we use the Menu to dismiss an item in landscape, animate up
- || (velocity == 0 && getTranslation(animView) == 0 && mSwipeDirection == Y)) {
+ || (velocity == 0 && getTranslation(animView) == 0 && mSwipeDirection == Y)
+ // if the language is rtl we prefer swiping to the left
+ || (velocity == 0 && getTranslation(animView) == 0 && isLayoutRtl)) {
newPos = -getSize(animView);
} else {
newPos = getSize(animView);