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
This commit is contained in:
Chet Haase
2011-10-06 12:39:59 -07:00
parent f84558cf16
commit 976d6ceb73
4 changed files with 22 additions and 11 deletions

View File

@@ -20,7 +20,6 @@ package com.example.android.apis.animation;
// 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 @@ public class LayoutAnimations extends Activity {
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 @@ public class LayoutAnimations extends Activity {
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);

View File

@@ -60,9 +60,9 @@ public class LayoutAnimationsHideShow extends Activity {
// 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) {