diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2013-08-08 02:48:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-08 02:48:01 +0000 |
commit | 1194d3f7332c933599c7b8dcf86b0b604b6e5cf1 (patch) | |
tree | 6b0e0dc7c1faf5ee3d0cfdf1a11a3ee14f91e7cb | |
parent | b3c21ac7c661022534135bf688a75ec35fe3a8f2 (diff) | |
parent | 695c7fa7a320f1e5b4b56aa7ed6a64c6220f6502 (diff) | |
download | frameworks_base-1194d3f7332c933599c7b8dcf86b0b604b6e5cf1.zip frameworks_base-1194d3f7332c933599c7b8dcf86b0b604b6e5cf1.tar.gz frameworks_base-1194d3f7332c933599c7b8dcf86b0b604b6e5cf1.tar.bz2 |
Merge "Print UI polish based on UX feedback."
8 files changed, 198 insertions, 182 deletions
diff --git a/packages/PrintSpooler/res/layout/print_job_config_activity_container.xml b/packages/PrintSpooler/res/layout/print_job_config_activity_container.xml index e36b8b5..a0c111b 100644 --- a/packages/PrintSpooler/res/layout/print_job_config_activity_container.xml +++ b/packages/PrintSpooler/res/layout/print_job_config_activity_container.xml @@ -19,7 +19,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:background="@color/print_job_config_activity_content_background"> + android:background="@color/container_background"> <include layout="@layout/print_job_config_activity_content_editing"> diff --git a/packages/PrintSpooler/res/layout/print_job_config_activity_content_editing.xml b/packages/PrintSpooler/res/layout/print_job_config_activity_content_editing.xml index 77ef5a2..84c41de 100644 --- a/packages/PrintSpooler/res/layout/print_job_config_activity_content_editing.xml +++ b/packages/PrintSpooler/res/layout/print_job_config_activity_content_editing.xml @@ -18,19 +18,22 @@ android:id="@+id/content_editing" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="vertical" - android:divider="?android:attr/dividerHorizontal" - android:showDividers="middle"> + android:orientation="vertical"> <ScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" - android:scrollbars="vertical"> + android:scrollbars="vertical" + android:background="@color/editable_background"> <GridLayout android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginStart="24dip" + android:layout_marginTop="32dip" + android:layout_marginEnd="24dip" + android:layout_marginBottom="24dip" android:orientation="vertical" android:columnCount="2"> @@ -41,14 +44,10 @@ 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_marginBottom="12dip" android:layout_row="0" android:layout_column="0" android:layout_columnSpan="2" - android:minHeight="?android:attr/listPreferredItemHeight"> + android:minHeight="?android:attr/listPreferredItemHeightSmall"> </Spinner> <!-- Copies --> @@ -58,31 +57,28 @@ 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_marginEnd="6dip" android:layout_row="2" android:layout_column="0" android:layout_gravity="bottom" android:inputType="numberDecimal" android:selectAllOnFocus="true" android:minWidth="150dip" - android:minHeight="?android:attr/listPreferredItemHeight"> + android:minHeight="?android:attr/listPreferredItemHeightSmall"> </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_marginStart="12dip" + android:layout_marginEnd="6dip" android:layout_row="1" android:layout_column="0" - android:layout_gravity="left|bottom" + android:layout_gravity="start|bottom" + android:labelFor="@id/copies_edittext" android:text="@string/label_copies" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/copies_edittext"> + android:textAppearance="@style/PrintOptionTitleTextAppearance"> </TextView> <!-- Paper size --> @@ -91,27 +87,22 @@ 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_marginStart="6dip" android:layout_row="2" android:layout_column="1" - android:minWidth="150dip" - android:minHeight="?android:attr/listPreferredItemHeight"> + style="@style/PrintOptionSpinnerStyle"> </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_marginStart="18dip" android:layout_row="1" android:layout_column="1" + android:labelFor="@id/paper_size_spinner" android:text="@string/label_paper_size" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/paper_size_spinner"> + android:textAppearance="@style/PrintOptionTitleTextAppearance"> </TextView> <!-- Color --> @@ -120,27 +111,23 @@ 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_marginEnd="6dip" android:layout_row="4" android:layout_column="0" - android:minWidth="150dip" - android:minHeight="?android:attr/listPreferredItemHeight"> + style="@style/PrintOptionSpinnerStyle"> </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_marginStart="12dip" + android:layout_marginEnd="6dip" android:layout_row="3" android:layout_column="0" + android:labelFor="@id/color_spinner" android:text="@string/label_color" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/color_spinner"> + android:textAppearance="@style/PrintOptionTitleTextAppearance"> </TextView> <!-- Orientation --> @@ -149,27 +136,22 @@ 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_marginStart="6dip" android:layout_row="4" android:layout_column="1" - android:minWidth="150dip" - android:minHeight="?android:attr/listPreferredItemHeight"> + style="@style/PrintOptionSpinnerStyle"> </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_marginStart="18dip" android:layout_row="3" android:layout_column="1" + android:labelFor="@id/orientation_spinner" android:text="@string/label_orientation" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/orientation_spinner"> + android:textAppearance="@style/PrintOptionTitleTextAppearance"> </TextView> <!-- Pages --> @@ -178,12 +160,10 @@ 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_marginEnd="6dip" android:layout_row="6" android:layout_column="0" - android:minWidth="150dip" - android:minHeight="?android:attr/listPreferredItemHeight"> + style="@style/PrintOptionSpinnerStyle"> </Spinner> <view @@ -191,8 +171,8 @@ 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_marginTop="12dip" + android:layout_marginStart="6dip" android:layout_row="6" android:layout_column="1" android:layout_gravity="bottom" @@ -201,81 +181,41 @@ android:hint="@string/pages_range_example" android:inputType="textNoSuggestions" android:visibility="gone" - android:minHeight="?android:attr/listPreferredItemHeight"> + android:minHeight="?android:attr/listPreferredItemHeightSmall"> </view> <TextView android:id="@+id/page_range_title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="32dip" android:layout_marginTop="12dip" - android:layout_marginRight="12dip" + android:layout_marginStart="12dip" android:layout_row="5" android:layout_column="0" + android:labelFor="@id/range_options_spinner" android:text="@string/label_pages" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textStyle="bold" - android:labelFor="@id/range_options_spinner"> + android:textAppearance="@style/PrintOptionTitleTextAppearance"> </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" - android:minHeight="?android:attr/listPreferredItemHeight"> - </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> - </GridLayout> </ScrollView> + <View + android:layout_width="fill_parent" + android:layout_height="1dip" + android:background="@color/separator"> + </View> + <Button android:id="@+id/print_button" + style="?android:attr/buttonBarButtonStyle" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" android:text="@string/print_button" - style="?android:attr/buttonBarButtonStyle"> + android:textSize="16sp" + android:textColor="@color/important_text"> </Button> </LinearLayout> diff --git a/packages/PrintSpooler/res/layout/print_job_config_activity_content_generating.xml b/packages/PrintSpooler/res/layout/print_job_config_activity_content_generating.xml index 6352afc..8bdb6c9 100644 --- a/packages/PrintSpooler/res/layout/print_job_config_activity_content_generating.xml +++ b/packages/PrintSpooler/res/layout/print_job_config_activity_content_generating.xml @@ -18,35 +18,56 @@ android:id="@+id/content_generating" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="vertical" - android:divider="?android:attr/dividerHorizontal" - android:showDividers="middle"> + android:orientation="vertical"> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - style="?android:attr/buttonBarButtonStyle" - android:singleLine="true" - android:ellipsize="end" - android:textAlignment="viewStart" - android:text="@string/generating_print_job" > - </TextView> - - <ProgressBar - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="32dip" - android:layout_gravity="center_horizontal" - style="?android:attr/progressBarStyleLarge"> - </ProgressBar> + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@color/editable_background" + android:orientation="vertical"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dip" + android:layout_marginEnd="16dip" + android:layout_gravity="center" + style="?android:attr/buttonBarButtonStyle" + android:singleLine="true" + android:ellipsize="end" + android:text="@string/generating_print_job" + android:textColor="@color/important_text" + android:textSize="16sp"> + </TextView> + + <ProgressBar + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="32dip" + android:layout_marginEnd="32dip" + android:layout_marginTop="16dip" + android:layout_marginBottom="32dip" + android:layout_gravity="center_horizontal" + style="?android:attr/progressBarStyleLarge"> + </ProgressBar> + + <View + android:layout_width="fill_parent" + android:layout_height="1dip" + android:background="@color/separator"> + </View> + + </LinearLayout> <Button android:id="@+id/cancel_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" - android:text="@string/cancel_button" - style="?android:attr/buttonBarButtonStyle"> + style="?android:attr/buttonBarButtonStyle" + android:text="@string/cancel" + android:textSize="16sp" + android:textColor="@color/important_text"> </Button> </LinearLayout> diff --git a/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml b/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml index 66c6724..002cc14 100644 --- a/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml +++ b/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml @@ -17,11 +17,11 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingLeft="8dip" - android:paddingRight="8dip" + android:paddingStart="8dip" + android:paddingEnd="8dip" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:orientation="vertical" - android:gravity="center_vertical"> + android:gravity="left|center_vertical"> <TextView android:id="@+id/title" @@ -30,7 +30,9 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:singleLine="true" android:ellipsize="end" - android:textIsSelectable="false"> + android:textIsSelectable="false" + android:gravity="top|left" + android:textColor="@color/important_text"> </TextView> <TextView @@ -41,7 +43,8 @@ android:singleLine="true" android:ellipsize="end" android:textIsSelectable="false" - android:visibility="gone"> + android:visibility="gone" + android:textColor="@color/important_text"> </TextView> diff --git a/packages/PrintSpooler/res/values/colors.xml b/packages/PrintSpooler/res/values/colors.xml index 3d8ba22..9972c96 100644 --- a/packages/PrintSpooler/res/values/colors.xml +++ b/packages/PrintSpooler/res/values/colors.xml @@ -15,5 +15,11 @@ --> <resources> - <color name="print_job_config_activity_content_background">#FFF2F2F2</color> + + <color name="container_background">#FFFFFF</color> + <color name="important_text">#333333</color> + <color name="print_option_title">#888888</color> + <color name="separator">#CCCCCC</color> + <color name="editable_background">#F2F2F2</color> + </resources>
\ No newline at end of file diff --git a/packages/PrintSpooler/res/values/strings.xml b/packages/PrintSpooler/res/values/strings.xml index 8391509..2086f58 100644 --- a/packages/PrintSpooler/res/values/strings.xml +++ b/packages/PrintSpooler/res/values/strings.xml @@ -20,10 +20,7 @@ <string name="app_label">Print Spooler</string> <!-- Label of the print dialog's print button. [CHAR LIMIT=16] --> - <string name="print_button">PRINT</string> - - <!-- Label of the print dialog's cancel button. [CHAR LIMIT=16] --> - <string name="cancel_button">CANCEL</string> + <string name="print_button">Print</string> <!-- Label of the destination widget. [CHAR LIMIT=20] --> <string name="label_destination">DESTIINATION</string> diff --git a/packages/PrintSpooler/res/values/styles.xml b/packages/PrintSpooler/res/values/styles.xml new file mode 100644 index 0000000..702adf4 --- /dev/null +++ b/packages/PrintSpooler/res/values/styles.xml @@ -0,0 +1,33 @@ +<?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. +--> + +<resources> + + <style name="PrintOptionTitleTextAppearance"> + <item name="android:textStyle">normal</item> + <item name="android:textSize">14sp</item> + <item name="android:textAllCaps">true</item> + <item name="android:textColor">@color/print_option_title</item> + </style> + + <style name="PrintOptionSpinnerStyle"> + <item name="android:paddingTop">0dip</item> + <item name="android:paddingBottom">0dip</item> + <item name="android:minWidth">150dip</item> + <item name="android:minHeight">?android:attr/listPreferredItemHeightSmall</item> + </style> + +</resources> diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java index 824815f..654bb6d 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java @@ -19,7 +19,6 @@ package com.android.printspooler; import android.app.Activity; import android.app.Dialog; import android.content.Context; -import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; @@ -56,6 +55,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.View.MeasureSpec; import android.view.View.OnClickListener; +import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; @@ -66,7 +66,6 @@ import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import android.widget.TextView; -import android.widget.Toast; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -104,7 +103,7 @@ public class PrintJobConfigActivity extends Activity { private static final int EDITOR_STATE_INITIALIZED = 1; private static final int EDITOR_STATE_CONFIRMED_PRINT = 2; - private static final int EDITOR_STATE_CONFIRMED_PREVIEW = 3; +// private static final int EDITOR_STATE_CONFIRMED_PREVIEW = 3; private static final int EDITOR_STATE_CANCELLED = 4; private static final int MIN_COPIES = 1; @@ -214,7 +213,7 @@ public class PrintJobConfigActivity extends Activity { public boolean onTouchEvent(MotionEvent event) { if (!mEditor.isPrintConfirmed() && !mEditor.isPreviewConfirmed() - && getWindow().shouldCloseOnTouch(this, event)) { + && mEditor.shouldCloseOnTouch(event)) { if (!mController.isWorking()) { PrintJobConfigActivity.this.finish(); } @@ -606,7 +605,7 @@ public class PrintJobConfigActivity extends Activity { private final SimpleStringSplitter mStringCommaSplitter = new SimpleStringSplitter(','); - private final Button mPrintPreviewButton; + private final View mContentContainer; private final Button mPrintButton; @@ -802,6 +801,9 @@ public class PrintJobConfigActivity extends Activity { private boolean mIgnoreNextRangeChange; public Editor() { + // Content container + mContentContainer = findViewById(R.id.content_container); + // Copies mCopiesEditText = (EditText) findViewById(R.id.copies_edittext); mCopiesEditText.setText(String.valueOf(MIN_COPIES)); @@ -864,19 +866,6 @@ public class PrintJobConfigActivity extends Activity { mRangeOptionsSpinner.setSelection(0); } - // Preview button - mPrintPreviewButton = (Button) findViewById(R.id.print_preview_button); - mPrintPreviewButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - mEditor.confirmPreview(); - // TODO: Implement me - Toast.makeText(PrintJobConfigActivity.this, - "Stop poking me! Not implemented yet :)", - Toast.LENGTH_LONG).show(); - } - }); - // Print button mPrintButton = (Button) findViewById(R.id.print_button); mPrintButton.setOnClickListener(new OnClickListener() { @@ -892,6 +881,32 @@ public class PrintJobConfigActivity extends Activity { updateUi(); } + public boolean shouldCloseOnTouch(MotionEvent event) { + if (event.getAction() != MotionEvent.ACTION_DOWN) { + return false; + } + + final int[] locationInWindow = new int[2]; + mContentContainer.getLocationInWindow(locationInWindow); + + final int windowTouchSlop = ViewConfiguration.get(PrintJobConfigActivity.this) + .getScaledWindowTouchSlop(); + final int eventX = (int) event.getX(); + final int eventY = (int) event.getY(); + final int lenientWindowLeft = locationInWindow[0] - windowTouchSlop; + final int lenientWindowRight = lenientWindowLeft + mContentContainer.getWidth() + + windowTouchSlop; + final int lenientWindowTop = locationInWindow[1] - windowTouchSlop; + final int lenientWindowBottom = lenientWindowTop + mContentContainer.getHeight() + + windowTouchSlop; + + if (eventX < lenientWindowLeft || eventX > lenientWindowRight + || eventY < lenientWindowTop || eventY > lenientWindowBottom) { + return true; + } + return false; + } + public boolean isShwoingGeneratingPrintJobUi() { return (findViewById(R.id.content_generating) != null); } @@ -917,7 +932,7 @@ public class PrintJobConfigActivity extends Activity { }); // First animation - fade out the old content. - contentEditing.animate().alpha(0.0f).withEndAction(new Runnable() { + contentEditing.animate().alpha(0.0f).withLayer().withEndAction(new Runnable() { @Override public void run() { contentEditing.setVisibility(View.INVISIBLE); @@ -936,7 +951,7 @@ public class PrintJobConfigActivity extends Activity { / (float) contentContainer.getHeight(); // Second animation - resize the container. - contentContainer.animate().scaleY(scaleY).withEndAction( + contentContainer.animate().scaleY(scaleY).withLayer().withEndAction( new Runnable() { @Override public void run() { @@ -946,7 +961,7 @@ public class PrintJobConfigActivity extends Activity { contentContainer.addView(contentGenerating); // Third animation - show the new content. - contentGenerating.animate().alpha(1.0f); + contentGenerating.animate().withLayer().alpha(1.0f); } }); } @@ -987,9 +1002,9 @@ public class PrintJobConfigActivity extends Activity { return mEditorState == EDITOR_STATE_CONFIRMED_PRINT; } - public void confirmPreview() { - mEditorState = EDITOR_STATE_CONFIRMED_PREVIEW; - } +// public void confirmPreview() { +// mEditorState = EDITOR_STATE_CONFIRMED_PREVIEW; +// } public PageRange[] getRequestedPages() { if (hasErrors()) { @@ -1035,7 +1050,8 @@ public class PrintJobConfigActivity extends Activity { mOrientationSpinner.setEnabled(false); mRangeOptionsSpinner.setEnabled(false); mRangeEditText.setEnabled(false); - mPrintPreviewButton.setEnabled(false); + // TODO: Remove entirely or implement print preview. +// mPrintPreviewButton.setEnabled(false); mPrintButton.setEnabled(false); return; } @@ -1092,9 +1108,9 @@ public class PrintJobConfigActivity extends Activity { mRangeEditText.setEnabled(false); mRangeEditText.setVisibility(View.INVISIBLE); - // Print preview - mPrintPreviewButton.setEnabled(false); - mPrintPreviewButton.setText(getString(R.string.print_preview)); +// // Print preview +// mPrintPreviewButton.setEnabled(false); +// mPrintPreviewButton.setText(getString(R.string.print_preview)); // Print mPrintButton.setEnabled(false); @@ -1291,15 +1307,15 @@ public class PrintJobConfigActivity extends Activity { && (TextUtils.isEmpty(mRangeEditText.getText()) || hasErrors())) || (mRangeOptionsSpinner.getSelectedItemPosition() == 0 && (!mController.hasPerformedLayout() || hasErrors()))) { - mPrintPreviewButton.setEnabled(false); +// mPrintPreviewButton.setEnabled(false); mPrintButton.setEnabled(false); } else { - mPrintPreviewButton.setEnabled(true); - if (hasPdfViewer()) { - mPrintPreviewButton.setText(getString(R.string.print_preview)); - } else { - mPrintPreviewButton.setText(getString(R.string.install_for_print_preview)); - } +// mPrintPreviewButton.setEnabled(true); +// if (hasPdfViewer()) { +// mPrintPreviewButton.setText(getString(R.string.print_preview)); +// } else { +// mPrintPreviewButton.setText(getString(R.string.install_for_print_preview)); +// } mPrintButton.setEnabled(true); } @@ -1412,12 +1428,12 @@ public class PrintJobConfigActivity extends Activity { || mCopiesEditText.getError() != null; } - private boolean hasPdfViewer() { - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setType("application/pdf"); - return !getPackageManager().queryIntentActivities(intent, - PackageManager.MATCH_DEFAULT_ONLY).isEmpty(); - } +// private boolean hasPdfViewer() { +// Intent intent = new Intent(Intent.ACTION_VIEW); +// intent.setType("application/pdf"); +// return !getPackageManager().queryIntentActivities(intent, +// PackageManager.MATCH_DEFAULT_ONLY).isEmpty(); +// } private final class SpinnerItem<T> { final T value; |