java - Detect for fullscreen from a service in android -


i creating color picking feature able pick color anywhere on android screen.

i able pick color accurately when app gets full screen, calculations have account system ui's height calculation.

if (fullscreenstate == true)     ycoord = ycoord + statusheight;  int pixel = screen.getpixel(xcoord ,ycoord); log.d("pixel color", "pixel color: + " + integer.tohexstring(pixel) + " @ x:" + xcoord + " y:" + ycoord); 

you need add transparent view window manager, 1px width , match_parent height. then, add global layout listener view, , every time there's change on layout, check position of view on screen. if it's y 0, status bar not visible, full screen app must running.


Comments

Popular posts from this blog

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

reactjs - React router and this.props.children - how to pass state to this.props.children -

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