-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Up version to 1.9.2, add more convenient initializers and builders fo…
…r animation states
- Loading branch information
David Ganster
committed
Sep 6, 2021
1 parent
70e35d3
commit 960b0bd
Showing
14 changed files
with
355 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...va/at/wirecube/additiveanimations/additive_animator/animation_set/view/ViewAnimation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package at.wirecube.additiveanimations.additive_animator.animation_set.view; | ||
|
||
import android.animation.TypeEvaluator; | ||
import android.util.Property; | ||
import android.view.View; | ||
|
||
import at.wirecube.additiveanimations.additive_animator.animation_set.AnimationAction; | ||
|
||
public class ViewAnimation extends AnimationAction.Animation<View> { | ||
public ViewAnimation(Property<View, Float> property, float targetValue) { | ||
super(property, targetValue); | ||
} | ||
|
||
public ViewAnimation(Property<View, Float> property, float targetValue, TypeEvaluator<Float> evaluator) { | ||
super(property, targetValue, evaluator); | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
.../wirecube/additiveanimations/additive_animator/animation_set/view/ViewAnimationState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package at.wirecube.additiveanimations.additive_animator.animation_set.view; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import at.wirecube.additiveanimations.additive_animator.animation_set.AnimationAction; | ||
import at.wirecube.additiveanimations.additive_animator.animation_set.AnimationState; | ||
|
||
public class ViewAnimationState extends AnimationState<View> { | ||
|
||
@NonNull | ||
private final List<AnimationAction.Animation<View>> mAnimations = new ArrayList<>(); | ||
@Nullable | ||
private final AnimationStartAction<View> mStartAction; | ||
@Nullable | ||
private final AnimationEndAction<View> mEndAction; | ||
|
||
public ViewAnimationState(@NonNull List<ViewAnimation> animations) { | ||
this(animations, null, null); | ||
} | ||
|
||
public ViewAnimationState(@NonNull ViewAnimation... animations) { | ||
this(Arrays.asList(animations), null, null); | ||
} | ||
|
||
public ViewAnimationState(@NonNull List<ViewAnimation> animations, @Nullable AnimationStartAction<View> startAction) { | ||
this(animations, startAction, null); | ||
} | ||
|
||
public ViewAnimationState(ViewAnimation animation, @Nullable AnimationStartAction<View> startAction) { | ||
this(Arrays.asList(animation), startAction, null); | ||
} | ||
|
||
public ViewAnimationState(@Nullable AnimationStartAction<View> startAction, @NonNull ViewAnimation... animations) { | ||
this(Arrays.asList(animations), startAction, null); | ||
} | ||
|
||
public ViewAnimationState(@NonNull ViewAnimation animation, @Nullable AnimationEndAction<View> endAction) { | ||
this(Arrays.asList(animation), null, endAction); | ||
} | ||
|
||
public ViewAnimationState(@NonNull List<ViewAnimation> animations, @Nullable AnimationEndAction<View> endAction) { | ||
this(animations, null, endAction); | ||
} | ||
|
||
public ViewAnimationState(@Nullable AnimationEndAction<View> endAction, @NonNull ViewAnimation... animations) { | ||
this(Arrays.asList(animations), null, endAction); | ||
} | ||
|
||
public ViewAnimationState(@NonNull ViewAnimation animation, @Nullable AnimationStartAction<View> startAction, @Nullable AnimationEndAction<View> endAction) { | ||
this(Arrays.asList(animation), startAction, endAction); | ||
} | ||
|
||
public ViewAnimationState(@Nullable AnimationStartAction<View> startAction, @Nullable AnimationEndAction<View> endAction, @NonNull ViewAnimation... animations) { | ||
this(Arrays.asList(animations), startAction, endAction); | ||
} | ||
|
||
public ViewAnimationState(@NonNull List<ViewAnimation> animations, @Nullable AnimationStartAction<View> startAction, @Nullable AnimationEndAction<View> endAction) { | ||
mAnimations.addAll(animations); | ||
mStartAction = startAction; | ||
mEndAction = endAction; | ||
} | ||
|
||
@Override | ||
public List<Animation<View>> getAnimations() { | ||
return mAnimations; | ||
} | ||
|
||
@Override | ||
public AnimationStartAction<View> getAnimationStartAction() { | ||
return mStartAction; | ||
} | ||
|
||
@Override | ||
public AnimationEndAction<View> getAnimationEndAction() { | ||
return mEndAction; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...at/wirecube/additiveanimations/additive_animator/animation_set/view/ViewStateBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package at.wirecube.additiveanimations.additive_animator.animation_set.view; | ||
|
||
import android.view.View; | ||
|
||
import at.wirecube.additiveanimations.additive_animator.animation_set.AnimationState; | ||
|
||
public class ViewStateBuilder extends AnimationState.Builder<View> { | ||
} |
Oops, something went wrong.