Re: [android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-04 Thread limtc
I finally solved my problem in not doing the onTouchEvent on the activity, but on individual views - thus removed the need to check for Action Bar height. Thanks for everybody who helps! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To

Re: [android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread limtc
OK, this is part of my code, very simple: public boolean onTouchEvent(MotionEvent event) { int count = event.getPointerCount(); ... int action = event.getAction(); int x = (int) event.getX(); int y = (int) event.getY() - absize; ... return t

Re: [android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread Dianne Hackborn
What you are claiming is happening is... well, you probably need to explain more. If you have an action bar, then by default your content is placed below it, and the coordinate space of events received by the view will be relative to where it is placed. This is true with all views in the hierarc

Re: [android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread limtc
No it does not - at least this is the result of my test. I got an ICS and a Honeycomb devices - the getY() values are exactly 56 pixels too low when the same app run on them. I have to subtract 56 from the getY() to get the correct position. Same code works fine on 2.x and 1.x device. I am the

Re: [android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread Mark Murphy
On Tue, Jul 3, 2012 at 6:53 PM, limtc wrote: > I am doing a painting program and the MotionEvent getY() returns contains > the height of action bar. I need to subtract the height away. Really? I would expect that the MotionEvent getY() would be with respect to your View that is receiving the touc

Re: [android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread limtc
I am doing a painting program and the MotionEvent getY() returns contains the height of action bar. I need to subtract the height away. Any sample code or help will be appreciated! 在 2012年7月3日星期二UTC+8下午10时58分04秒,Latimerius写道: > > On Tue, Jul 3, 2012 at 4:45 PM, limtc wrote: > > Do you mind sho

Re: [android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread Latimerius
On Tue, Jul 3, 2012 at 4:45 PM, limtc wrote: > Do you mind showing me a sample code on how this is done? (to get the action > bar size) I'm afraid you misunderstand - if you are trying to find out the action bar height just to subtract it from the screen height and see how much space is left for

[android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread limtc
Do you mind showing me a sample code on how this is done? (to get the action bar size) 在 2012年7月3日星期二UTC+8下午9时25分43秒,RichardC写道: > > The action bar can also change size with custom (OEM) themes. So I would > take a different approach and find the size of the usable window left to > your applic

[android-developers] Re: Getting action bar height while minSdkVersion is 7

2012-07-03 Thread RichardC
The action bar can also change size with custom (OEM) themes. So I would take a different approach and find the size of the usable window left to your application. This is just a case of calling getWidth and getHeight on the root object of your view hierarchy. On Tuesday, July 3, 2012 2:12:26