-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTranslateAnim.java
More file actions
33 lines (25 loc) · 997 Bytes
/
Copy pathTranslateAnim.java
File metadata and controls
33 lines (25 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.hossain.zakaria.firebasephotoapp.utils;
import android.content.Context;
import android.view.View;
import android.view.animation.AnimationUtils;
import com.hossain.zakaria.firebasephotoapp.R;
public class TranslateAnim {
public static void setAnimation(View view, Context context, String animType) {
switch (animType) {
case "left":
view.setAnimation(AnimationUtils.loadAnimation(context, R.anim.anim_from_left));
break;
case "right":
view.setAnimation(AnimationUtils.loadAnimation(context, R.anim.anim_from_right));
break;
case "top":
view.setAnimation(AnimationUtils.loadAnimation(context, R.anim.anim_from_top));
break;
case "bottom":
view.setAnimation(AnimationUtils.loadAnimation(context, R.anim.anim_from_bottom));
break;
default:
break;
}
}
}