diff options
author | Svetoslav <svetoslavganov@google.com> | 2013-09-24 15:14:41 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2013-09-24 15:46:17 -0700 |
commit | 2a708617dfdc0b6dbf9b39baebbdc55d19aa7728 (patch) | |
tree | 08ae48aa0b050e689961b24ec45f5c4738045403 /packages/PrintSpooler | |
parent | 0d38d0b42fba7dc50454d5c0652cf351c58a9db6 (diff) | |
download | frameworks_base-2a708617dfdc0b6dbf9b39baebbdc55d19aa7728.zip frameworks_base-2a708617dfdc0b6dbf9b39baebbdc55d19aa7728.tar.gz frameworks_base-2a708617dfdc0b6dbf9b39baebbdc55d19aa7728.tar.bz2 |
User should not be able to select unavailable printers.
1. If the printer is unavailable we should not allow the user
to select it. Rather, show it grayed out.
2. Some string changes requeted by translators.
bug:10917222
Change-Id: I370f05f9c8e70e3f077db7eb02cf48e19a59925d
Diffstat (limited to 'packages/PrintSpooler')
3 files changed, 21 insertions, 10 deletions
diff --git a/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml b/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml index f00da0d..65d1ee7 100644 --- a/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml +++ b/packages/PrintSpooler/res/layout/spinner_dropdown_item.xml @@ -47,7 +47,6 @@ android:visibility="gone" android:textColor="@color/item_text_color" android:duplicateParentState="true"> - </TextView> </LinearLayout> diff --git a/packages/PrintSpooler/res/values/strings.xml b/packages/PrintSpooler/res/values/strings.xml index 543c425..9fe7e00 100644 --- a/packages/PrintSpooler/res/values/strings.xml +++ b/packages/PrintSpooler/res/values/strings.xml @@ -26,24 +26,24 @@ <string name="save_button">Save</string> <!-- Label of the destination widget. [CHAR LIMIT=20] --> - <string name="label_destination">DESTIINATION</string> + <string name="label_destination">Destination</string> <!-- Label of the copies count widget. [CHAR LIMIT=20] --> - <string name="label_copies">COPIES</string> + <string name="label_copies">Copies</string> <!-- Label of the paper size widget. [CHAR LIMIT=20] --> - <string name="label_paper_size">PAPER SIZE</string> + <string name="label_paper_size">Paper Size</string> <!-- Label of the color mode widget. [CHAR LIMIT=20] --> - <string name="label_color">COLOR</string> + <string name="label_color">Color</string> <!-- Label of the orientation widget. [CHAR LIMIT=20] --> - <string name="label_orientation">ORIENTATION</string> + <string name="label_orientation">Orientation</string> <!-- Label of the page selection widget. [CHAR LIMIT=20] --> - <string name="label_pages">PAGES (<xliff:g id="page_count" example="5">%1$s</xliff:g>)</string> + <string name="label_pages">Pages (<xliff:g id="page_count" example="5">%1$s</xliff:g>)</string> - <!-- Page range exmple used as a hint of how to specify such. [CHAR LIMIT=15] --> + <!-- Page range exmple used as a hint of how to specify such. [CHAR LIMIT=20] --> <string name="pages_range_example">e.g. 1–5, 8, 11–13</string> <!-- Title for the pring preview button .[CHAR LIMIT=30] --> @@ -56,7 +56,7 @@ <string name="printing_app_crashed">Printing app crashed</string> <!-- Title if the number of pages in a printed document is unknown. [CHAR LIMIT=20] --> - <string name="page_count_unknown">unknown</string> + <string name="page_count_unknown">unavailable</string> <!-- Title for the temporary dialog show while an app is generating a print job. [CHAR LIMIT=30] --> <string name="generating_print_job">Generating print job</string> diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java index 3a6da5d4..05b0b69 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java @@ -1974,6 +1974,16 @@ public class PrintJobConfigActivity extends Activity { } @Override + public boolean isEnabled(int position) { + Object item = getItem(position); + if (item instanceof PrinterInfo) { + PrinterInfo printer = (PrinterInfo) item; + return printer.getStatus() != PrinterInfo.STATUS_UNAVAILABLE; + } + return true; + } + + @Override public Object getItem(int position) { if (mPrinters.isEmpty()) { if (position == 0) { @@ -2016,7 +2026,9 @@ public class PrintJobConfigActivity extends Activity { @Override public View getDropDownView(int position, View convertView, ViewGroup parent) { - return getView(position, convertView, parent); + View view = getView(position, convertView, parent); + view.setEnabled(isEnabled(position)); + return view; } @Override |