diff options
author | nicolasroard <nicolasroard@google.com> | 2013-09-23 16:12:10 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-09-23 16:14:10 -0700 |
commit | 105fbcf3289491aa4f590057e304fee33f1c88ca (patch) | |
tree | e0455aeb56c3ae7426def01c893384e29421f5e0 | |
parent | eccdc4285476c98bff3dc5bde113b7f855b18346 (diff) | |
download | android_packages_apps_Gallery2-105fbcf3289491aa4f590057e304fee33f1c88ca.tar.gz android_packages_apps_Gallery2-105fbcf3289491aa4f590057e304fee33f1c88ca.tar.bz2 android_packages_apps_Gallery2-105fbcf3289491aa4f590057e304fee33f1c88ca.zip |
Fix issues with RTL support
bug:8148068
Change-Id: I869e1a90686c46f8076a66f94040ad03c7c6ca10
-rw-r--r-- | AndroidManifest.xml | 3 | ||||
-rw-r--r-- | res/layout-land/filtershow_grad_ui.xml | 31 | ||||
-rw-r--r-- | res/layout/filtershow_control_action_slider.xml | 4 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/state/StateView.java | 48 |
4 files changed, 58 insertions, 28 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e7da0be88..2c280106f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -42,7 +42,8 @@ android:logo="@mipmap/ic_launcher_gallery" android:hardwareAccelerated="true" android:largeHeap="true" - android:restoreAnyVersion="true"> + android:restoreAnyVersion="true" + android:supportsRtl="true"> <uses-library android:name="com.google.android.media.effects" android:required="false" /> <activity android:name="com.android.gallery3d.app.MovieActivity" android:label="@string/movie_view_label" diff --git a/res/layout-land/filtershow_grad_ui.xml b/res/layout-land/filtershow_grad_ui.xml index 63f941801..fd09beebb 100644 --- a/res/layout-land/filtershow_grad_ui.xml +++ b/res/layout-land/filtershow_grad_ui.xml @@ -102,18 +102,19 @@ android:layout_gravity="fill_horizontal" style="@style/FilterShowSlider" /> </GridLayout> - <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:columnCount="2" - android:orientation="horizontal" - android:layout_marginTop="24dp" > + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginTop="24dp"> + - <ImageButton + <ImageButton android:id="@+id/gradAddButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left|center_vertical" + android:layout_gravity="start|center_vertical" + android:gravity="start" android:scaleType="centerInside" android:layout_weight="0" android:background="@drawable/filtershow_button_background" @@ -121,16 +122,24 @@ android:paddingBottom="8dp" android:layout_marginLeft="48dp" /> - <ImageButton + <View + android:layout_width="wrap_content" + android:layout_height="8dp" + android:layout_weight="1"/> + + <ImageButton android:id="@+id/gradDelButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="right|center_vertical" + android:layout_gravity="end|center_vertical" + android:gravity="end" android:scaleType="centerInside" android:layout_weight="0" android:background="@drawable/filtershow_button_background" android:src="@drawable/ic_menu_trash_holo_light" android:paddingBottom="8dp" android:layout_marginRight="48dp" /> - </GridLayout> + + </LinearLayout> + </LinearLayout> diff --git a/res/layout/filtershow_control_action_slider.xml b/res/layout/filtershow_control_action_slider.xml index a3ef3ed5d..34eac1e69 100644 --- a/res/layout/filtershow_control_action_slider.xml +++ b/res/layout/filtershow_control_action_slider.xml @@ -25,7 +25,7 @@ android:id="@+id/leftActionButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left|center_vertical" + android:layout_gravity="start|center_vertical" android:scaleType="centerInside" android:layout_weight="0" android:background="@drawable/filtershow_button_background" @@ -44,7 +44,7 @@ android:id="@+id/rightActionButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left|center_vertical" + android:layout_gravity="end|center_vertical" android:scaleType="centerInside" android:layout_weight="0" android:background="@drawable/filtershow_button_background" diff --git a/src/com/android/gallery3d/filtershow/state/StateView.java b/src/com/android/gallery3d/filtershow/state/StateView.java index 56c97ab62..a43cd47ba 100644 --- a/src/com/android/gallery3d/filtershow/state/StateView.java +++ b/src/com/android/gallery3d/filtershow/state/StateView.java @@ -166,22 +166,42 @@ public class StateView extends View implements SwipableView { } private void drawHorizontalPath(float w, float h, float r, float d) { - mPath.moveTo(0, 0); - if (mType == END) { - mPath.lineTo(w, 0); + if (this.getLayoutDirection() == LAYOUT_DIRECTION_RTL) { + mPath.moveTo(w, 0); + if (mType == END) { + mPath.lineTo(0, 0); + mPath.lineTo(0, h); + } else { + mPath.lineTo(d, 0); + mPath.lineTo(d, r); + mPath.lineTo(0, r + d); + mPath.lineTo(d, r + d + r); + mPath.lineTo(d, h); + } mPath.lineTo(w, h); + if (mType != BEGIN) { + mPath.lineTo(w, r + d + r); + mPath.lineTo(w - d, r + d); + mPath.lineTo(w, r); + } } else { - mPath.lineTo(w - d, 0); - mPath.lineTo(w - d, r); - mPath.lineTo(w, r + d); - mPath.lineTo(w - d, r + d + r); - mPath.lineTo(w - d, h); - } - mPath.lineTo(0, h); - if (mType != BEGIN) { - mPath.lineTo(0, r + d + r); - mPath.lineTo(d, r + d); - mPath.lineTo(0, r); + mPath.moveTo(0, 0); + if (mType == END) { + mPath.lineTo(w, 0); + mPath.lineTo(w, h); + } else { + mPath.lineTo(w - d, 0); + mPath.lineTo(w - d, r); + mPath.lineTo(w, r + d); + mPath.lineTo(w - d, r + d + r); + mPath.lineTo(w - d, h); + } + mPath.lineTo(0, h); + if (mType != BEGIN) { + mPath.lineTo(0, r + d + r); + mPath.lineTo(d, r + d); + mPath.lineTo(0, r); + } } mPath.close(); } |