[android-developers] Re: I want to know a button's width before it is drawn on the screen! possible?

2008-10-02 Thread erkenbrandroid
Oh yes you're totally right! I just read the documentation for it! :-) Thanks again! Erken On Oct 1, 5:24 pm, Romain Guy [EMAIL PROTECTED] wrote: onWindowFocusedChange works but its pure chance. As I said, you should use the ViewTreeObserver, that's what it's meant for. On Wed, Oct 1,

[android-developers] Re: I want to know a button's width before it is drawn on the screen! possible?

2008-10-01 Thread erkenbrandroid
Did it! Thanks Romain! :) For other people having the same trouble, the trick is to use the onWindowFocusChanged(boolean hasWindowFocus) class like in this example : public void onWindowFocusChanged(boolean hasWindowFocus) { int maxButton; // I save the biggest button width in this variable

[android-developers] Re: I want to know a button's width before it is drawn on the screen! possible?

2008-10-01 Thread Romain Guy
onWindowFocusedChange works but its pure chance. As I said, you should use the ViewTreeObserver, that's what it's meant for. On Wed, Oct 1, 2008 at 2:32 AM, erkenbrandroid [EMAIL PROTECTED] wrote: Did it! Thanks Romain! :) For other people having the same trouble, the trick is to use the

[android-developers] Re: I want to know a button's width before it is drawn on the screen! possible?

2008-09-26 Thread Romain Guy
Hi, You can use a ViewTreeObserver. Look at the documentation of the android.view.View class for more information. On Sep 26, 2008 10:42 AM, erkenbrandroid [EMAIL PROTECTED] wrote: Hello everyone! I need a bit of help for an app I am trying to develop. I've got a main screen with a couple