Android WindowManager position like Facebook Reactions Behavior -
this sequence of question
i'm trying replicate implementation of facebook reactions vertically, answered made windowmanager. i've created layout buttons, set setontouchlistener take motionevent.action_donw, when rviv1 pressed on cardview catch catch event.getrawx , event.getrawy,this code have.
vholder.rviv1.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { int evex =(int) event.getrawx(); int evey =(int) event.getrawy(); int measureheight = (vholder.ivhappy.getmeasuredheight()); if(vholder.mviewexpressions == null) vholder.mviewexpressions = new expressionsview(activity); if (event.getaction() == motionevent.action_down) { log.d("pressed", "button pressed"); /// createfloatview(); if(vholder.mviewexpressions.getwindowtoken() == null){ windowmanager.layoutparams params = new windowmanager.layoutparams( windowmanager.layoutparams.wrap_content, windowmanager.layoutparams.wrap_content, evex, evey, windowmanager.layoutparams.type_system_overlay, 0 | windowmanager.layoutparams.flag_not_focusable, pixelformat.translucent); // params.gravity = gravity.center | gravity.left; /* params.x = evex; params.y = evey; */ wm.addview(vholder.mviewexpressions, params); vholder.isclosed = false; }else{ } } else{ // windowmanager.removeview(vholder.mviewexpressions); if(vholder.mviewexpressions != null && vholder.mviewexpressions.getwindowtoken() != null){ wm.removeview(vholder.mviewexpressions); vholder.isclosed = true; } log.d("released", "button released"); } return true; } });
- i tried positioning v.getx() , y;, event.getrawx , y without luck.
- i have objectanimations in viewexpressions never fired.
- how can pass touchlistener viewexpressions because when try slide finger window closes because in else .
please apreciate help. in advance , sorry bad english.
Comments
Post a Comment