Merge "RTL support for print UI." into lmp-dev

This commit is contained in:
Svetoslav
2014-09-10 20:06:16 +00:00
committed by Android (Google) Code Review
4 changed files with 19 additions and 15 deletions

View File

@@ -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"/>

View File

@@ -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>

View File

@@ -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();

View File

@@ -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);
}