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

Commit 8907f66c authored by Daisuke Miyakawa's avatar Daisuke Miyakawa
Browse files

Let tts speak "not found" when contacts are not found

- manually send accessibility event for it
- make the whole header view hierarchy visible before sending
  the event
-- The view must be visble to let tts speak what we want

Bug: 5255056
Change-Id: I79d7615d9677364a26a12701454ccc5399541de9
parent ea0a8a2f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ListView;
@@ -207,14 +208,15 @@ public class DefaultContactBrowseListFragment extends ContactBrowseListFragment
                        R.id.totalContactsText);
                ProgressBar progress = (ProgressBar) mSearchHeaderView.findViewById(
                        R.id.progress);
                mSearchHeaderView.setVisibility(View.VISIBLE);
                if (adapter.isLoading()) {
                    textView.setText(R.string.search_results_searching);
                    progress.setVisibility(View.VISIBLE);
                } else {
                    textView.setText(R.string.listFoundAllContactsZero);
                    textView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
                    progress.setVisibility(View.GONE);
                }
                mSearchHeaderView.setVisibility(View.VISIBLE);
            }
            showEmptyUserProfile(false);
        }