Skip to content

Commit

Permalink
1. Modified code and packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcsingh1234 committed May 21, 2018
1 parent a6a9d2c commit 0d9e5b5
Show file tree
Hide file tree
Showing 29 changed files with 2,012 additions and 21 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.amit.animation;
package com.amit.anim;

import android.annotation.TargetApi;
import android.app.Activity;
Expand All @@ -18,7 +18,6 @@
* 2018 May 14 - Monday - 03:05 PM
* This AnimUtil class will help with animation
**/

public class AnimUtil
{
private static final String TAG = AnimUtil.class.getSimpleName();
Expand All @@ -29,15 +28,15 @@ public class AnimUtil
*
* @param context - context of the activity
**/
public static void slideFromRightToLeftAnim(@NonNull Context context)
public static void slideActivityFromRightToLeft(@NonNull Context context)
{
try
{
((Activity) context).overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
catch (Exception e)
{
Log.e(TAG, "slideActivityLeftToRight: exception while animating activity:\n");
Log.e(TAG, "slideActivityFromRightToLeft: exception while animating activity:\n");
e.printStackTrace();
}
}
Expand All @@ -48,7 +47,7 @@ public static void slideFromRightToLeftAnim(@NonNull Context context)
*
* @param context - context of the activity
**/
public static void slideFromLeftToRightAnim(@NonNull Context context)
public static void slideActivityFromLeftToRight(@NonNull Context context)
{
try
{
Expand All @@ -67,15 +66,15 @@ public static void slideFromLeftToRightAnim(@NonNull Context context)
*
* @param context - context of the activity
**/
public static void fadeInFadeOutAnim(@NonNull Context context)
public static void activityFadeInFadeOut(@NonNull Context context)
{
try
{
((Activity) context).overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
catch (Exception e)
{
Log.e(TAG, "fadeInFadeOutActivity: exception while animating acivity.");
Log.e(TAG, "activityFadeInFadeOut: exception while animating acivity.");
e.printStackTrace();
}
}
Expand All @@ -86,7 +85,7 @@ public static void fadeInFadeOutAnim(@NonNull Context context)
*
* @param context - context of the activity
**/
public static void slideFromLeftWithStayAnim(@NonNull Context context)
public static void slideActivityFromLeftWithStay(@NonNull Context context)
{
try
{
Expand All @@ -105,15 +104,15 @@ public static void slideFromLeftWithStayAnim(@NonNull Context context)
*
* @param context - context of the activity
**/
public static void slideFromRightWithStayAnim(@NonNull Context context)
public static void slideActivityFromRightWithStay(@NonNull Context context)
{
try
{
((Activity) context).overridePendingTransition(R.anim.slide_in_right, R.anim.anim_stay);
}
catch (Exception e)
{
Log.e(TAG, "slideActivityFromLeftWithStay: exception while animating activity.");
Log.e(TAG, "slideActivityFromRightWithStay: exception while animating activity.");
e.printStackTrace();
}
}
Expand All @@ -124,15 +123,15 @@ public static void slideFromRightWithStayAnim(@NonNull Context context)
*
* @param context - context of the activity
**/
public static void slideFromBottomWithStayAnim(@NonNull Context context)
public static void slideActivityFromBottomWithStay(@NonNull Context context)
{
try
{
((Activity) context).overridePendingTransition(R.anim.bottom_to_up, R.anim.anim_stay);
}
catch (Exception e)
{
Log.e(TAG, "slideFromBottomWithStayAnim: exception while animating.");
Log.e(TAG, "slideActivityFromBottomWithStay: exception while animating.");
e.printStackTrace();
}
}
Expand All @@ -143,7 +142,7 @@ public static void slideFromBottomWithStayAnim(@NonNull Context context)
*
* @param context - context of the activity
**/
public static void slideFromUpWithStayAnim(@NonNull Context context)
public static void slideActivityFromUpWithStay(@NonNull Context context)
{
try
{
Expand Down
37 changes: 37 additions & 0 deletions app/src/main/java/com/amit/anim/Ease.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.amit.anim;

/**
* The Easing class provides a collection of ease functions. It does not use the standard 4 param
* ease signature. Instead it uses a single param which indicates the current linear ratio (0 to 1) of the tween.
*/
public enum Ease
{
LINEAR,
QUAD_IN,
QUAD_OUT,
QUAD_IN_OUT,
CUBIC_IN,
CUBIC_OUT,
CUBIC_IN_OUT,
QUART_IN,
QUART_OUT,
QUART_IN_OUT,
QUINT_IN,
QUINT_OUT,
QUINT_IN_OUT,
SINE_IN,
SINE_OUT,
SINE_IN_OUT,
BACK_IN,
BACK_OUT,
BACK_IN_OUT,
CIRC_IN,
CIRC_OUT,
CIRC_IN_OUT,
BOUNCE_IN,
BOUNCE_OUT,
BOUNCE_IN_OUT,
ELASTIC_IN,
ELASTIC_OUT,
ELASTIC_IN_OUT
}
28 changes: 28 additions & 0 deletions app/src/main/java/com/amit/anim/EaseInterpolator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.amit.anim;

import android.animation.TimeInterpolator;
import android.support.annotation.NonNull;

/**
* Created by Amit Jangid on 21,May,2018
**/
public class EaseInterpolator implements TimeInterpolator
{
private final Ease ease;

public EaseInterpolator(@NonNull Ease ease)
{
this.ease = ease;
}

@Override
public float getInterpolation(float input)
{
return EaseProvider.get(this.ease, input);
}

public Ease getEase()
{
return ease;
}
}
Loading

0 comments on commit 0d9e5b5

Please sign in to comment.