Skip to content

Commit 0d9e5b5

Browse files
committed
1. Modified code and packages.
1 parent a6a9d2c commit 0d9e5b5

29 files changed

+2012
-21
lines changed
5 Bytes
Binary file not shown.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/amit/animation/AnimUtil.java renamed to app/src/main/java/com/amit/anim/AnimUtil.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.amit.animation;
1+
package com.amit.anim;
22

33
import android.annotation.TargetApi;
44
import android.app.Activity;
@@ -18,7 +18,6 @@
1818
* 2018 May 14 - Monday - 03:05 PM
1919
* This AnimUtil class will help with animation
2020
**/
21-
2221
public class AnimUtil
2322
{
2423
private static final String TAG = AnimUtil.class.getSimpleName();
@@ -29,15 +28,15 @@ public class AnimUtil
2928
*
3029
* @param context - context of the activity
3130
**/
32-
public static void slideFromRightToLeftAnim(@NonNull Context context)
31+
public static void slideActivityFromRightToLeft(@NonNull Context context)
3332
{
3433
try
3534
{
3635
((Activity) context).overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
3736
}
3837
catch (Exception e)
3938
{
40-
Log.e(TAG, "slideActivityLeftToRight: exception while animating activity:\n");
39+
Log.e(TAG, "slideActivityFromRightToLeft: exception while animating activity:\n");
4140
e.printStackTrace();
4241
}
4342
}
@@ -48,7 +47,7 @@ public static void slideFromRightToLeftAnim(@NonNull Context context)
4847
*
4948
* @param context - context of the activity
5049
**/
51-
public static void slideFromLeftToRightAnim(@NonNull Context context)
50+
public static void slideActivityFromLeftToRight(@NonNull Context context)
5251
{
5352
try
5453
{
@@ -67,15 +66,15 @@ public static void slideFromLeftToRightAnim(@NonNull Context context)
6766
*
6867
* @param context - context of the activity
6968
**/
70-
public static void fadeInFadeOutAnim(@NonNull Context context)
69+
public static void activityFadeInFadeOut(@NonNull Context context)
7170
{
7271
try
7372
{
7473
((Activity) context).overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
7574
}
7675
catch (Exception e)
7776
{
78-
Log.e(TAG, "fadeInFadeOutActivity: exception while animating acivity.");
77+
Log.e(TAG, "activityFadeInFadeOut: exception while animating acivity.");
7978
e.printStackTrace();
8079
}
8180
}
@@ -86,7 +85,7 @@ public static void fadeInFadeOutAnim(@NonNull Context context)
8685
*
8786
* @param context - context of the activity
8887
**/
89-
public static void slideFromLeftWithStayAnim(@NonNull Context context)
88+
public static void slideActivityFromLeftWithStay(@NonNull Context context)
9089
{
9190
try
9291
{
@@ -105,15 +104,15 @@ public static void slideFromLeftWithStayAnim(@NonNull Context context)
105104
*
106105
* @param context - context of the activity
107106
**/
108-
public static void slideFromRightWithStayAnim(@NonNull Context context)
107+
public static void slideActivityFromRightWithStay(@NonNull Context context)
109108
{
110109
try
111110
{
112111
((Activity) context).overridePendingTransition(R.anim.slide_in_right, R.anim.anim_stay);
113112
}
114113
catch (Exception e)
115114
{
116-
Log.e(TAG, "slideActivityFromLeftWithStay: exception while animating activity.");
115+
Log.e(TAG, "slideActivityFromRightWithStay: exception while animating activity.");
117116
e.printStackTrace();
118117
}
119118
}
@@ -124,15 +123,15 @@ public static void slideFromRightWithStayAnim(@NonNull Context context)
124123
*
125124
* @param context - context of the activity
126125
**/
127-
public static void slideFromBottomWithStayAnim(@NonNull Context context)
126+
public static void slideActivityFromBottomWithStay(@NonNull Context context)
128127
{
129128
try
130129
{
131130
((Activity) context).overridePendingTransition(R.anim.bottom_to_up, R.anim.anim_stay);
132131
}
133132
catch (Exception e)
134133
{
135-
Log.e(TAG, "slideFromBottomWithStayAnim: exception while animating.");
134+
Log.e(TAG, "slideActivityFromBottomWithStay: exception while animating.");
136135
e.printStackTrace();
137136
}
138137
}
@@ -143,7 +142,7 @@ public static void slideFromBottomWithStayAnim(@NonNull Context context)
143142
*
144143
* @param context - context of the activity
145144
**/
146-
public static void slideFromUpWithStayAnim(@NonNull Context context)
145+
public static void slideActivityFromUpWithStay(@NonNull Context context)
147146
{
148147
try
149148
{
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.amit.anim;
2+
3+
/**
4+
* The Easing class provides a collection of ease functions. It does not use the standard 4 param
5+
* ease signature. Instead it uses a single param which indicates the current linear ratio (0 to 1) of the tween.
6+
*/
7+
public enum Ease
8+
{
9+
LINEAR,
10+
QUAD_IN,
11+
QUAD_OUT,
12+
QUAD_IN_OUT,
13+
CUBIC_IN,
14+
CUBIC_OUT,
15+
CUBIC_IN_OUT,
16+
QUART_IN,
17+
QUART_OUT,
18+
QUART_IN_OUT,
19+
QUINT_IN,
20+
QUINT_OUT,
21+
QUINT_IN_OUT,
22+
SINE_IN,
23+
SINE_OUT,
24+
SINE_IN_OUT,
25+
BACK_IN,
26+
BACK_OUT,
27+
BACK_IN_OUT,
28+
CIRC_IN,
29+
CIRC_OUT,
30+
CIRC_IN_OUT,
31+
BOUNCE_IN,
32+
BOUNCE_OUT,
33+
BOUNCE_IN_OUT,
34+
ELASTIC_IN,
35+
ELASTIC_OUT,
36+
ELASTIC_IN_OUT
37+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.amit.anim;
2+
3+
import android.animation.TimeInterpolator;
4+
import android.support.annotation.NonNull;
5+
6+
/**
7+
* Created by Amit Jangid on 21,May,2018
8+
**/
9+
public class EaseInterpolator implements TimeInterpolator
10+
{
11+
private final Ease ease;
12+
13+
public EaseInterpolator(@NonNull Ease ease)
14+
{
15+
this.ease = ease;
16+
}
17+
18+
@Override
19+
public float getInterpolation(float input)
20+
{
21+
return EaseProvider.get(this.ease, input);
22+
}
23+
24+
public Ease getEase()
25+
{
26+
return ease;
27+
}
28+
}

0 commit comments

Comments
 (0)