package Ġcom . e ag les ak ura . ar my knife . android . extensions Ċ Ċ import Ġandroid . graphics . Rect Ċ import Ġandroid . view . View Ċ Ċ /** Ċ Ġ* ĠThis Ġmethod Ġreturns Ġabsolute Ġview Ġarea Ġof ĠAndroid Ġdevice Ġdisplay . Ċ Ġ* Ċ Ġ* Ġ@ author Ġ@ e ag les ak ura Ċ Ġ* Ġ@ link Ġhttps :// github . com / e ag les ak ura / ar my - knife Ċ Ġ*/ Ċ fun ĠView . get Screen Area (): ĠRect Ġ{ ĊĠĠĠ Ġval Ġarea Ġ= ĠRect () ĊĊĠĠĠ Ġval Ġview In Window Ġ= ĠInt Array ( 2 ) ĊĠĠĠ Ġval Ġview On Screen Ġ= ĠInt Array ( 2 ) ĊĠĠĠ Ġval Ġwindow On Screen Ġ= ĠInt Array ( 2 ) ĊĊĠĠĠ Ġget Location In Window ( view In Window ) ĊĠĠĠ Ġget Location On Screen ( view On Screen ) ĊĠĠĠ Ġwindow On Screen [ 0 ] Ġ= Ġview On Screen [ 0 ] Ġ- Ġview In Window [ 0 ] ĊĠĠĠ Ġwindow On Screen [ 1 ] Ġ= Ġview On Screen [ 1 ] Ġ- Ġview In Window [ 1 ] ĊĊĠĠĠ Ġget Global Visible Rect ( area ) ĊĠĠĠ Ġarea . offset ( window On Screen [ 0 ], Ġwindow On Screen [ 1 ]) ĊĠĠĠ Ġreturn Ġarea Ċ } Ċ Ċ /** Ċ Ġ* ĠThis Ġmethod Ġreturns Ġrelative Ġview Ġarea Ġof ĠApplication Ġwindow . Ċ Ġ* Ċ Ġ* Ġ@ author Ġ@ e ag les ak ura Ċ Ġ* Ġ@ link Ġhttps :// github . com / e ag les ak ura / ar my - knife Ċ Ġ*/ Ċ fun ĠView . getWindow Area (): ĠRect Ġ{ ĊĠĠĠ Ġval Ġxy Ġ= ĠInt Array ( 2 ) ĊĠĠĠ Ġget Location In Window ( xy ) ĊĠĠĠ Ġreturn ĠRect ( xy [ 0 ], Ġxy [ 1 ], Ġxy [ 0 ] Ġ+ Ġwidth , Ġxy [ 1 ] Ġ+ Ġheight ) Ċ }