Merge "Sometimes the print button not enabled and an accessibility fix." into klp-dev
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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,11 +274,13 @@ public final class SelectPrinterFragment extends ListFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void announceSearchResult() {
|
||||
if (mAnnounceFilterResult == null) {
|
||||
mAnnounceFilterResult = new AnnounceFilterResult();
|
||||
private void announceSearchResultIfNeeded() {
|
||||
if (AccessibilityManager.getInstance(getActivity()).isEnabled()) {
|
||||
if (mAnnounceFilterResult == null) {
|
||||
mAnnounceFilterResult = new AnnounceFilterResult();
|
||||
}
|
||||
mAnnounceFilterResult.post();
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user