am cbf3f2cd: Merge "Adding an empty state UI for the printer search activity in the spooler." into klp-dev

* commit 'cbf3f2cde569aac3a49d888d2bd52d77dc139738':
  Adding an empty state UI for the printer search activity in the spooler.
This commit is contained in:
Svetoslav
2013-10-01 19:24:31 -07:00
committed by Android Git Automerger
7 changed files with 48 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1042,6 +1042,7 @@
<java-symbol type="drawable" name="ic_text_dot" />
<java-symbol type="drawable" name="ic_print" />
<java-symbol type="drawable" name="ic_print_error" />
<java-symbol type="drawable" name="ic_grayedout_printer" />
<java-symbol type="drawable" name="indicator_code_lock_drag_direction_green_up" />
<java-symbol type="drawable" name="indicator_code_lock_drag_direction_red_up" />
<java-symbol type="drawable" name="indicator_code_lock_point_area_default_holo" />

View File

@@ -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>
<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>

View File

@@ -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 -->

View File

@@ -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 {