Hi all!
The best way to ask this question is to provide an example, so here it is:
<ScrollView>
<LinearLayout
android:id="@+id/main"
android:orientation="vertical"
>
<TextView
android:id="@+id/some_text"
/>
<LinearLayout
android:id="@+id/stretch_me"
/>
<Button
android:id="@+id/i_can_toggle"
/>
<TextView
android:id="@+id/toggle_me"
android:visibility="gone"
/>
<Button
android:id="@+id/finished"
/>
</LinearLayout>
</ScrollView>
This seems fairly simple, but hold on ...
1) I would like the stretch_me layout to take all the remaining space on the screen (and I need its size so I can dynamically populate it from code)
2) I can't change main to RelativeLayout because I would like to toggle toggle_me between gone and visible using the i_can_toggle but need to keep strech_me size the same as before
3) Before changing toggle_me to visible there must be no scroll and finished button must be positioned at the bottom of the screen
Now I have tried many things and the most promising approach was this one with some coding (I was thinking about setting the stretch_me size from code), but I was not able to get the size of the view from my onCreate() method (screen_height - view_height = remaining space).
Any ideas?
Thanks!