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

Commit 6f71ed5b authored by Svetoslav's avatar Svetoslav Committed by Android (Google) Code Review
Browse files

Merge "Sometimes the print button not enabled and an accessibility fix." into klp-dev

parents 0ea16e9e ebec4684
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -456,6 +456,7 @@ public class PrintJobConfigActivity extends Activity {
                // Then update the print jobs's pages as we will not do a write
                // and we usually update the pages in the write complete callback.
                updatePrintJobPages(mDocument.pages, mRequestedPages);
                mEditor.updateUi();
                if (mEditor.isDone()) {
                    requestCreatePdfFileOrFinish();
                }
+15 −5
Original line number Diff line number Diff line
@@ -167,6 +167,14 @@ public final class SelectPrinterFragment extends ListFragment {
        super.onResume();
    }

    @Override
    public void onPause() {
        if (mAnnounceFilterResult != null) {
            mAnnounceFilterResult.remove();
        }
        super.onPause();
    }

    @Override
    public void onListItemClick(ListView list, View view, int position, long id) {
        PrinterInfo printer = (PrinterInfo) list.getAdapter().getItem(position);
@@ -266,12 +274,14 @@ public final class SelectPrinterFragment extends ListFragment {
        }
    }

    private void announceSearchResult() {
    private void announceSearchResultIfNeeded() {
        if (AccessibilityManager.getInstance(getActivity()).isEnabled()) {
            if (mAnnounceFilterResult == null) {
                mAnnounceFilterResult = new AnnounceFilterResult();
            }
            mAnnounceFilterResult.post();
        }
    }

    public static class AddPrinterAlertDialogFragment extends DialogFragment {

@@ -397,7 +407,7 @@ public final class SelectPrinterFragment extends ListFragment {
                        resultCountChanged = (oldPrinterCount != mFilteredPrinters.size());
                    }
                    if (resultCountChanged) {
                        announceSearchResult();
                        announceSearchResultIfNeeded();
                    }
                    notifyDataSetChanged();
                }