Quick action button accessibility fix

This commit is contained in:
Igor B. Poretsky 2017-05-10 22:42:55 +03:00 committed by Alexey Kulish
parent a753a285d0
commit a5163938c8
2 changed files with 4 additions and 2 deletions

View file

@ -16,7 +16,7 @@
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_circle_blue" android:background="@drawable/btn_circle_blue"
android:contentDescription="@string/zoomIn" android:contentDescription="@string/configure_screen_quick_action"
android:layout_gravity="bottom|right" android:layout_gravity="bottom|right"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" tools:visibility="visible"

View file

@ -74,6 +74,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
setQuickActionButtonMargin(); setQuickActionButtonMargin();
isLayerOn = quickActionRegistry.isQuickActionOn(); isLayerOn = quickActionRegistry.isQuickActionOn();
quickActionButton.setImageResource(R.drawable.map_quick_action); quickActionButton.setImageResource(R.drawable.map_quick_action);
quickActionButton.setContentDescription(mapActivity.getString(R.string.configure_screen_quick_action));
quickActionButton.setOnClickListener(new View.OnClickListener() { quickActionButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -114,7 +115,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
} }
private boolean showTutorialIfNeeded() { private boolean showTutorialIfNeeded() {
if (isLayerOn && !settings.IS_QUICK_ACTION_TUTORIAL_SHOWN.get() && android.os.Build.VERSION.SDK_INT >= 14) { if (isLayerOn && !app.accessibilityEnabled() && !settings.IS_QUICK_ACTION_TUTORIAL_SHOWN.get() && android.os.Build.VERSION.SDK_INT >= 14) {
TapTargetView.showFor(mapActivity, // `this` is an Activity TapTargetView.showFor(mapActivity, // `this` is an Activity
TapTarget.forView(quickActionButton, mapActivity.getString(R.string.quick_action_btn_tutorial_title), mapActivity.getString(R.string.quick_action_btn_tutorial_descr)) TapTarget.forView(quickActionButton, mapActivity.getString(R.string.quick_action_btn_tutorial_title), mapActivity.getString(R.string.quick_action_btn_tutorial_descr))
// All options below are optional // All options below are optional
@ -180,6 +181,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
return false; return false;
quickActionButton.setImageResource(isClosed ? R.drawable.map_quick_action : R.drawable.map_action_cancel); quickActionButton.setImageResource(isClosed ? R.drawable.map_quick_action : R.drawable.map_action_cancel);
quickActionButton.setContentDescription(mapActivity.getString(isClosed ? R.string.configure_screen_quick_action : R.string.shared_string_cancel));
quickActionsWidget.setVisibility(isClosed ? View.GONE : View.VISIBLE); quickActionsWidget.setVisibility(isClosed ? View.GONE : View.VISIBLE);
if (isClosed) { if (isClosed) {