summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-09-09 21:26:24 -0700
committerSvetoslav <svetoslavganov@google.com>2014-09-09 21:30:35 -0700
commit3ab1ec05491d5da8eea070889c03b6ea4f2af5bc (patch)
treedfd0ecbaf40b97e46473873bb287b42489463611
parentcd7955f66c3b1c47b477ae197ec15c586cec784e (diff)
downloadframeworks_base-3ab1ec05491d5da8eea070889c03b6ea4f2af5bc.zip
frameworks_base-3ab1ec05491d5da8eea070889c03b6ea4f2af5bc.tar.gz
frameworks_base-3ab1ec05491d5da8eea070889c03b6ea4f2af5bc.tar.bz2
RTL support for print UI.
bug:16966145 Change-Id: I488d11f1941545630d52eea4c4d48c43667c6067
-rw-r--r--core/res/res/layout/simple_spinner_dropdown_item.xml21
-rw-r--r--packages/PrintSpooler/res/layout/print_activity.xml2
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java9
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/widget/PrintOptionsLayout.java2
4 files changed, 19 insertions, 15 deletions
diff --git a/core/res/res/layout/simple_spinner_dropdown_item.xml b/core/res/res/layout/simple_spinner_dropdown_item.xml
index e2bd474..f276cfa 100644
--- a/core/res/res/layout/simple_spinner_dropdown_item.xml
+++ b/core/res/res/layout/simple_spinner_dropdown_item.xml
@@ -4,24 +4,23 @@
**
** Copyright 2008, The Android Open Source Project
**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
+** Licensed under the Apache License, Version 2.0 (the "License")
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
**
-** http://www.apache.org/licenses/LICENSE-2.0
+** http://www.apache.org/licenses/LICENSE-2.0
**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
-<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
+<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/spinnerDropDownItemStyle"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="?android:attr/dropdownListPreferredItemHeight"
- android:ellipsize="marquee"
- android:textAlignment="inherit"/>
+ android:ellipsize="marquee"/>
diff --git a/packages/PrintSpooler/res/layout/print_activity.xml b/packages/PrintSpooler/res/layout/print_activity.xml
index 30b9629..6b8aa47 100644
--- a/packages/PrintSpooler/res/layout/print_activity.xml
+++ b/packages/PrintSpooler/res/layout/print_activity.xml
@@ -98,7 +98,7 @@
android:id="@+id/print_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginEnd="16dip"
+ android:layout_marginStart="16dip"
android:elevation="@dimen/preview_controls_elevation"
android:background="@drawable/print_button">
</ImageButton>
diff --git a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java
index c84b06a..970e3c0 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java
@@ -283,8 +283,13 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis
mDynamicContent.layout(left, dynContentTop, right, dynContentBottom);
MarginLayoutParams params = (MarginLayoutParams) mPrintButton.getLayoutParams();
- final int rightMargin = params.rightMargin;
- final int printButtonLeft = right - mPrintButton.getMeasuredWidth() - rightMargin;
+
+ final int printButtonLeft;
+ if (getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) {
+ printButtonLeft = right - mPrintButton.getMeasuredWidth() - params.getMarginStart();
+ } else {
+ printButtonLeft = left + params.getMarginStart();
+ }
final int printButtonTop = dynContentBottom - mPrintButton.getMeasuredHeight() / 2;
final int printButtonRight = printButtonLeft + mPrintButton.getMeasuredWidth();
final int printButtonBottom = printButtonTop + mPrintButton.getMeasuredHeight();
diff --git a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintOptionsLayout.java b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintOptionsLayout.java
index 71f4aa7..7a80a8b 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintOptionsLayout.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintOptionsLayout.java
@@ -89,7 +89,7 @@ public final class PrintOptionsLayout extends ViewGroup {
columnWidth - childParams.getMarginStart() - childParams.getMarginEnd(),
MeasureSpec.EXACTLY);
} else {
- childWidthMeasureSpec = getChildMeasureSpec(heightMeasureSpec,
+ childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
getPaddingStart() + getPaddingEnd() + width, childParams.width);
}