mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-10 05:26:10 +01:00
6da7c85dbf
Correct or not, this is my solution to the circular problem of how to choose a vertical or horizontal toolbar before beginning the layout of the board and toolbar. Adding a new custom container that holds the board, toolbar(s) and tile exchange buttons and uses the ratio of its own dimensions to choose which toolbar to show. Also drive toolbar initialization from the layout process because when started from BoardDelegate it now tries to install button listeners too early.
57 lines
2.1 KiB
XML
57 lines
2.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<!-- BoardContainer is a custom layout that among other things assumes
|
|
four children. Change the number of children and an assert will fire.
|
|
-->
|
|
|
|
<org.eehouse.android.xw4.BoardContainer
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:id="@+id/board_root"
|
|
android:orientation="vertical"
|
|
android:layout_width="fill_parent"
|
|
android:layout_height="fill_parent"
|
|
>
|
|
<org.eehouse.android.xw4.BoardView
|
|
android:id="@+id/board_view"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:focusable="true"
|
|
android:clickable="true"
|
|
android:longClickable="true"
|
|
android:drawSelectorOnTop="false"
|
|
android:layout_gravity="center_horizontal"
|
|
android:background="@android:color/transparent"
|
|
/>
|
|
|
|
<LinearLayout android:id="@+id/exchange_buttons"
|
|
android:orientation="horizontal"
|
|
android:layout_width="fill_parent"
|
|
android:layout_height="wrap_content"
|
|
android:visibility="gone"
|
|
>
|
|
<Button android:id="@+id/exchange_commit"
|
|
android:text="@string/button_trade_commit"
|
|
style="@style/evenly_spaced_horizontal"
|
|
/>
|
|
<Button android:id="@+id/exchange_cancel"
|
|
android:text="@string/button_trade_cancel"
|
|
style="@style/evenly_spaced_horizontal"
|
|
/>
|
|
</LinearLayout>
|
|
|
|
<!-- toolbar goes inside one of these -->
|
|
<ScrollView android:id="@+id/tbar_parent_vert"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_vertical"
|
|
android:visibility="gone"
|
|
/>
|
|
<HorizontalScrollView android:id="@+id/tbar_parent_hor"
|
|
android:orientation="horizontal"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_horizontal"
|
|
/>
|
|
|
|
</org.eehouse.android.xw4.BoardContainer>
|