Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Adam Lichwierowicz
Means that I have integrated my image with the activity background image. So I no longer have an imageview in the activity but only the background and I place my progress bar according to the screen dimensions not imageview dimensions. "i think it should just work provided you get the matrix after

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread skink
Serdel wrote: > "i don't think so since this matrix is used internally for drawing the > image - see ImageView.java " > > Well I tried the matrix in onCreated, in onFocusChanged Listener and in > Image view onPreDraw and onGlobalLayout listeners - the point where > calculated exactly as if the bi

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
"i don't think so since this matrix is used internally for drawing the image - see ImageView.java " Well I tried the matrix in onCreated, in onFocusChanged Listener and in Image view onPreDraw and onGlobalLayout listeners - the point where calculated exactly as if the bitmap was not resized and

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Kostya Vasilyev
2012/9/27 Serdel > In both onMeasure, onLayout of these when I set the Layout params to the > progress bar they seem to be ignored (the bar is not displayed at all). > Just 1) measure the children 2) position them. But it seems like I'm missing something. > > skink: your code works but the mat

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread skink
Serdel wrote: > skink: your code works but the matrix seems calculate the points before > resizing the image. > i don't think so since this matrix is used internally for drawing the image - see ImageView.java pskink -- You received this message because you are subscribed to the Google Groups

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
In both onMeasure, onLayout of these when I set the Layout params to the progress bar they seem to be ignored (the bar is not displayed at all). skink: your code works but the matrix seems calculate the points before resizing the image. On Thursday, September 27, 2012 12:22:22 PM UTC+2, Kosty

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Kostya Vasilyev
Yes, there are methods for measuring and positioning views. They are called onMeasure and onLayout, respectively... 2012/9/27 Serdel > I passed my progress bar object to my ImageView subclass but if I set the > layout params on the progress bar object they are not accepted (it is not > displayed

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
I passed my progress bar object to my ImageView subclass but if I set the layout params on the progress bar object they are not accepted (it is not displayed at all). Of course in the xml file my custom image view is under the progress bar so it is not covering it. So even If I do get the correc

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
"onMeasure may be called multiple times, yes." but why once with 480x817(so almost full screen) and 2nd time with 227x481 (the actual size that I want). Moreover I have noticed that it is called multiple times but always with this pair - first with almost fullscreen, 2nd correct. How can I fi

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Kostya Vasilyev
You're calling findViewById() on your image view object, which looks among the view's children. Since the progress bar is not a child of your image view, this returns null. Look in the activity instead, or have the activity provide the progress bar to the image view, or -- that's how I'd do it --

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
Hi Kostya, I am not sure what is complicated here... I just want to place my progress bar in the exact location on my imageview. If do it 'hard coded' so i.e. the image is 200x400 and I place it 50px from left and 100px from bottom than it will be misplaced if the image is resized by android. T

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-26 Thread Kostya Vasilyev
Not sure what your requirements are, but the code below seems way too complicated to me. Subclass ViewGroup, draw the image in onDraw, override onMeasure / onLayout and position the progress bar (or skip the drawing and add an image view as a child... you'd need to position it too...) -- K 2012/

[android-developers] Aligning a view to an ImageView in different resolutions

2012-09-26 Thread Serdel
The problem with properly handling multiple screen sizes on Android has been talked all over thousands of times. However I couldn't find a solution to m problem. In a nutshell I need to align my custom progress bar over an imageView. I've got 3 set of drawables for the imageView - ldpi(scaled fo