android - Show a view when keyboard hides and vice versa -


below app looks like. messaging app.

enter image description here

there 2 fragments in 1 screen fragment1 (beige color) , fragment2 (dark grey color). edittext , "+" button inside fragment2. fragment1, edittext , + button visible.

  1. when click on edittext, keyboard comes up, , edittext , + button comes above keyboard.

  2. when click on + button layout2 of fragment2 visible , keyboard hides if visible.

  3. if click on edittext , layout2 visible layout2 hides , keyboard comes up.

now problem switching keyboard layout2 , vice versa not smooth. screen kinda flickers. want is:

  1. if keyboard visible , click + button, edittext , + button should stay there, keyboard should go down , layout2 should come up.

  2. if layout2 visible , click on edittext, there 2 possibilities.

    a. either edittext , + button should stay there, layout2 should go down , keyboard should come smoothly.

    b. or edittext, + button should stay there, keyboard should come , layout should go down after.

my user experience kinda bad these jerks , flickers. please me out in implementing smooth transition.

you can solve problem :

layout2.setvisibility(view.gone);   edittext.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v) {                 if(booleanisclicked){                   layout2.setvisibility(view.visible);                 }             }         }); 

or

edittext.setonfocuschangelistener(.....   layout2.setvisibility(view.visible);  .) 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -