I have a layout xml file:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#000000" >
<FrameLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_above="@+id/taoFooter">
<com.example.gamedice.DrawingPanel
android:id="@+id/taoCanvas"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#000000" />
</FrameLayout>
<LinearLayout
android:id="@+id/taoFooter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
style="@android:style/Holo.ButtonBar">
<Button
android:id="@+id/roll1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/roll1"
android:layout_weight="1"
style="@android:style/Widget.Holo.Button.Borderless"
android:onClick="rollTaoDice" />
<Button
android:id="@+id/roll2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/roll2"
android:layout_weight="1"
style="@android:style/Widget.Holo.Button.Borderless"
android:onClick="rollTaoDice" />
<Button
android:id="@+id/roll3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/roll3"
android:layout_weight="1"
style="@android:style/Widget.Holo.Button.Borderless"
android:onClick="rollTaoDice" />
<Button
android:id="@+id/roll4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/roll4"
android:layout_weight="1"
style="@android:style/Widget.Holo.Button.Borderless"
android:onClick="rollTaoDice" />
</LinearLayout>
</RelativeLayout>
In addition to other items in the layout, this layout has a button bar consisting of four buttons at the bottom of the screen. Based on user input, I want to be able to replace this button bar with another predefined set of buttons, and then be able to change back later.
Since I know what the alternate set of buttons will be ahead of time, I thought it might be possible to use an alternate layout xml file, but I couldn't figure out how to do that. Can anyone give me some guidance?