From 1b6e1a7ebaca1b68f649d08e0013061b767375c8 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Fri, 8 Jul 2016 00:04:46 +0300 Subject: [PATCH] Added Animations To List View :) --- .../matan/ara/sagi/thesocialnotework/ListAdapter.java | 4 ++-- app/src/main/res/anim/down_from_top.xml | 8 ++++++++ app/src/main/res/anim/up_from_bottom.xml | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/anim/down_from_top.xml create mode 100644 app/src/main/res/anim/up_from_bottom.xml diff --git a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/ListAdapter.java b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/ListAdapter.java index 38b2e2d..baf9c12 100644 --- a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/ListAdapter.java +++ b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/ListAdapter.java @@ -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; } diff --git a/app/src/main/res/anim/down_from_top.xml b/app/src/main/res/anim/down_from_top.xml new file mode 100644 index 0000000..c0c0463 --- /dev/null +++ b/app/src/main/res/anim/down_from_top.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/up_from_bottom.xml b/app/src/main/res/anim/up_from_bottom.xml new file mode 100644 index 0000000..eb3074c --- /dev/null +++ b/app/src/main/res/anim/up_from_bottom.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file