diff options
author | Svetoslav <svetoslavganov@google.com> | 2013-10-02 02:21:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-02 02:21:29 +0000 |
commit | cbf3f2cde569aac3a49d888d2bd52d77dc139738 (patch) | |
tree | 4d7e8adc23d46ac38a1f23b61c98615b97a8d431 /packages | |
parent | 42e9b63100edfef7a9cbee735ee3574fb1b94349 (diff) | |
parent | 976b4e6312ca7a4cca56211fa5b347b018dd305a (diff) | |
download | frameworks_base-cbf3f2cde569aac3a49d888d2bd52d77dc139738.zip frameworks_base-cbf3f2cde569aac3a49d888d2bd52d77dc139738.tar.gz frameworks_base-cbf3f2cde569aac3a49d888d2bd52d77dc139738.tar.bz2 |
Merge "Adding an empty state UI for the printer search activity in the spooler." into klp-dev
Diffstat (limited to 'packages')
3 files changed, 47 insertions, 7 deletions
diff --git a/packages/PrintSpooler/res/layout/select_printer_activity.xml b/packages/PrintSpooler/res/layout/select_printer_activity.xml index f4e1853..e86e9aa 100644 --- a/packages/PrintSpooler/res/layout/select_printer_activity.xml +++ b/packages/PrintSpooler/res/layout/select_printer_activity.xml @@ -14,10 +14,10 @@ limitations under the License. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="horizontal" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="fill_parent" - android:layout_height="wrap_content"> + android:layout_height="fill_parent"> <fragment android:name="com.android.printspooler.SelectPrinterFragment" @@ -26,4 +26,39 @@ android:layout_height="wrap_content"> </fragment> -</FrameLayout>
\ No newline at end of file + <FrameLayout + android:id="@+id/empty_print_state" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:visibility="gone"> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:gravity="center" + android:orientation="vertical"> + + <ImageView + android:id="@+id/icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="12dip" + android:src="@*android:drawable/ic_grayedout_printer" + android:contentDescription="@string/print_no_printers_found"> + </ImageView> + + <TextView + android:id="@+id/message" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceLarge" + android:textColor="?android:attr/textColorSecondary" + android:text="@string/print_no_printers_found"> + </TextView> + + </LinearLayout> + + </FrameLayout> + +</LinearLayout> diff --git a/packages/PrintSpooler/res/values/strings.xml b/packages/PrintSpooler/res/values/strings.xml index 5ee8d8c..41775a1 100644 --- a/packages/PrintSpooler/res/values/strings.xml +++ b/packages/PrintSpooler/res/values/strings.xml @@ -75,13 +75,16 @@ <!-- Title for the select printer activity. [CHAR LIMIT=30] --> <string name="all_printers_label">All printers</string> + <!-- Title of the button to install a print service. [CHAR LIMIT=25] --> + <string name="add_print_service_label">Add service</string> + <!-- Add printer dialog --> <!-- Title for the alert dialog for selecting a print service. [CHAR LIMIT=50] --> <string name="choose_print_service">Choose print service</string> - <!-- Title for the button to search the play store for print services. [CHAR LIMIT=50] --> - <string name="search_play_store">Search in play store</string> + <!-- Title for the prompt shown as a placeholder if no printers are found while searching. [CHAR LIMIT=50] --> + <string name="print_no_printers_found">No printers found</string> <!-- Notifications --> diff --git a/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java b/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java index c397c40..c888e2c 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java +++ b/packages/PrintSpooler/src/com/android/printspooler/SelectPrinterFragment.java @@ -92,6 +92,8 @@ public final class SelectPrinterFragment extends ListFragment { public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setListAdapter(new DestinationAdapter()); + View emptyView = getActivity().findViewById(R.id.empty_print_state); + getListView().setEmptyView(emptyView); } @Override @@ -252,7 +254,7 @@ public final class SelectPrinterFragment extends ListFragment { Uri marketUri = Uri.parse(DEFAULT_MARKET_QUERY_STRING); final Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri); if (getActivity().getPackageManager().resolveActivity(marketIntent, 0) != null) { - builder.setPositiveButton(R.string.search_play_store, + builder.setPositiveButton(R.string.add_print_service_label, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { try { |