Re: [android-developers] Layouts - Using Remaining Space For Intermediate View

2012-05-01 Thread Jason Teagle
The gravity should be set on the LinearLayout.LayoutParams instead. Ahhh... yes, that fixed it. I misread the function and thought it applied to the View / Widget it was being called on. My bad. *Now* I'm in business - thanks! -- You received this message because you are subscribed to the G

Re: [android-developers] Layouts - Using Remaining Space For Intermediate View

2012-05-01 Thread Romain Guy
The gravity should be set on the LinearLayout.LayoutParams instead. You could also set it on rootContainer. When you call LinearLayout.setGravity(), gravity applies to the children of the LinearLayout. If you set the gravity on the LayoutParams, gravity is applied by the parent on the child the Lay

Re: [android-developers] Layouts - Using Remaining Space For Intermediate View

2012-05-01 Thread Jason Teagle
Could you use a LinearLayout and set the layout_weight of each custom view to 1? Hmmm... yes, good call, but there's a slight twist. It seems that gravity doesn't work in LinearLayout. Consider the following code (in onCreate() ): --- super.onCreate(savedInstanceState); // Create the root co

Re: [android-developers] Layouts - Using Remaining Space For Intermediate View

2012-04-30 Thread Erik
Could you use a LinearLayout and set the layout_weight of each custom view to 1? -Erik On Monday, April 30, 2012 4:10:33 AM UTC-7, JTeagle wrote: > > >This should work so long as Widget 1 and Widget 3 have knowable > >heights (e.g., Button, not ListView) and there is still room on the > >screen

Re: [android-developers] Layouts - Using Remaining Space For Intermediate View

2012-04-30 Thread Mark Murphy
On Mon, Apr 30, 2012 at 7:10 AM, JTeagle wrote: > Consider the following revised example: > > > Widget 1 - natural height > Custom View A - largest height possible > Widget 2 - natural height > Custom View B - largest height possible > > Widget 3 - natural height > Custom View C - largest height p

Re: [android-developers] Layouts - Using Remaining Space For Intermediate View

2012-04-30 Thread JTeagle
>This should work so long as Widget 1 and Widget 3 have knowable >heights (e.g., Button, not ListView) and there is still room on the >screen for Widget 2. Thanks for this. I see where you're going with it, but unfortunately that won't help my situation - and that's my fault for not making my exa

Re: [android-developers] Layouts - Using Remaining Space For Intermediate View

2012-04-30 Thread Mark Murphy
On Sun, Apr 29, 2012 at 5:42 AM, JTeagle wrote: > I'm using RelativeLayout to create rows of controls and would like to > achieve the following: > >     Widget 1 - natural height >     Custom view - remaining space after Widgets 1 and 3 >     Widget 3 - natural height Widget 1 has android:alignPa

[android-developers] Layouts - Using Remaining Space For Intermediate View

2012-04-30 Thread JTeagle
I'm using RelativeLayout to create rows of controls and would like to achieve the following: Widget 1 - natural height Custom view - remaining space after Widgets 1 and 3 Widget 3 - natural height If I add the view in the correct order and use FILL_PARENT, it uses the remainin