2

I'm implementing a recyclerview where the user can swipe left to remove the item from the list.

I want my app accessible and I want to know if its possible to announce in Talkback somehow to the user that he needs to swipe and also I want to know as well if I can catch this swipe gesture.

To implement the swipe gesture, I created a custom ItemTouchHelper.SimpleCallback (SwipeToRemoveCallback) this way:

 ItemTouchHelper.SimpleCallback swipeToRemoveCallback = new SwipeToRemoveCallback(this);
    ItemTouchHelper itemTouchHelper = new ItemTouchHelper(swipeToRemoveCallback);
    itemTouchHelper.attachToRecyclerView(binding.listState.myShoppingList);

I know that IOS can announce an action to the users. Is possible to do something like that in Android?

Thanks in advance,

Pedro

Gautam Surani
  • 1,136
  • 10
  • 21

1 Answers1

0

Android also has a way to announce events for accessibility

view.announceForAccessibility("Item removed");
JustinMorris
  • 7,259
  • 3
  • 30
  • 36
  • It's not the same. I want to give the blind user an option equivalent to the swipe gesture to the not blind users if possible. It's almost impossible that the blind user swipe on the area that he needs to do it – Pedro Millán Reyes Aug 16 '18 at 14:10
  • It is cumbersome but swipe gestures can be handled with two finger swipes.. because talkback intercepts the first finger. You will need to announce to the user how to swipe to delete also. – JustinMorris Aug 16 '18 at 14:16
  • there are no other interactions you can do to make it easier on a blind person, you would need to have an alternative way to delete the item via a button or something similar. – JustinMorris Aug 16 '18 at 14:23
  • you can detect when Talkback is running and add a delete button only then. – JustinMorris Aug 16 '18 at 14:24
  • https://stackoverflow.com/questions/5116867/how-to-know-if-android-talkback-is-active – JustinMorris Aug 16 '18 at 14:26
  • Thanks @JustinMorris! I think that is the best solution and I will implement that :) – Pedro Millán Reyes Aug 21 '18 at 10:58