Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70b7fd36 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android Git Automerger
Browse files

am bd91ecfa: am 84e95d19: am c2242aac: Merge "Show unavailable printers...

am bd91ecfa: am 84e95d19: am c2242aac: Merge "Show unavailable printers disabled and grayed out." into klp-dev

* commit 'bd91ecfa':
  Show unavailable printers disabled and grayed out.
parents 91adc9ff bd91ecfa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        android:orientation="vertical"
        android:duplicateParentState="true">

        <TextView
            android:id="@+id/title"
+4 −0
Original line number Diff line number Diff line
@@ -555,6 +555,7 @@ public class PrintJobConfigActivity extends Activity {
                // TODO: We need some UI for announcing an error.
                mControllerState = CONTROLLER_STATE_FAILED;
                Log.e(LOG_TAG, "Received invalid pages from the app");
                mEditor.cancel();
                PrintJobConfigActivity.this.finish();
            }
        }
@@ -1152,6 +1153,9 @@ public class PrintJobConfigActivity extends Activity {
                    if (!mFavoritePrinterSelected && mDestinationSpinnerAdapter.getCount() > 2) {
                        mFavoritePrinterSelected = true;
                        mDestinationSpinner.setSelection(0);
                        // Workaround again the weird spinner behavior to notify for selection
                        // change on the next layout pass as the current printer is used below.
                        mCurrentPrinter = (PrinterInfo) mDestinationSpinnerAdapter.getItem(0);
                    }

                    // If there is a next printer to select and we succeed selecting
+8 −0
Original line number Diff line number Diff line
@@ -435,6 +435,8 @@ public final class SelectPrinterFragment extends ListFragment {
                        R.layout.printer_dropdown_item, parent, false);
            }

            convertView.setEnabled(isEnabled(position));

            CharSequence title = null;
            CharSequence subtitle = null;
            Drawable icon = null;
@@ -475,6 +477,12 @@ public final class SelectPrinterFragment extends ListFragment {
            return convertView;
        }

        @Override
        public boolean isEnabled(int position) {
            PrinterInfo printer =  (PrinterInfo) getItem(position);
            return printer.getStatus() != PrinterInfo.STATUS_UNAVAILABLE;
        }

        @Override
        public Loader<List<PrinterInfo>> onCreateLoader(int id, Bundle args) {
            if (id == LOADER_ID_PRINTERS_LOADER) {