Fix crash on rotate (new controls in landscape layout).
diff --git a/samples/drumthumper/src/main/res/layout-land/drumthumper_activity.xml b/samples/drumthumper/src/main/res/layout-land/drumthumper_activity.xml
index ea0a665..bcc7a49 100644
--- a/samples/drumthumper/src/main/res/layout-land/drumthumper_activity.xml
+++ b/samples/drumthumper/src/main/res/layout-land/drumthumper_activity.xml
@@ -13,44 +13,249 @@
android:layout_height="wrap_content"
android:gravity="center"
android:text="DrumThumper"
- android:textSize="22pt" />
+ android:textSize="14pt" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="128dp"
android:orientation="horizontal">
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/kickPad"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Kick" />
-
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/snarePad"
+ <LinearLayout
android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Snare" />
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/midTomPad"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Mid Tom" />
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/kickPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Kick" />
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/lowTomPad"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Low Tom" />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/kickMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/kickPan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/kickGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
+
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/snarePad"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Snare" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/snareMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/snarePan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/snareGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
+
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/hihatOpenPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Open Hat" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/hihatOpenMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/hihatOpenPan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/hihatOpenGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
+
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/hihatClosedPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Closed Hat" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/hihatClosedMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/hihatClosedPan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/hihatClosedGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
</LinearLayout>
<LinearLayout
@@ -58,38 +263,245 @@
android:layout_height="128dp"
android:orientation="horizontal">
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/hihatOpenPad"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Open Hat" />
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/hihatClosedPad"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Closed Hat" />
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/midTomPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Mid Tom" />
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/ridePad"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Ride" />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/midTomMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
- <com.google.oboe.sample.drumthumper.TriggerPad
- android:id="@+id/crashPad"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:padding="5dp"
- android:text="Crash" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/midTomPan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/midTomGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
+
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/lowTomPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Low Tom" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/lowTomMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/lowTomPan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/lowTomGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
+
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/ridePad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Ride" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/rideMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/ridePan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/rideGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="128dp"
+ android:layout_weight=".5"
+ android:orientation="vertical">
+
+ <com.google.oboe.sample.drumthumper.TriggerPad
+ android:id="@+id/crashPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:text="Crash" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:id="@+id/crashMixControls">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="P:"/>
+
+ <SeekBar
+ android:id="@+id/crashPan"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="G:"/>
+
+ <SeekBar
+ android:id="@+id/crashGain"
+ style="@android:style/Widget.DeviceDefault.SeekBar"
+ android:layout_width="match_parent"
+ android:layout_height="20dp"
+ android:layout_marginTop="5dp"
+ android:max="200" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
</LinearLayout>
-
-
+ <Button
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Hide/Show Mix Controls"
+ android:id="@+id/mixCtrlBtn"/>
</LinearLayout>