diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2013-07-23 13:29:31 -0700 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2013-07-23 18:05:53 -0700 |
commit | 0d1daa50f6d180c57f92596501e2e5c0b5ef9997 (patch) | |
tree | 130ab8cf87d8762783a121c7e01f1fbd88f2a258 /packages/PrintSpooler/res/layout | |
parent | 88d199130d44c6bacb383a7757e782cf97483c68 (diff) | |
download | frameworks_base-0d1daa50f6d180c57f92596501e2e5c0b5ef9997.zip frameworks_base-0d1daa50f6d180c57f92596501e2e5c0b5ef9997.tar.gz frameworks_base-0d1daa50f6d180c57f92596501e2e5c0b5ef9997.tar.bz2 |
Updating the print dialog and its interactinos with the printing app.
1. Added support for reporting the old print attributes during layout.
Now we keep track of the old print attributes, so the app can
compute the delta and decide whether re-layout work is needed.
2. Fixed PrintDocumentAdapter callback interleavings. Layout callbacks
were intermixing with write ones - a mess. Now we make an attempt
to cancel layout and write if they respond to cancellation, otherwise
we wait but do not interleave them.
3. Refactored the PrintJobConfigActivity for easier maintenance and
to have a single update UI method that does the minimal amount
of work.
Change-Id: I31ada1a0550882e6185018e6f17f923aed165d15
Diffstat (limited to 'packages/PrintSpooler/res/layout')
-rw-r--r-- | packages/PrintSpooler/res/layout/print_job_config_activity.xml | 441 |
1 files changed, 254 insertions, 187 deletions
diff --git a/packages/PrintSpooler/res/layout/print_job_config_activity.xml b/packages/PrintSpooler/res/layout/print_job_config_activity.xml index 8736bdd..32bc15a 100644 --- a/packages/PrintSpooler/res/layout/print_job_config_activity.xml +++ b/packages/PrintSpooler/res/layout/print_job_config_activity.xml @@ -5,7 +5,7 @@ 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, @@ -14,197 +14,264 @@ limitations under the License. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="vertical" + android:scrollbars="vertical"> - <ScrollView - android:layout_width="fill_parent" + <GridLayout + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@*android:color/bright_foreground_disabled_holo_light"> + android:orientation="vertical" + android:columnCount="2"> - <GridLayout + <!-- Destination --> + + <Spinner + android:id="@+id/destination_spinner" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="fill_horizontal" + android:layout_marginLeft="32dip" + android:layout_marginRight="32dip" + android:layout_marginBottom="12dip" + android:layout_row="0" + android:layout_column="0" + android:layout_columnSpan="2" + android:minHeight="?android:attr/listPreferredItemHeightSmall"> + </Spinner> + + <!-- Copies --> + + <view + class="com.android.printspooler.PrintJobConfigActivity$CustomEditText" + android:id="@+id/copies_edittext" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="32dip" + android:layout_marginRight="12dip" + android:layout_marginBottom="12dip" + android:layout_row="2" + android:layout_column="0" + android:layout_gravity="bottom" + android:inputType="numberDecimal" + android:selectAllOnFocus="true" + android:minWidth="150dip"> + </view> + + <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="32dip" - android:orientation="vertical" - android:columnCount="2"> - - <!-- Destination --> - - <Spinner - android:id="@+id/destination_spinner" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="12dip" - android:layout_row="0" - android:layout_column="0" - android:layout_columnSpan="2" - android:minWidth="324dip" - android:minHeight="?android:attr/listPreferredItemHeightSmall"> - </Spinner> - - <!-- Copies --> - - <view - class="com.android.printspooler.PrintJobConfigActivity$CustomEditText" - android:id="@+id/copies_edittext" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginRight="12dip" - android:layout_marginBottom="12dip" - android:layout_row="2" - android:layout_column="0" - android:layout_gravity="bottom" - android:inputType="numberDecimal" - android:selectAllOnFocus="true" - android:minWidth="150dip"> - </view> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="12dip" - android:layout_marginRight="12dip" - android:layout_row="1" - android:layout_column="0" - android:layout_gravity="left|bottom" - android:text="@string/label_copies" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/copies_edittext"> - </TextView> - - <!-- Paper size --> - - <Spinner - android:id="@+id/paper_size_spinner" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="12dip" - android:layout_marginBottom="12dip" - android:layout_row="2" - android:layout_column="1" - android:minWidth="150dip"> - </Spinner> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="12dip" - android:layout_marginTop="12dip" - android:layout_row="1" - android:layout_column="1" - android:text="@string/label_paper_size" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/paper_size_spinner"> - </TextView> - - <!-- Color --> - - <Spinner - android:id="@+id/color_spinner" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginRight="12dip" - android:layout_marginBottom="12dip" - android:layout_row="4" - android:layout_column="0" - android:minWidth="150dip"> - </Spinner> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="12dip" - android:layout_marginRight="12dip" - android:layout_row="3" - android:layout_column="0" - android:text="@string/label_color" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/color_spinner"> - </TextView> - - <!-- Orientation --> - - <Spinner - android:id="@+id/orientation_spinner" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="12dip" - android:layout_marginBottom="12dip" - android:layout_row="4" - android:layout_column="1" - android:minWidth="150dip"> - </Spinner> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="12dip" - android:layout_marginTop="12dip" - android:layout_row="3" - android:layout_column="1" - android:text="@string/label_orientation" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/orientation_spinner"> - </TextView> - - <!-- Pages --> - - <Spinner - android:id="@+id/range_options_spinner" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginRight="12dip" - android:layout_row="6" - android:layout_column="0" - android:minWidth="150dip"> - </Spinner> - - <EditText - android:id="@+id/page_range_edittext" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="12dip" - android:layout_row="6" - android:layout_column="1" - android:layout_gravity="bottom" - android:selectAllOnFocus="true" - android:minWidth="150dip" - android:hint="@string/pages_range_example" - android:inputType="textNoSuggestions" - android:visibility="gone"> - </EditText> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="12dip" - android:layout_marginRight="12dip" - android:layout_row="5" - android:layout_column="0" - android:text="@string/label_pages" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/range_options_spinner"> - </TextView> - - </GridLayout> - - </ScrollView> - - <Button - android:id="@+id/print_button" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:padding="0dip" - android:text="@string/print_button" - android:background="?android:attr/selectableItemBackground"> - </Button> + android:layout_marginLeft="32dip" + android:layout_marginTop="12dip" + android:layout_marginRight="12dip" + android:layout_row="1" + android:layout_column="0" + android:layout_gravity="left|bottom" + android:text="@string/label_copies" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textStyle="bold" + android:labelFor="@id/copies_edittext"> + </TextView> + + <!-- Paper size --> + + <Spinner + android:id="@+id/paper_size_spinner" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="12dip" + android:layout_marginRight="32dip" + android:layout_marginBottom="12dip" + android:layout_row="2" + android:layout_column="1" + android:minWidth="150dip"> + </Spinner> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="12dip" + android:layout_marginRight="32dip" + android:layout_marginTop="12dip" + android:layout_row="1" + android:layout_column="1" + android:text="@string/label_paper_size" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textStyle="bold" + android:labelFor="@id/paper_size_spinner"> + </TextView> + + <!-- Color --> + + <Spinner + android:id="@+id/color_spinner" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="32dip" + android:layout_marginRight="12dip" + android:layout_marginBottom="12dip" + android:layout_row="4" + android:layout_column="0" + android:minWidth="150dip"> + </Spinner> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="32dip" + android:layout_marginTop="12dip" + android:layout_marginRight="12dip" + android:layout_row="3" + android:layout_column="0" + android:text="@string/label_color" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textStyle="bold" + android:labelFor="@id/color_spinner"> + </TextView> + + <!-- Orientation --> + + <Spinner + android:id="@+id/orientation_spinner" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="12dip" + android:layout_marginRight="32dip" + android:layout_marginBottom="12dip" + android:layout_row="4" + android:layout_column="1" + android:minWidth="150dip"> + </Spinner> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="12dip" + android:layout_marginTop="12dip" + android:layout_marginRight="32dip" + android:layout_row="3" + android:layout_column="1" + android:text="@string/label_orientation" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textStyle="bold" + android:labelFor="@id/orientation_spinner"> + </TextView> + + <!-- Pages --> + + <Spinner + android:id="@+id/range_options_spinner" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="32dip" + android:layout_marginRight="12dip" + android:layout_row="6" + android:layout_column="0" + android:minWidth="150dip"> + </Spinner> + + <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_marginLeft="12dip" + android:layout_marginRight="32dip" + android:layout_row="6" + android:layout_column="1" + android:layout_gravity="bottom" + android:selectAllOnFocus="true" + android:minWidth="150dip" + android:hint="@string/pages_range_example" + android:inputType="textNoSuggestions" + android:visibility="gone"> + </view> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="32dip" + android:layout_marginTop="12dip" + android:layout_marginRight="12dip" + android:layout_row="5" + android:layout_column="0" + android:text="@string/label_pages" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textStyle="bold" + android:labelFor="@id/range_options_spinner"> + </TextView> + + <!-- Print pereview --> + + <ImageView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="fill_horizontal" + android:layout_marginLeft="32dip" + android:layout_marginTop="32dip" + android:layout_marginRight="32dip" + android:layout_row="7" + android:layout_column="0" + android:layout_columnSpan="2" + android:background="?android:attr/listDivider" + android:contentDescription="@null"> + </ImageView> + + <Button + android:id="@+id/print_preview_button" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="fill_horizontal" + android:layout_marginLeft="32dip" + android:layout_marginRight="32dip" + android:layout_row="8" + android:layout_column="0" + android:layout_columnSpan="2" + android:text="@string/print_preview" + android:gravity="left|center_vertical" + android:background="?android:attr/selectableItemBackground"> + </Button> + + <ImageView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="fill_horizontal" + android:layout_marginLeft="32dip" + android:layout_marginRight="32dip" + android:layout_marginBottom="32dip" + android:layout_row="9" + android:layout_column="0" + android:layout_columnSpan="2" + android:background="?android:attr/listDivider" + android:contentDescription="@null"> + </ImageView> + + <ImageView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="fill_horizontal" + android:layout_row="10" + android:layout_column="0" + android:layout_columnSpan="2" + android:background="?android:attr/listDivider" + android:contentDescription="@null"> + </ImageView> + + <Button + android:id="@+id/print_button" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="fill_horizontal" + android:layout_row="11" + android:layout_column="0" + android:layout_columnSpan="2" + android:padding="0dip" + android:text="@string/print_button" + android:background="?android:attr/selectableItemBackground"> + </Button> + + </GridLayout> -</LinearLayout> +</ScrollView> |