Merge "Clean up LayoutTransition demos for smaller screens."
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user