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

Commit b07c4e72 authored by calderwoodra's avatar calderwoodra Committed by android-build-merger
Browse files

Merge "Fixed some a11y issues in MainActivity."

am: 1d9fccf0

Change-Id: I56bb30e3f2203e3c947cd569dce93716916f2190
parents a699ecad 1d9fccf0
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -128,7 +128,9 @@ public class MainSearchController implements SearchBarListener {
      // TODO(a bug): zero suggest results aren't actually shown but this enabled the nearby
      // places promo to be shown.
      searchFragment = NewSearchFragment.newInstance(/* showZeroSuggest=*/ true);
      transaction.add(R.id.fragment_container, searchFragment, SEARCH_FRAGMENT_TAG);
      transaction.replace(R.id.fragment_container, searchFragment, SEARCH_FRAGMENT_TAG);
      transaction.addToBackStack(null);
      transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    } else if (!isSearchVisible()) {
      transaction.show(searchFragment);
    }
@@ -287,11 +289,20 @@ public class MainSearchController implements SearchBarListener {
    showBottomNav();
    toolbar.collapse(animate);
    toolbarShadow.setVisibility(View.GONE);
    mainActivity.getFragmentManager().beginTransaction().remove(getSearchFragment()).commit();
    mainActivity.getFragmentManager().popBackStack();

    // Clear the dialpad so the phone number isn't persisted between search sessions.
    if (getDialpadFragment() != null) {
      getDialpadFragment().clearDialpad();
    DialpadFragment dialpadFragment = getDialpadFragment();
    if (dialpadFragment != null) {
      // Temporarily disable accessibility when we clear the dialpad, since it should be
      // invisible and should not announce anything.
      dialpadFragment
          .getDigitsWidget()
          .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
      dialpadFragment.clearDialpad();
      dialpadFragment
          .getDigitsWidget()
          .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
    }

    notifyListenersOnSearchClose();
@@ -355,7 +366,9 @@ public class MainSearchController implements SearchBarListener {
      // TODO(a bug): zero suggest results aren't actually shown but this enabled the nearby
      // places promo to be shown.
      searchFragment = NewSearchFragment.newInstance(true);
      transaction.add(R.id.fragment_container, searchFragment, SEARCH_FRAGMENT_TAG);
      transaction.replace(R.id.fragment_container, searchFragment, SEARCH_FRAGMENT_TAG);
      transaction.addToBackStack(null);
      transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    } else if (!isSearchVisible()) {
      transaction.show(getSearchFragment());
    }
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
        android:layout_margin="16dp"
        android:layout_gravity="end|bottom"
        android:src="@drawable/quantum_ic_dialpad_white_24"
        android:contentDescription="@string/dialpad_button_content_description"
        app:backgroundTint="?android:attr/colorAccent"/>
  </android.support.design.widget.CoordinatorLayout>

+4 −0
Original line number Diff line number Diff line
@@ -40,4 +40,8 @@

  <!-- Message displayed when there is no application available to handle voice search. [CHAR LIMIT=NONE] -->
  <string name="voice_search_not_available">Voice search not available</string>

  <!-- Content description for the button that displays the dialpad
       [CHAR LIMIT=NONE] -->
  <string name="dialpad_button_content_description">key pad</string>
</resources>