Merge "Update the print dialog." into klp-dev
This commit is contained in:
@@ -19179,7 +19179,7 @@ package android.print {
|
|||||||
field public static final android.print.PrintAttributes.MediaSize NA_LETTER;
|
field public static final android.print.PrintAttributes.MediaSize NA_LETTER;
|
||||||
field public static final android.print.PrintAttributes.MediaSize NA_MONARCH;
|
field public static final android.print.PrintAttributes.MediaSize NA_MONARCH;
|
||||||
field public static final android.print.PrintAttributes.MediaSize NA_QUARTO;
|
field public static final android.print.PrintAttributes.MediaSize NA_QUARTO;
|
||||||
field public static final android.print.PrintAttributes.MediaSize NA_TBLOID;
|
field public static final android.print.PrintAttributes.MediaSize NA_TABLOID;
|
||||||
field public static final android.print.PrintAttributes.MediaSize OM_DAI_PA_KAI;
|
field public static final android.print.PrintAttributes.MediaSize OM_DAI_PA_KAI;
|
||||||
field public static final android.print.PrintAttributes.MediaSize OM_JUURO_KU_KAI;
|
field public static final android.print.PrintAttributes.MediaSize OM_JUURO_KU_KAI;
|
||||||
field public static final android.print.PrintAttributes.MediaSize OM_PA_KAI;
|
field public static final android.print.PrintAttributes.MediaSize OM_PA_KAI;
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ public final class PrintAttributes implements Parcelable {
|
|||||||
public static final MediaSize NA_LEDGER =
|
public static final MediaSize NA_LEDGER =
|
||||||
new MediaSize("NA_LEDGER", "android", R.string.mediaSize_na_ledger, 17000, 11000);
|
new MediaSize("NA_LEDGER", "android", R.string.mediaSize_na_ledger, 17000, 11000);
|
||||||
/** North America Tabloid media size: 11" x 17" (279mm × 432mm) */
|
/** North America Tabloid media size: 11" x 17" (279mm × 432mm) */
|
||||||
public static final MediaSize NA_TBLOID =
|
public static final MediaSize NA_TABLOID =
|
||||||
new MediaSize("NA_TABLOID", "android",
|
new MediaSize("NA_TABLOID", "android",
|
||||||
R.string.mediaSize_na_tabloid, 11000, 17000);
|
R.string.mediaSize_na_tabloid, 11000, 17000);
|
||||||
/** North America Index Card 3x5 media size: 3" x 5" (76mm x 127mm) */
|
/** North America Index Card 3x5 media size: 3" x 5" (76mm x 127mm) */
|
||||||
|
|||||||
20
packages/PrintSpooler/res/color/item_text_color.xml
Normal file
20
packages/PrintSpooler/res/color/item_text_color.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2013 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
|
||||||
|
|
||||||
|
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
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_enabled="true" android:color="#333333" />
|
||||||
|
<item android:color="#888888"/>
|
||||||
|
</selector>
|
||||||
@@ -14,10 +14,10 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.android.printspooler.PrintDialogFrame xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/content_container"
|
android:id="@+id/content_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:background="@color/container_background">
|
android:background="@color/container_background">
|
||||||
</FrameLayout>
|
</com.android.printspooler.PrintDialogFrame>
|
||||||
|
|||||||
@@ -15,17 +15,16 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
android:background="@color/editable_background">
|
android:background="@color/editable_background">
|
||||||
|
|
||||||
<GridLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:columnCount="2">
|
|
||||||
|
|
||||||
<!-- Destination -->
|
<!-- Destination -->
|
||||||
|
|
||||||
@@ -37,190 +36,179 @@
|
|||||||
android:layout_marginTop="24dip"
|
android:layout_marginTop="24dip"
|
||||||
android:layout_marginStart="24dip"
|
android:layout_marginStart="24dip"
|
||||||
android:layout_marginEnd="24dip"
|
android:layout_marginEnd="24dip"
|
||||||
android:layout_row="0"
|
|
||||||
android:layout_column="0"
|
|
||||||
android:layout_columnSpan="2"
|
|
||||||
android:minHeight="?android:attr/listPreferredItemHeightSmall">
|
android:minHeight="?android:attr/listPreferredItemHeightSmall">
|
||||||
</Spinner>
|
</Spinner>
|
||||||
|
|
||||||
<!-- Copies -->
|
<LinearLayout
|
||||||
|
|
||||||
<view
|
|
||||||
class="com.android.printspooler.PrintJobConfigActivity$CustomEditText"
|
|
||||||
android:id="@+id/copies_edittext"
|
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dip"
|
android:orientation="horizontal"
|
||||||
android:layout_marginEnd="6dip"
|
android:baselineAligned="false">
|
||||||
android:layout_row="2"
|
|
||||||
android:layout_column="0"
|
|
||||||
android:layout_gravity="bottom|fill_horizontal"
|
|
||||||
style="@style/PrintOptionEditTextStyle"
|
|
||||||
android:inputType="numberDecimal">
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dip"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="12dip"
|
android:layout_weight="1"
|
||||||
android:layout_marginStart="36dip"
|
android:orientation="vertical">
|
||||||
android:layout_marginEnd="6dip"
|
|
||||||
android:layout_row="1"
|
|
||||||
android:layout_column="0"
|
|
||||||
style="@style/PrintOptionTextViewStyle"
|
|
||||||
android:labelFor="@id/copies_edittext"
|
|
||||||
android:text="@string/label_copies">
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<!-- Paper size -->
|
<!-- Copies -->
|
||||||
|
|
||||||
<Spinner
|
<TextView
|
||||||
android:id="@+id/paper_size_spinner"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginTop="12dip"
|
||||||
android:layout_marginStart="6dip"
|
android:layout_marginStart="36dip"
|
||||||
android:layout_marginEnd="24dip"
|
android:layout_marginEnd="6dip"
|
||||||
android:layout_row="2"
|
android:textAppearance="@style/PrintOptionTitleTextAppearance"
|
||||||
android:layout_column="1"
|
android:labelFor="@+id/copies_edittext"
|
||||||
android:layout_gravity="fill_horizontal"
|
android:text="@string/label_copies">
|
||||||
style="@style/PrintOptionSpinnerStyle">
|
</TextView>
|
||||||
</Spinner>
|
|
||||||
|
|
||||||
<TextView
|
<view
|
||||||
android:layout_width="wrap_content"
|
class="com.android.printspooler.PrintJobConfigActivity$CustomEditText"
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/copies_edittext"
|
||||||
android:layout_marginTop="12dip"
|
android:layout_width="fill_parent"
|
||||||
android:layout_marginStart="18dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dip"
|
android:layout_marginStart="24dip"
|
||||||
android:layout_row="1"
|
android:layout_marginEnd="6dip"
|
||||||
android:layout_column="1"
|
style="@style/PrintOptionEditTextStyle"
|
||||||
style="@style/PrintOptionTextViewStyle"
|
android:inputType="numberDecimal">
|
||||||
android:labelFor="@id/paper_size_spinner"
|
</view>
|
||||||
android:text="@string/label_paper_size">
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<!-- Color -->
|
<!-- Color -->
|
||||||
|
|
||||||
<Spinner
|
<TextView
|
||||||
android:id="@+id/color_spinner"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginTop="12dip"
|
||||||
android:layout_marginStart="24dip"
|
android:layout_marginStart="36dip"
|
||||||
android:layout_marginEnd="6dip"
|
android:layout_marginEnd="6dip"
|
||||||
android:layout_row="4"
|
android:textAppearance="@style/PrintOptionTitleTextAppearance"
|
||||||
android:layout_column="0"
|
android:labelFor="@+id/color_spinner"
|
||||||
android:layout_gravity="fill_horizontal"
|
android:text="@string/label_color">
|
||||||
style="@style/PrintOptionSpinnerStyle">
|
</TextView>
|
||||||
</Spinner>
|
|
||||||
|
|
||||||
<TextView
|
<Spinner
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/color_spinner"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_marginTop="12dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="36dip"
|
android:layout_marginStart="24dip"
|
||||||
android:layout_marginEnd="6dip"
|
android:layout_marginEnd="6dip"
|
||||||
android:layout_row="3"
|
style="@style/PrintOptionSpinnerStyle">
|
||||||
android:layout_column="0"
|
</Spinner>
|
||||||
style="@style/PrintOptionTextViewStyle"
|
|
||||||
android:labelFor="@id/color_spinner"
|
|
||||||
android:text="@string/label_color">
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<!-- Orientation -->
|
<!-- Range options -->
|
||||||
|
|
||||||
<Spinner
|
<TextView
|
||||||
android:id="@+id/orientation_spinner"
|
android:id="@+id/range_options_title"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="6dip"
|
android:layout_marginTop="12dip"
|
||||||
android:layout_marginEnd="24dip"
|
android:layout_marginStart="36dip"
|
||||||
android:layout_row="4"
|
android:textAppearance="@style/PrintOptionTitleTextAppearance"
|
||||||
android:layout_column="1"
|
android:labelFor="@+id/range_options_spinner"
|
||||||
android:layout_gravity="fill_horizontal"
|
android:text="@string/label_pages">
|
||||||
style="@style/PrintOptionSpinnerStyle">
|
</TextView>
|
||||||
</Spinner>
|
|
||||||
|
|
||||||
<TextView
|
<Spinner
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/range_options_spinner"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_marginTop="12dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="18dip"
|
android:layout_marginStart="24dip"
|
||||||
android:layout_marginEnd="24dip"
|
android:layout_marginEnd="6dip"
|
||||||
android:layout_row="3"
|
style="@style/PrintOptionSpinnerStyle">
|
||||||
android:layout_column="1"
|
</Spinner>
|
||||||
style="@style/PrintOptionTextViewStyle"
|
|
||||||
android:labelFor="@id/orientation_spinner"
|
|
||||||
android:text="@string/label_orientation">
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<!-- Range options -->
|
</LinearLayout>
|
||||||
|
|
||||||
<Spinner
|
<LinearLayout
|
||||||
android:id="@+id/range_options_spinner"
|
android:layout_width="0dip"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
||||||
android:layout_marginStart="24dip"
|
android:orientation="vertical">
|
||||||
android:layout_marginEnd="6dip"
|
|
||||||
android:layout_row="6"
|
|
||||||
android:layout_column="0"
|
|
||||||
android:layout_gravity="fill_horizontal"
|
|
||||||
style="@style/PrintOptionSpinnerStyle">
|
|
||||||
</Spinner>
|
|
||||||
|
|
||||||
<TextView
|
<!-- Paper size -->
|
||||||
android:id="@+id/range_options_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dip"
|
|
||||||
android:layout_marginStart="36dip"
|
|
||||||
android:layout_row="5"
|
|
||||||
android:layout_column="0"
|
|
||||||
style="@style/PrintOptionTextViewStyle"
|
|
||||||
android:labelFor="@id/range_options_spinner"
|
|
||||||
android:text="@string/label_pages">
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<!-- Pages -->
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dip"
|
||||||
|
android:layout_marginStart="18dip"
|
||||||
|
android:layout_marginEnd="24dip"
|
||||||
|
android:textAppearance="@style/PrintOptionTitleTextAppearance"
|
||||||
|
android:labelFor="@+id/paper_size_spinner"
|
||||||
|
android:text="@string/label_paper_size">
|
||||||
|
</TextView>
|
||||||
|
|
||||||
<view
|
<Spinner
|
||||||
class="com.android.printspooler.PrintJobConfigActivity$CustomEditText"
|
android:id="@+id/paper_size_spinner"
|
||||||
android:id="@+id/page_range_edittext"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginStart="6dip"
|
||||||
android:layout_marginStart="6dip"
|
android:layout_marginEnd="24dip"
|
||||||
android:layout_marginEnd="24dip"
|
style="@style/PrintOptionSpinnerStyle">
|
||||||
android:layout_row="6"
|
</Spinner>
|
||||||
android:layout_column="1"
|
|
||||||
android:layout_gravity="bottom|fill_horizontal"
|
|
||||||
style="@style/PrintOptionEditTextStyle"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:inputType="textNoSuggestions">
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<TextView
|
<!-- Orientation -->
|
||||||
android:id="@+id/page_range_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dip"
|
|
||||||
android:layout_marginStart="12dip"
|
|
||||||
android:layout_marginEnd="24dip"
|
|
||||||
android:layout_row="5"
|
|
||||||
android:layout_column="1"
|
|
||||||
style="@style/PrintOptionTextViewStyle"
|
|
||||||
android:labelFor="@id/page_range_edittext"
|
|
||||||
android:text="@string/pages_range_example"
|
|
||||||
android:textAllCaps="false">
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
<!-- Print button -->
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dip"
|
||||||
|
android:layout_marginStart="18dip"
|
||||||
|
android:layout_marginEnd="24dip"
|
||||||
|
android:textAppearance="@style/PrintOptionTitleTextAppearance"
|
||||||
|
android:labelFor="@+id/orientation_spinner"
|
||||||
|
android:text="@string/label_orientation">
|
||||||
|
</TextView>
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/orientation_spinner"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="6dip"
|
||||||
|
android:layout_marginEnd="24dip"
|
||||||
|
style="@style/PrintOptionSpinnerStyle">
|
||||||
|
</Spinner>
|
||||||
|
|
||||||
|
<!-- Pages -->
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/page_range_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dip"
|
||||||
|
android:layout_marginStart="12dip"
|
||||||
|
android:layout_marginEnd="24dip"
|
||||||
|
android:textAppearance="@style/PrintOptionTitleTextAppearance"
|
||||||
|
android:text="@string/pages_range_example"
|
||||||
|
android:labelFor="@+id/page_range_edittext"
|
||||||
|
android:textAllCaps="false">
|
||||||
|
</TextView>
|
||||||
|
|
||||||
|
<view
|
||||||
|
class="com.android.printspooler.PrintJobConfigActivity$CustomEditText"
|
||||||
|
android:id="@+id/page_range_edittext"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="6dip"
|
||||||
|
android:layout_marginEnd="24dip"
|
||||||
|
android:layout_gravity="bottom|fill_horizontal"
|
||||||
|
style="@style/PrintOptionEditTextStyle"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:inputType="textNoSuggestions">
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Print button -->
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="1dip"
|
android:layout_height="1dip"
|
||||||
android:layout_marginTop="24dip"
|
android:layout_marginTop="24dip"
|
||||||
android:layout_row="7"
|
|
||||||
android:layout_column="0"
|
|
||||||
android:layout_columnSpan="2"
|
|
||||||
android:layout_gravity="fill_horizontal"
|
android:layout_gravity="fill_horizontal"
|
||||||
android:background="@color/separator"
|
android:background="@color/separator"
|
||||||
android:contentDescription="@null">
|
android:contentDescription="@null">
|
||||||
@@ -229,18 +217,14 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/print_button"
|
android:id="@+id/print_button"
|
||||||
style="?android:attr/buttonBarButtonStyle"
|
style="?android:attr/buttonBarButtonStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="fill_horizontal"
|
android:layout_gravity="fill_horizontal"
|
||||||
android:layout_row="8"
|
|
||||||
android:layout_column="0"
|
|
||||||
android:layout_columnSpan="2"
|
|
||||||
android:text="@string/print_button"
|
android:text="@string/print_button"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textColor="@color/important_text">
|
android:textColor="@color/item_text_color">
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</GridLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="8dip"
|
android:paddingStart="8dip"
|
||||||
@@ -32,7 +32,8 @@
|
|||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
android:gravity="top|left"
|
android:gravity="top|left"
|
||||||
android:textColor="@color/important_text">
|
android:textColor="@color/item_text_color"
|
||||||
|
android:duplicateParentState="true">
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -44,7 +45,8 @@
|
|||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:textColor="@color/important_text">
|
android:textColor="@color/item_text_color"
|
||||||
|
android:duplicateParentState="true">
|
||||||
|
|
||||||
</TextView>
|
</TextView>
|
||||||
|
|
||||||
|
|||||||
@@ -24,4 +24,6 @@
|
|||||||
<item>@integer/page_option_value_page_range</item>
|
<item>@integer/page_option_value_page_range</item>
|
||||||
</integer-array>
|
</integer-array>
|
||||||
|
|
||||||
|
<dimen name="print_dialog_frame_max_width_dip">400dip</dimen>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -26,22 +26,14 @@
|
|||||||
<style name="PrintOptionSpinnerStyle">
|
<style name="PrintOptionSpinnerStyle">
|
||||||
<item name="android:paddingTop">0dip</item>
|
<item name="android:paddingTop">0dip</item>
|
||||||
<item name="android:paddingBottom">0dip</item>
|
<item name="android:paddingBottom">0dip</item>
|
||||||
<item name="android:minWidth">150dip</item>
|
|
||||||
<item name="android:maxWidth">200dip</item>
|
|
||||||
<item name="android:minHeight">?android:attr/listPreferredItemHeightSmall</item>
|
<item name="android:minHeight">?android:attr/listPreferredItemHeightSmall</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="PrintOptionEditTextStyle">
|
<style name="PrintOptionEditTextStyle">
|
||||||
<item name="android:selectAllOnFocus">true</item>
|
<item name="android:selectAllOnFocus">true</item>
|
||||||
<item name="android:minHeight">?android:attr/listPreferredItemHeightSmall</item>
|
<item name="android:minHeight">?android:attr/listPreferredItemHeightSmall</item>
|
||||||
<item name="android:maxWidth">200dip</item>
|
|
||||||
<item name="android:singleLine">true</item>
|
<item name="android:singleLine">true</item>
|
||||||
<item name="android:ellipsize">end</item>
|
<item name="android:ellipsize">end</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="PrintOptionTextViewStyle">
|
|
||||||
<item name="android:textAppearance">@style/PrintOptionTitleTextAppearance</item>
|
|
||||||
<item name="android:maxWidth">200dip</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 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
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.printspooler;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
public class PrintDialogFrame extends FrameLayout {
|
||||||
|
|
||||||
|
public final int mMaxWidth;
|
||||||
|
|
||||||
|
public PrintDialogFrame(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
mMaxWidth = context.getResources().getDimensionPixelSize(
|
||||||
|
R.dimen.print_dialog_frame_max_width_dip);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
|
||||||
|
if (widthMode == MeasureSpec.AT_MOST) {
|
||||||
|
final int receivedWidth = MeasureSpec.getSize(widthMeasureSpec);
|
||||||
|
final int computedWidth = Math.min(mMaxWidth, receivedWidth);
|
||||||
|
widthMeasureSpec = MeasureSpec.makeMeasureSpec(computedWidth,
|
||||||
|
MeasureSpec.EXACTLY);
|
||||||
|
}
|
||||||
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user