1

I'm working on a project for blind people, there're a lot of troubles I need to fix if the user activates TalkBalk on his phone.

I'm creating a soft keyboard for blind people, the blind will tap with single finger on the circles "Braille Cell Dots" to generate a Braille code, then he types the character/number/symbols he wants as they presented in Braille language.

My problem now is Touch To Explore feature of TalkBack, the user will not be able to make a single tap on the screen because this action now handled by TalkBack, the user must double tap on the dot and this is not good for my app!

How to generate a single tap even if Touch to Explore feature is enabled in TalkBack?

Mohammed AlBanna
  • 2,350
  • 22
  • 25

2 Answers2

2

Based on this answer which has solved my problem, as the single touch event converted to hover event if touch to explore is enabled, I've added onHoverEvent to call onTouchEvent and works fine:

@Override
public boolean onHoverEvent(MotionEvent event) {
    //Move AccessibilityManager object to the constructor 
    AccessibilityManager am = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (am.isTouchExplorationEnabled()) {
        return onTouchEvent(event);
    } else {
        return super.onHoverEvent(event);
    }
}

And handle hover action to onTouchEvent:

@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
    case MotionEvent.ACTION_DOWN:
    case MotionEvent.ACTION_HOVER_ENTER:
    //Your Code
    break;
    case MotionEvent.ACTION_MOVE:
    case MotionEvent.ACTION_HOVER_MOVE:
    //Your Code
    break;
    case MotionEvent.ACTION_UP:
    case MotionEvent.ACTION_HOVER_EXIT:
    //Your Code
    break;    

}

return true;
}

I'll edit my question to be more cleaner :)

Community
  • 1
  • 1
Mohammed AlBanna
  • 2,350
  • 22
  • 25
1

You don't. It's a terrible idea. Come up with gestures and mechanisms that fit within what TalkBack allows. If you could annotate a specific feature or mechanism of your app that is not allowed to work with talkback, I could recommend an alternative. What gesture is it that's not working?

MobA11y
  • 18,425
  • 3
  • 49
  • 76
  • 1
    Well, I would appreciate any other suggestions regarding to TalkBalk! The user should be able to tap in one finger on specific areas in the screen, there's also swipe up to bottom and bottom to up with one finger, my problem with just one finger. I use two fingers gesture and it works fine with needed situation. How can I apply one tap with Touch to Explore feature? How it works in lock screen, which I can tap with one finger and the numbers get entered? I can test if any accessibility service is active or the touchToExplore is active too. – Mohammed AlBanna Feb 03 '16 at 19:53
  • Your English is somewhat broken. So bare with me, I'm trying to understand your requirements, and it is difficult. Can you direct me to a feature in another app (or your open source, or minimalist reproduction) to show me specifically what issure you are having. It's actually very difficult to create a gesture that TalkBack doesn't have an alternative for. Unless you're dealing with custom gesture recognizers, it is most likely you just don't know how to use TalkBack, and not an actual issue with your code. – MobA11y Feb 03 '16 at 19:56
  • 1
    Sorry for that. I'll explain to you my project idea. It's basically a soft keyboard will be shown to the blind user when they entered any EditText, he can type with Braille language on that keyboard. The keyboard is just a blank white screen with 6 dots (circles), if the user types the correct dots which is equal to Braille code, the user will got the character/number/symbols committed in that EditText. The problem is tapping on the correct dots with one finger and Touch to Explore is active. I'm providing also gesture using one finger in the middle of the screen to generate specific actions. – Mohammed AlBanna Feb 03 '16 at 20:04
  • Blind people are going to have a very difficult time interacting with your keyboard in this way. That's why TalkBack has the single tap to highlight, double tap to select mechanism. You should design your app to work within these mechanisms. Conveniently, this requires no extra work from you. – MobA11y Feb 03 '16 at 20:33
  • That's why I asked this question here to get more suggestions about that. I think the only thing we have here is handling the accessibility services events and generate the same actions as the TalkBack is off. Thanks for your time :) – Mohammed AlBanna Feb 03 '16 at 21:04
  • Are you staying you're trying to replicate TalkBack behavior, even if TalkBack is off? Cuz, that was never mentioned... – MobA11y Feb 03 '16 at 21:11
  • Not replicated, I was thinking to make another behavior if the TalkBack is ON, like replacing one tap or swipe up/bottom with one finger to another behavior like using two fingers. I'll see all TalkBack gestures to avoid them in my app. Do you've any other ideas? – Mohammed AlBanna Feb 03 '16 at 22:07
  • I'll give this a try, seems to be like what I'm looking for: http://stackoverflow.com/a/14988636/2813238 – Mohammed AlBanna Feb 03 '16 at 22:11
  • 1
    There is a major problem with this approach. The question posted on this link is a drawing app. You literally cannot draw with TalkBack gestures, so you must circumvent it. There is nothing about your problem that doesn't fit into TalkBack's user interface expectations. Circumventing TalkBack in this scenario, is just creating a non-intuitive user experience, and potentially breaking accessibility completely. Glad you understand the tech, but I encourage you to figure out a user experience that just works with TalkBack in the standard way. – MobA11y Feb 04 '16 at 14:55
  • 1
    I admit that I didn't describe my problem very well, my problem was just in touch events, not gestures which are inconsistent with TalkBack...I thought the one touch/tap on the screen called gesture too. My problem was in just one tap if the TalkBack and touch to explore is activated. I think this is my fault, that's why I edited my question to be more cleaner. Sorry for that. – Mohammed AlBanna Feb 04 '16 at 15:12