Accessibility improvements (part 2)

This commit is contained in:
Jakob Nixdorf 2020-06-19 07:02:21 +02:00
parent 3440f93ab4
commit 5dca0b41f0
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
2 changed files with 20 additions and 0 deletions

View file

@ -208,6 +208,8 @@ public class MainActivity extends BaseActivity
speedDial = findViewById(R.id.speedDial); speedDial = findViewById(R.id.speedDial);
speedDial.inflate(R.menu.menu_fab); speedDial.inflate(R.menu.menu_fab);
speedDial.getMainFab().setContentDescription(getString(R.string.button_add));
speedDial.setOnActionSelectedListener(new SpeedDialView.OnActionSelectedListener() { speedDial.setOnActionSelectedListener(new SpeedDialView.OnActionSelectedListener() {
@Override @Override
public boolean onActionSelected(SpeedDialActionItem speedDialActionItem) { public boolean onActionSelected(SpeedDialActionItem speedDialActionItem) {
@ -227,6 +229,22 @@ public class MainActivity extends BaseActivity
} }
}); });
speedDial.setOnChangeListener(new SpeedDialView.OnChangeListener() {
@Override
public boolean onMainActionSelected() {
return false;
}
@Override
public void onToggleChanged(boolean isOpen) {
if (isOpen) {
speedDial.getMainFab().setContentDescription(getString(R.string.button_close_menu));
} else {
speedDial.getMainFab().setContentDescription(getString(R.string.button_add));
}
}
});
final ProgressBar progressBar = findViewById(R.id.progressBar); final ProgressBar progressBar = findViewById(R.id.progressBar);
progressBar.setVisibility(settings.isHideGlobalTimeoutEnabled() ? View.GONE : View.VISIBLE); progressBar.setVisibility(settings.isHideGlobalTimeoutEnabled() ? View.GONE : View.VISIBLE);

View file

@ -62,6 +62,8 @@
<string name="button_card_options_format">More options for %1$s</string> <string name="button_card_options_format">More options for %1$s</string>
<string name="button_card_copy">Copy token</string> <string name="button_card_copy">Copy token</string>
<string name="button_card_copy_format">Copy %1$s token</string> <string name="button_card_copy_format">Copy %1$s token</string>
<string name="button_add">Add new account</string>
<string name="button_close_menu">Close menu</string>
<!-- Toast messages --> <!-- Toast messages -->
<string name="toast_auth_failed">Authentication failed, please try again!</string> <string name="toast_auth_failed">Authentication failed, please try again!</string>