Added Animations To List View :)
This commit is contained in:
parent
2704103348
commit
1b6e1a7eba
3 changed files with 18 additions and 2 deletions
|
@ -75,8 +75,8 @@ public class ListAdapter extends BaseAdapter {
|
|||
// permission.setText(curNote.isPublic() ? "Public":"Private");
|
||||
permission.setBackground(curNote.isPublic() ? v.getResources().getDrawable(R.drawable.public_icon): v.getResources().getDrawable(R.drawable.private_icon));
|
||||
|
||||
// Animation animation = AnimationUtils.loadAnimation(mContext, (position > lastPosition) ? R.anim.up_from_bottom : R.anim.down_from_top);
|
||||
// v.startAnimation(animation);
|
||||
Animation animation = AnimationUtils.loadAnimation(mContext, (position > lastPosition) ? R.anim.up_from_bottom : R.anim.down_from_top);
|
||||
v.startAnimation(animation);
|
||||
lastPosition = position;
|
||||
return v;
|
||||
}
|
||||
|
|
8
app/src/main/res/anim/down_from_top.xml
Normal file
8
app/src/main/res/anim/down_from_top.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shareInterpolator="@android:anim/decelerate_interpolator">
|
||||
<translate
|
||||
android:fromXDelta="0%" android:toXDelta="0%"
|
||||
android:fromYDelta="-100%" android:toYDelta="0%"
|
||||
android:duration="400" />
|
||||
</set>
|
8
app/src/main/res/anim/up_from_bottom.xml
Normal file
8
app/src/main/res/anim/up_from_bottom.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shareInterpolator="@android:anim/decelerate_interpolator">
|
||||
<translate
|
||||
android:fromXDelta="0%" android:toXDelta="0%"
|
||||
android:fromYDelta="100%" android:toYDelta="0%"
|
||||
android:duration="400" />
|
||||
</set>
|
Loading…
Reference in a new issue