android - Show a view when keyboard hides and vice versa -
below app looks like. messaging app.
there 2 fragments in 1 screen fragment1 (beige color) , fragment2 (dark grey color). edittext , "+" button inside fragment2. fragment1, edittext , + button visible.
when click on edittext, keyboard comes up, , edittext , + button comes above keyboard.
when click on + button layout2 of fragment2 visible , keyboard hides if visible.
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:
if keyboard visible , click + button, edittext , + button should stay there, keyboard should go down , layout2 should come up.
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
Post a Comment