Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide view when showing keyboard

I have two EditText views and one ImageView. My goal is to hide the ImageView when i am showing the keyboard (When the user have clicked on one of the EditText fields)

Then show the imageView again when the user have unfocused the EditText field or the keyboard is not visible anymore.

I have tried tons of different ways to do this. But nothing really works as intended. Do you guys have any idea how i could achieve this

like image 677
Jemil Riahi Avatar asked Nov 26 '22 20:11

Jemil Riahi


1 Answers

Have you tried to detect if the keyboard is opened ? How do I Detect if Software Keyboard is Visible on Android Device?

Make debug and when is opened try to hide image . imageview.setvisibility (GONE) if it does not work you can try to change layout

Make 2 layouts and switch visibility if the keyboard is open /closed

like image 141
Raluca Lucaci Avatar answered Dec 15 '22 10:12

Raluca Lucaci