java - Delay in view setvisibilty to complete -


i trying create custom view , unlike button user.

enter image description here

if swipe l-> r , reveals button , swiping r->l reveals unlike button.

since clicking on top of view triggering click on buttons underneath, have make button invisible if not being shown.

i using custom gesture detector detecting scroll , moves top view reveal buttons underneath.

 private handler setlikewrappervisibility = new handler(new handler.callback() {         @override         public boolean handlemessage(message msg) {         //    log.i(tag, "likewrapper: " + (msg.what == visible ? "visible" : "invisible"));             likewrapper.setvisibility(msg.what);             return true;         }     }); 

in custom gesture detector.

@override         public boolean onscroll(motionevent e1, motionevent e2, float distancex, float distancey) {             move(distancex);             if (isleftopen() > 0) {                 if (dislikewrapper.getvisibility() == visible)                     setdislikewrappervisibility.sendemptymessage(invisible);                 if (likewrapper.getvisibility() == invisible) {                     setlikewrappervisibility.sendemptymessage(visible);                 }             } else if (isrightopen() > 0) {                 if (likewrapper.getvisibility() == visible)                     setlikewrappervisibility.sendemptymessage(invisible);                 if (dislikewrapper.getvisibility() == invisible)                     setdislikewrappervisibility.sendemptymessage(visible);             }             return true;         } 

but there delay happening when button's visibility changes view.visible (may 500ms). when top view moves side. button underneath in not appearing.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -