Clean up LayoutTransition demos for smaller screens.
These demos assumed the size of a tablet device and looked pretty
awful on phones.
Change-Id: I246ef5a5f4619c1f2fe689eca321314375722014
diff --git a/samples/ApiDemos/res/layout/layout_animations.xml b/samples/ApiDemos/res/layout/layout_animations.xml
index 68f0e0e..ce179c4 100644
--- a/samples/ApiDemos/res/layout/layout_animations.xml
+++ b/samples/ApiDemos/res/layout/layout_animations.xml
@@ -40,34 +40,40 @@
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
- android:text="Appearing Animation"
+ android:text="In"
android:id="@+id/appearingCB"
/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
- android:text="Disappearing Animation"
+ android:text="Out"
android:id="@+id/disappearingCB"
/>
+ </LinearLayout>
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
- android:text="Changing/Appearing Animation"
+ android:text="Changing-In"
android:id="@+id/changingAppearingCB"
/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
- android:text="Changing/Disappearing Animation"
+ android:text="Changing-Out"
android:id="@+id/changingDisappearingCB"
/>
</LinearLayout>
diff --git a/samples/ApiDemos/res/layout/layout_animations_hideshow.xml b/samples/ApiDemos/res/layout/layout_animations_hideshow.xml
index 4215ac1..49c2047 100644
--- a/samples/ApiDemos/res/layout/layout_animations_hideshow.xml
+++ b/samples/ApiDemos/res/layout/layout_animations_hideshow.xml
@@ -30,6 +30,12 @@
android:text="Show Buttons"
android:id="@+id/addNewButton"
/>
+ </LinearLayout>
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ >
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimations.java b/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimations.java
index 65ad782..a2ff23c 100644
--- a/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimations.java
+++ b/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimations.java
@@ -20,7 +20,6 @@
// class is in a sub-package.
import android.animation.Animator;
import android.animation.ObjectAnimator;
-import android.widget.LinearLayout;
import com.example.android.apis.R;
import android.animation.AnimatorListenerAdapter;
@@ -59,8 +58,8 @@
container = new FixedGridLayout(this);
container.setClipChildren(false);
- ((FixedGridLayout)container).setCellHeight(50);
- ((FixedGridLayout)container).setCellWidth(200);
+ ((FixedGridLayout)container).setCellHeight(90);
+ ((FixedGridLayout)container).setCellWidth(100);
final LayoutTransition transitioner = new LayoutTransition();
container.setLayoutTransition(transitioner);
defaultAppearingAnim = transitioner.getAnimator(LayoutTransition.APPEARING);
@@ -83,7 +82,7 @@
addButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Button newButton = new Button(LayoutAnimations.this);
- newButton.setText("Click to Delete " + (numButtons++));
+ newButton.setText(String.valueOf(numButtons++));
newButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
container.removeView(v);
diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimationsHideShow.java b/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimationsHideShow.java
index 1a5d9c0..ac0609e 100644
--- a/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimationsHideShow.java
+++ b/samples/ApiDemos/src/com/example/android/apis/animation/LayoutAnimationsHideShow.java
@@ -60,9 +60,9 @@
// Add a slew of buttons to the container. We won't add any more buttons at runtime, but
// will just show/hide the buttons we've already created
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 4; ++i) {
Button newButton = new Button(this);
- newButton.setText("Click to Hide " + i);
+ newButton.setText(String.valueOf(i));
container.addView(newButton);
newButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {