1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-22 08:52:18 -05:00

Moved LayoutAnimation creation to initAnimation()

This commit is contained in:
Sebastian Kaspari 2009-05-30 13:37:14 +02:00
parent c179520a17
commit d90d31730c

View File

@ -84,7 +84,7 @@ public class ServerList extends ListActivity implements OnItemLongClickListener,
setContentView(R.layout.main); setContentView(R.layout.main);
db = new ServerDatabase(this); db = new ServerDatabase(this);
cursor = db.getServers(); cursor = db.getServers();
this.startManagingCursor(cursor); this.startManagingCursor(cursor);
@ -93,6 +93,11 @@ public class ServerList extends ListActivity implements OnItemLongClickListener,
this.getListView().setOnItemLongClickListener(this); this.getListView().setOnItemLongClickListener(this);
this.initAnimation();
}
public void initAnimation()
{
AnimationSet set = new AnimationSet(true); AnimationSet set = new AnimationSet(true);
Animation animation = new AlphaAnimation(0.0f, 1.0f); Animation animation = new AlphaAnimation(0.0f, 1.0f);
@ -106,8 +111,7 @@ public class ServerList extends ListActivity implements OnItemLongClickListener,
animation.setDuration(300); animation.setDuration(300);
set.addAnimation(animation); set.addAnimation(animation);
LayoutAnimationController controller = LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
new LayoutAnimationController(set, 0.5f);
ListView lv = (ListView) getListView(); ListView lv = (ListView) getListView();
lv.setLayoutAnimation(controller); lv.setLayoutAnimation(controller);
} }