Cleaned up content descriptions and added the last missing ones. Closes #122
This commit is contained in:
parent
ea7f666062
commit
3bf84f9b7d
5 changed files with 40 additions and 16 deletions
|
@ -26,7 +26,9 @@ import android.os.Bundle;
|
|||
import android.os.PersistableBundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
|
@ -314,6 +316,23 @@ public class MainActivity extends BaseActivity {
|
|||
private void setupSearchView() {
|
||||
searchView.attachNavigationDrawerToMenuButton(drawer.getDrawerLayout());
|
||||
|
||||
// Setup content descriptions for the different elements in the search view.
|
||||
final View leftAction = searchView.findViewById(R.id.left_action);
|
||||
leftAction.setContentDescription(getString(R.string.action_open_drawer));
|
||||
searchView.setOnFocusChangeListener(new FloatingSearchView.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocus() {
|
||||
leftAction.setContentDescription(getString(R.string.action_close));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFocusCleared() {
|
||||
leftAction.setContentDescription(getString(R.string.action_open_drawer));
|
||||
}
|
||||
});
|
||||
View clearButton = searchView.findViewById(R.id.clear_btn);
|
||||
clearButton.setContentDescription(getString(R.string.action_clear));
|
||||
|
||||
searchView.setOnQueryChangeListener(new FloatingSearchView.OnQueryChangeListener() {
|
||||
@Override
|
||||
public void onSearchTextChanged(String oldQuery, String newQuery) {
|
||||
|
|
|
@ -203,7 +203,7 @@ public class TimelineFragment extends SFragment implements
|
|||
}
|
||||
|
||||
private boolean followButtonPresent() {
|
||||
return kind != Kind.TAG && kind != Kind.FAVOURITES;
|
||||
return kind != Kind.TAG && kind != Kind.FAVOURITES && kind != Kind.USER;
|
||||
}
|
||||
|
||||
private void jumpToTop() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue