0

I want to make an editable layout in android where the edit option and keyboard opens up only when the user does a double tap on the box, so that the screen remains readable and keyboard comes up only when needed.

bork
  • 1,556
  • 4
  • 21
  • 42

2 Answers2

0

I'm not quite sure why a normal single tap won't suffice, but you might want to check out this answer to a similar question.

Community
  • 1
  • 1
bork
  • 1,556
  • 4
  • 21
  • 42
0

to give you a basic idea:

1) Create your own GestureDetector as described in many answers, for example here

2) Set an OnTouchListener for your View and check for the onTouchEvent() method result. Return true from onTouch() to prevent the system from showing the keyboard on EditText single tap.

3) Use the InputMethodManager to show/hide the soft keyboard as needed.

Community
  • 1
  • 1
Droidman
  • 11,485
  • 17
  • 93
  • 141