android - Showing a view in WindowManager that can come from "out of screen" -


i'm having following issue - i'm having view i'm putting inside windowmanager , come in translate animation out of screen , toward middle of screen.

unfortunately, no matter view sticks axis.

this code:

    view = (framelayout) layoutinflater.from(this).inflate(             r.layout.poke, null);      final windowmanager.layoutparams params = new windowmanager.layoutparams(             300, 400, windowmanager.layoutparams.type_phone,             windowmanager.layoutparams.flag_not_focusable,             pixelformat.translucent);      params.verticalmargin = -10f;     params.gravity = gravity.top;      windowmanager.addview(view, params); 

as can see tried playing margin (put there minus make go up).

by way - know it's ugly put numbers , not dp in dimen.xml. test code..

i faced same issue , actual flag is:

windowmanager.layoutparams.flag_layout_no_limits 

so code should like:

final windowmanager.layoutparams params = new windowmanager.layoutparams(         300, 400, windowmanager.layoutparams.type_phone,         windowmanager.layoutparams.flag_not_focusable | windowmanager.layoutparams.flag_layout_no_limits,         pixelformat.translucent); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -