switch to RelativeLayout, putting lock checkbox at top and play game

button in the middle with everything else scrolling in between.  This
particular application of RelativeLayout works on 1.5 (in emulator).
This commit is contained in:
Andy2 2010-11-07 15:13:39 -08:00
parent aff3c9a931
commit 83ae8d316c

View file

@ -14,196 +14,208 @@
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/screen"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<!-- only one direct child possible -->
<LinearLayout android:layout_width="fill_parent"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
>
<CheckBox android:id="@+id/game_locked_check"
<CheckBox android:id="@+id/game_locked_check"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/game_locked"
android:visibility="gone"
android:layout_alignParentTop="true"
/>
<!-- This guy's at the bottom of the screen! -->
<Button android:id="@+id/play_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/play"
android:layout_alignParentBottom="true"
/>
<ScrollView android:id="@+id/screen"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/game_locked"
android:visibility="gone"
/>
android:orientation="vertical"
android:layout_below="@id/game_locked_check"
android:layout_above="@id/play_button"
>
<!-- players -->
<TextView style="@style/config_separator"
android:id="@+id/players_label"
/>
<LinearLayout android:id="@+id/player_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="5sp"
android:layout_marginBottom="5sp"
>
</LinearLayout>
<!-- only one direct child possible -->
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom|center"
>
<Button android:id="@+id/add_player"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_add_player"
/>
<Button android:id="@+id/juggle_players"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_juggle_players"
/>
</LinearLayout>
<TextView style="@style/config_separator"
android:text="@string/dict_label"
/>
<Spinner android:id="@+id/dict_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/>
<LinearLayout android:id="@+id/connect_set"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<!-- players -->
<TextView style="@style/config_separator"
android:text="@string/connect_label"
android:id="@+id/players_label"
/>
<LinearLayout android:id="@+id/player_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="5sp"
android:layout_marginBottom="5sp"
>
</LinearLayout>
<!-- We'll use either the spinner or simple edit text
depending on whether user is naming room or picking from
a set one. -->
<CheckBox android:id="@+id/join_public_room_check"
android:layout_width="fill_parent"
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom|center"
>
<Button android:id="@+id/add_player"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/join_room"
android:text="@string/button_add_player"
/>
<Button android:id="@+id/juggle_players"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_juggle_players"
/>
</LinearLayout>
<TextView style="@style/config_separator"
android:text="@string/dict_label"
/>
<LinearLayout android:id="@+id/private_rooms_set"
<Spinner android:id="@+id/dict_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/>
<LinearLayout android:id="@+id/connect_set"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<!-- maxLength derives from MAX_INVITE_LEN in xwrelay.h -->
<EditText android:id="@+id/room_edit"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:scrollHorizontally="false"
android:autoText="false"
android:capitalize="none"
android:singleLine="true"
android:selectAllOnFocus="true"
android:maxLength="31"
android:hint="@string/new_room_hint"
<TextView style="@style/config_separator"
android:text="@string/connect_label"
/>
<CheckBox android:id="@+id/advertise_new_room_check"
<!-- We'll use either the spinner or simple edit text
depending on whether user is naming room or picking from
a set one. -->
<CheckBox android:id="@+id/join_public_room_check"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/room_public"
android:text="@string/join_room"
/>
</LinearLayout>
<LinearLayout android:id="@+id/public_rooms_set"
<LinearLayout android:id="@+id/private_rooms_set"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<!-- maxLength derives from MAX_INVITE_LEN in xwrelay.h -->
<EditText android:id="@+id/room_edit"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:scrollHorizontally="false"
android:autoText="false"
android:capitalize="none"
android:singleLine="true"
android:selectAllOnFocus="true"
android:maxLength="31"
android:hint="@string/new_room_hint"
/>
<CheckBox android:id="@+id/advertise_new_room_check"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Spinner android:id="@+id/room_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:gravity="left"
android:layout_weight="1"
android:prompt="@string/room_public_prompt"
/>
<ImageButton android:id="@+id/refresh_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/refresh"
android:gravity="right"
android:layout_weight="0"
/>
android:text="@string/room_public"
/>
</LinearLayout>
<LinearLayout android:id="@+id/public_rooms_set"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Spinner android:id="@+id/room_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:gravity="left"
android:layout_weight="1"
android:prompt="@string/room_public_prompt"
/>
<ImageButton android:id="@+id/refresh_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/refresh"
android:gravity="right"
android:layout_weight="0"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView style="@style/config_separator"
android:text="@string/settings_label"
/>
<TextView style="@style/config_separator"
android:text="@string/settings_label"
/>
<CheckBox android:id="@+id/hints_allowed"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hints_allowed"
/>
<CheckBox android:id="@+id/hints_allowed"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hints_allowed"
/>
<CheckBox android:id="@+id/use_timer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/use_timer"
/>
<CheckBox android:id="@+id/use_timer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/use_timer"
/>
<LinearLayout android:id="@+id/timer_set"
android:visibility="gone"
<LinearLayout android:id="@+id/timer_set"
android:visibility="gone"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:text="@string/minutes_label"
android:gravity="left"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<EditText android:id="@+id/timer_minutes_edit"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
android:autoText="false"
android:capitalize="none"
android:numeric="decimal"
android:hint="25"
android:gravity="fill_horizontal"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
</LinearLayout>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:text="@string/minutes_label"
android:gravity="left"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<EditText android:id="@+id/timer_minutes_edit"
android:layout_height="wrap_content"
<CheckBox android:id="@+id/smart_robot"
android:layout_width="fill_parent"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:scrollHorizontally="true"
android:autoText="false"
android:capitalize="none"
android:numeric="decimal"
android:hint="25"
android:gravity="fill_horizontal"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_height="wrap_content"
android:text="@string/smart_robot"
/>
<Spinner android:id="@+id/phonies_spinner"
android:prompt="@string/phonies_spinner_prompt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:entries="@array/phony_names"
/>
</LinearLayout>
<CheckBox android:id="@+id/smart_robot"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/smart_robot"
/>
</ScrollView>
<Spinner android:id="@+id/phonies_spinner"
android:prompt="@string/phonies_spinner_prompt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:entries="@array/phony_names"
/>
<Button android:id="@+id/play_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/play"
/>
</LinearLayout>
</ScrollView>
</RelativeLayout>