|
| 1 | + |
| 2 | +/* |
| 3 | + * The MIT License (MIT) |
| 4 | + * |
| 5 | + * Copyright (c) 2014 daimajia |
| 6 | + * |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | + * |
| 14 | + * The above copyright notice and this permission notice shall be included in all |
| 15 | + * copies or substantial portions of the Software. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | + * SOFTWARE. |
| 24 | + */ |
| 25 | + |
| 26 | +package com.daimajia.androidanimations.library; |
| 27 | + |
| 28 | +import com.daimajia.androidanimations.library.attention.BounceAnimator; |
| 29 | +import com.daimajia.androidanimations.library.attention.FlashAnimator; |
| 30 | +import com.daimajia.androidanimations.library.attention.PulseAnimator; |
| 31 | +import com.daimajia.androidanimations.library.attention.RubberBandAnimator; |
| 32 | +import com.daimajia.androidanimations.library.attention.ShakeAnimator; |
| 33 | +import com.daimajia.androidanimations.library.attention.StandUpAnimator; |
| 34 | +import com.daimajia.androidanimations.library.attention.SwingAnimator; |
| 35 | +import com.daimajia.androidanimations.library.attention.TadaAnimator; |
| 36 | +import com.daimajia.androidanimations.library.attention.WaveAnimator; |
| 37 | +import com.daimajia.androidanimations.library.attention.WobbleAnimator; |
| 38 | +import com.daimajia.androidanimations.library.bouncing_entrances.BounceInAnimator; |
| 39 | +import com.daimajia.androidanimations.library.bouncing_entrances.BounceInDownAnimator; |
| 40 | +import com.daimajia.androidanimations.library.bouncing_entrances.BounceInLeftAnimator; |
| 41 | +import com.daimajia.androidanimations.library.bouncing_entrances.BounceInRightAnimator; |
| 42 | +import com.daimajia.androidanimations.library.bouncing_entrances.BounceInUpAnimator; |
| 43 | +import com.daimajia.androidanimations.library.fading_entrances.FadeInAnimator; |
| 44 | +import com.daimajia.androidanimations.library.fading_entrances.FadeInDownAnimator; |
| 45 | +import com.daimajia.androidanimations.library.fading_entrances.FadeInLeftAnimator; |
| 46 | +import com.daimajia.androidanimations.library.fading_entrances.FadeInRightAnimator; |
| 47 | +import com.daimajia.androidanimations.library.fading_entrances.FadeInUpAnimator; |
| 48 | +import com.daimajia.androidanimations.library.fading_exits.FadeOutAnimator; |
| 49 | +import com.daimajia.androidanimations.library.fading_exits.FadeOutDownAnimator; |
| 50 | +import com.daimajia.androidanimations.library.fading_exits.FadeOutLeftAnimator; |
| 51 | +import com.daimajia.androidanimations.library.fading_exits.FadeOutRightAnimator; |
| 52 | +import com.daimajia.androidanimations.library.fading_exits.FadeOutUpAnimator; |
| 53 | +import com.daimajia.androidanimations.library.flippers.FlipInXAnimator; |
| 54 | +import com.daimajia.androidanimations.library.flippers.FlipOutXAnimator; |
| 55 | +import com.daimajia.androidanimations.library.flippers.FlipOutYAnimator; |
| 56 | +import com.daimajia.androidanimations.library.rotating_entrances.RotateInAnimator; |
| 57 | +import com.daimajia.androidanimations.library.rotating_entrances.RotateInDownLeftAnimator; |
| 58 | +import com.daimajia.androidanimations.library.rotating_entrances.RotateInDownRightAnimator; |
| 59 | +import com.daimajia.androidanimations.library.rotating_entrances.RotateInUpLeftAnimator; |
| 60 | +import com.daimajia.androidanimations.library.rotating_entrances.RotateInUpRightAnimator; |
| 61 | +import com.daimajia.androidanimations.library.rotating_exits.RotateOutAnimator; |
| 62 | +import com.daimajia.androidanimations.library.rotating_exits.RotateOutDownLeftAnimator; |
| 63 | +import com.daimajia.androidanimations.library.rotating_exits.RotateOutDownRightAnimator; |
| 64 | +import com.daimajia.androidanimations.library.rotating_exits.RotateOutUpLeftAnimator; |
| 65 | +import com.daimajia.androidanimations.library.rotating_exits.RotateOutUpRightAnimator; |
| 66 | +import com.daimajia.androidanimations.library.sliders.SlideInDownAnimator; |
| 67 | +import com.daimajia.androidanimations.library.sliders.SlideInLeftAnimator; |
| 68 | +import com.daimajia.androidanimations.library.sliders.SlideInRightAnimator; |
| 69 | +import com.daimajia.androidanimations.library.sliders.SlideInUpAnimator; |
| 70 | +import com.daimajia.androidanimations.library.sliders.SlideOutDownAnimator; |
| 71 | +import com.daimajia.androidanimations.library.sliders.SlideOutLeftAnimator; |
| 72 | +import com.daimajia.androidanimations.library.sliders.SlideOutRightAnimator; |
| 73 | +import com.daimajia.androidanimations.library.sliders.SlideOutUpAnimator; |
| 74 | +import com.daimajia.androidanimations.library.specials.HingeAnimator; |
| 75 | +import com.daimajia.androidanimations.library.specials.RollInAnimator; |
| 76 | +import com.daimajia.androidanimations.library.specials.RollOutAnimator; |
| 77 | +import com.daimajia.androidanimations.library.zooming_entrances.ZoomInAnimator; |
| 78 | +import com.daimajia.androidanimations.library.zooming_entrances.ZoomInDownAnimator; |
| 79 | +import com.daimajia.androidanimations.library.zooming_entrances.ZoomInLeftAnimator; |
| 80 | +import com.daimajia.androidanimations.library.zooming_entrances.ZoomInRightAnimator; |
| 81 | +import com.daimajia.androidanimations.library.zooming_entrances.ZoomInUpAnimator; |
| 82 | +import com.daimajia.androidanimations.library.zooming_exits.ZoomOutAnimator; |
| 83 | +import com.daimajia.androidanimations.library.zooming_exits.ZoomOutDownAnimator; |
| 84 | +import com.daimajia.androidanimations.library.zooming_exits.ZoomOutLeftAnimator; |
| 85 | +import com.daimajia.androidanimations.library.zooming_exits.ZoomOutRightAnimator; |
| 86 | +import com.daimajia.androidanimations.library.zooming_exits.ZoomOutUpAnimator; |
| 87 | + |
| 88 | +public enum Techniques { |
| 89 | + |
| 90 | + Flash(FlashAnimator.class), |
| 91 | + Pulse(PulseAnimator.class), |
| 92 | + RubberBand(RubberBandAnimator.class), |
| 93 | + Shake(ShakeAnimator.class), |
| 94 | + Swing(SwingAnimator.class), |
| 95 | + Wobble(WobbleAnimator.class), |
| 96 | + Bounce(BounceAnimator.class), |
| 97 | + Tada(TadaAnimator.class), |
| 98 | + StandUp(StandUpAnimator.class), |
| 99 | + Wave(WaveAnimator.class), |
| 100 | + |
| 101 | + Hinge(HingeAnimator.class), |
| 102 | + RollIn(RollInAnimator.class), |
| 103 | + RollOut(RollOutAnimator.class), |
| 104 | + |
| 105 | + BounceIn(BounceInAnimator.class), |
| 106 | + BounceInDown(BounceInDownAnimator.class), |
| 107 | + BounceInLeft(BounceInLeftAnimator.class), |
| 108 | + BounceInRight(BounceInRightAnimator.class), |
| 109 | + BounceInUp(BounceInUpAnimator.class), |
| 110 | + |
| 111 | + FadeIn(FadeInAnimator.class), |
| 112 | + FadeInUp(FadeInUpAnimator.class), |
| 113 | + FadeInDown(FadeInDownAnimator.class), |
| 114 | + FadeInLeft(FadeInLeftAnimator.class), |
| 115 | + FadeInRight(FadeInRightAnimator.class), |
| 116 | + |
| 117 | + FadeOut(FadeOutAnimator.class), |
| 118 | + FadeOutDown(FadeOutDownAnimator.class), |
| 119 | + FadeOutLeft(FadeOutLeftAnimator.class), |
| 120 | + FadeOutRight(FadeOutRightAnimator.class), |
| 121 | + FadeOutUp(FadeOutUpAnimator.class), |
| 122 | + |
| 123 | + FlipInX(FlipInXAnimator.class), |
| 124 | + FlipOutX(FlipOutXAnimator.class), |
| 125 | + |
| 126 | + FlipOutY(FlipOutYAnimator.class), |
| 127 | + RotateIn(RotateInAnimator.class), |
| 128 | + RotateInDownLeft(RotateInDownLeftAnimator.class), |
| 129 | + RotateInDownRight(RotateInDownRightAnimator.class), |
| 130 | + RotateInUpLeft(RotateInUpLeftAnimator.class), |
| 131 | + RotateInUpRight(RotateInUpRightAnimator.class), |
| 132 | + |
| 133 | + RotateOut(RotateOutAnimator.class), |
| 134 | + RotateOutDownLeft(RotateOutDownLeftAnimator.class), |
| 135 | + RotateOutDownRight(RotateOutDownRightAnimator.class), |
| 136 | + RotateOutUpLeft(RotateOutUpLeftAnimator.class), |
| 137 | + RotateOutUpRight(RotateOutUpRightAnimator.class), |
| 138 | + |
| 139 | + SlideInLeft(SlideInLeftAnimator.class), |
| 140 | + SlideInRight(SlideInRightAnimator.class), |
| 141 | + SlideInUp(SlideInUpAnimator.class), |
| 142 | + SlideInDown(SlideInDownAnimator.class), |
| 143 | + |
| 144 | + SlideOutLeft(SlideOutLeftAnimator.class), |
| 145 | + SlideOutRight(SlideOutRightAnimator.class), |
| 146 | + SlideOutUp(SlideOutUpAnimator.class), |
| 147 | + SlideOutDown(SlideOutDownAnimator.class), |
| 148 | + |
| 149 | + ZoomIn(ZoomInAnimator.class), |
| 150 | + ZoomInDown(ZoomInDownAnimator.class), |
| 151 | + ZoomInLeft(ZoomInLeftAnimator.class), |
| 152 | + ZoomInRight(ZoomInRightAnimator.class), |
| 153 | + ZoomInUp(ZoomInUpAnimator.class), |
| 154 | + |
| 155 | + ZoomOut(ZoomOutAnimator.class), |
| 156 | + ZoomOutDown(ZoomOutDownAnimator.class), |
| 157 | + ZoomOutLeft(ZoomOutLeftAnimator.class), |
| 158 | + ZoomOutRight(ZoomOutRightAnimator.class), |
| 159 | + ZoomOutUp(ZoomOutUpAnimator.class); |
| 160 | + |
| 161 | + private Class animatorClazz; |
| 162 | + |
| 163 | + private Techniques(Class clazz) { |
| 164 | + animatorClazz = clazz; |
| 165 | + } |
| 166 | + |
| 167 | + public BaseViewAnimator getAnimator() { |
| 168 | + try { |
| 169 | + return (BaseViewAnimator) animatorClazz.newInstance(); |
| 170 | + } catch (Exception e) { |
| 171 | + throw new Error("Can not init animatorClazz instance"); |
| 172 | + } |
| 173 | + } |
| 174 | +} |
0 commit comments