If you've got a view (any view) within your activity's content, you can call:
view.getWindowVisibleDisplayFrame http://developer.android.com/reference/android/view/View.html#getWindowVisibleDisplayFrame(android.graphics.Rect) >>> Retrieve the overall visible display size in which the window this view is attached to has been positioned in. This takes into account screen decorations above the window, for both cases where the window itself is being position inside of them or the window is being placed under then and covered insets are used for the window to position its content inside. In effect, this tells you the available area where content can be placed and remain visible to users. <<< -- K 2012/9/12 hwrdprkns <[email protected]> > That is not the case. If I draw my view the status bar can > sometimes obscure it if I dont' set the right height. > > Furthermore, there are some tablets where the status bar is at the top, > and some tablets where it isn't. So I need to find a way not only to get > the height of the status bar, but a way to determine *where *on the > screen it is as well. > > > On Wednesday, September 12, 2012 4:35:30 AM UTC-7, RichardC wrote: > >> I don't understand why you need to offset your view. Doesn't your view >> automatically fill the available space and not overlap any other >> view/widget? >> >> If it does please could you explain in more detail what you have done. >> >> On Wednesday, September 12, 2012 12:25:53 PM UTC+1, hwrdprkns wrote: >>> >>> Greetings, >>> >>> I'm using DecorView to insert my own sliding menu (like Facebook, >>> Spotify, etc) but I'm wondering if its possible to tell where the status >>> bar is, as I need to offset my view appropriately. For example, on tablets >>> the status bar is *usually * at the bottom, except on the Nexus 7 where >>> it's at the top. Rather than writing device-specific code, I was wondering >>> if anyone would be able to tell me a general method by which I can tell if >>> the status bar is at the top or bottom of the window. >>> >> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

