├── .gitignore ├── .travis.yml ├── License ├── README.md ├── build.gradle ├── demo ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── daimajia │ │ └── androidanimations │ │ ├── EffectAdapter.java │ │ ├── ExampleActivity.java │ │ └── MyActivity.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ ├── activity_my.xml │ ├── example.xml │ └── item.xml │ ├── menu │ └── my.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── gradle-mvn-push.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── daimajia │ │ └── androidanimations │ │ └── library │ │ ├── BaseViewAnimator.java │ │ ├── Techniques.java │ │ ├── YoYo.java │ │ ├── attention │ │ ├── BounceAnimator.java │ │ ├── FlashAnimator.java │ │ ├── PulseAnimator.java │ │ ├── RubberBandAnimator.java │ │ ├── ShakeAnimator.java │ │ ├── StandUpAnimator.java │ │ ├── SwingAnimator.java │ │ ├── TadaAnimator.java │ │ ├── WaveAnimator.java │ │ └── WobbleAnimator.java │ │ ├── bouncing_entrances │ │ ├── BounceInAnimator.java │ │ ├── BounceInDownAnimator.java │ │ ├── BounceInLeftAnimator.java │ │ ├── BounceInRightAnimator.java │ │ └── BounceInUpAnimator.java │ │ ├── fading_entrances │ │ ├── FadeInAnimator.java │ │ ├── FadeInDownAnimator.java │ │ ├── FadeInLeftAnimator.java │ │ ├── FadeInRightAnimator.java │ │ └── FadeInUpAnimator.java │ │ ├── fading_exits │ │ ├── FadeOutAnimator.java │ │ ├── FadeOutDownAnimator.java │ │ ├── FadeOutLeftAnimator.java │ │ ├── FadeOutRightAnimator.java │ │ └── FadeOutUpAnimator.java │ │ ├── flippers │ │ ├── FlipInXAnimator.java │ │ ├── FlipInYAnimator.java │ │ ├── FlipOutXAnimator.java │ │ └── FlipOutYAnimator.java │ │ ├── rotating_entrances │ │ ├── RotateInAnimator.java │ │ ├── RotateInDownLeftAnimator.java │ │ ├── RotateInDownRightAnimator.java │ │ ├── RotateInUpLeftAnimator.java │ │ └── RotateInUpRightAnimator.java │ │ ├── rotating_exits │ │ ├── RotateOutAnimator.java │ │ ├── RotateOutDownLeftAnimator.java │ │ ├── RotateOutDownRightAnimator.java │ │ ├── RotateOutUpLeftAnimator.java │ │ └── RotateOutUpRightAnimator.java │ │ ├── sliders │ │ ├── SlideInDownAnimator.java │ │ ├── SlideInLeftAnimator.java │ │ ├── SlideInRightAnimator.java │ │ ├── SlideInUpAnimator.java │ │ ├── SlideOutDownAnimator.java │ │ ├── SlideOutLeftAnimator.java │ │ ├── SlideOutRightAnimator.java │ │ └── SlideOutUpAnimator.java │ │ ├── specials │ │ ├── HingeAnimator.java │ │ ├── RollInAnimator.java │ │ ├── RollOutAnimator.java │ │ ├── in │ │ │ ├── DropOutAnimator.java │ │ │ └── LandingAnimator.java │ │ └── out │ │ │ └── TakingOffAnimator.java │ │ ├── zooming_entrances │ │ ├── ZoomInAnimator.java │ │ ├── ZoomInDownAnimator.java │ │ ├── ZoomInLeftAnimator.java │ │ ├── ZoomInRightAnimator.java │ │ └── ZoomInUpAnimator.java │ │ └── zooming_exits │ │ ├── ZoomOutAnimator.java │ │ ├── ZoomOutDownAnimator.java │ │ ├── ZoomOutLeftAnimator.java │ │ ├── ZoomOutRightAnimator.java │ │ └── ZoomOutUpAnimator.java │ └── res │ └── values │ └── strings.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | .DS_Store 5 | /build 6 | # built application files 7 | *.apk 8 | *.ap_ 9 | 10 | # files for the dex VM 11 | *.dex 12 | 13 | # Java class files 14 | *.class 15 | .DS_Store 16 | 17 | # generated files 18 | bin/ 19 | gen/ 20 | Wiki/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Eclipse project files 26 | .classpath 27 | .project 28 | .settings/ 29 | 30 | # Proguard folder generated by Eclipse 31 | proguard/ 32 | 33 | #Android Studio 34 | build/ 35 | 36 | # Intellij project files 37 | *.iml 38 | *.ipr 39 | *.iws 40 | .idea/ 41 | 42 | #gradle 43 | .gradle/ 44 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | android: 3 | components: 4 | - tools 5 | - platform-tools 6 | - build-tools-25.0.2 7 | - android-25 8 | - extra-android-support 9 | - extra 10 | - extra-android-m2repository 11 | script: 12 | - ./gradlew assembleDebug -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 daimajia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Android View Animations [](https://travis-ci.org/daimajia/AndroidViewAnimations) 2 | 3 | One day, I saw [an iOS library](https://github.com/ArtFeel/AFViewShaker), which is a view shaker, it's very beautiful. I think Android also need one, and should be better. 4 | 5 | So, I started to collect animation effects... and in two days, this project born. 6 | 7 | # Demo 8 | 9 |  10 | 11 | [Download Demo](https://github.com/daimajia/AndroidViewAnimations/releases/download/v1.1.2/AndroidViewAnimations-1.1.2.apk) 12 | # Usage 13 | 14 | > Since Version 2.0, NineOldAndroids has been removed. Thanks Jake Wharton. 15 | 16 | For making animations more real, I created another project named [Android Easing Functions](https://github.com/daimajia/AnimationEasingFunctions) which is an implementations of [easing functions](http://easings.net/) on Android. So, we need to dependent that project. 17 | 18 | ## Step 1 19 | 20 | #### Gradle 21 | ```groovy 22 | dependencies { 23 | implementation 'com.daimajia.androidanimations:library:2.4@aar' 24 | } 25 | ``` 26 | #### Maven 27 | 28 | ```xml 29 | <dependency> 30 | <groupId>com.daimajia.androidanimation</groupId> 31 | <artifactId>library</artifactId> 32 | <version>2.4</version> 33 | </dependency> 34 | ``` 35 | 36 | ## Step 2 37 | 38 | Just like play Yo-yo. 39 | 40 | ```java 41 | YoYo.with(Techniques.Tada) 42 | .duration(700) 43 | .repeat(5) 44 | .playOn(findViewById(R.id.edit_area)); 45 | ``` 46 | 47 | ### Effects 48 | #### Attension 49 | `Flash`, `Pulse`, `RubberBand`, `Shake`, `Swing`, `Wobble`, `Bounce`, `Tada`, `StandUp`, `Wave` 50 | 51 | #### Special 52 | `Hinge`, `RollIn`, `RollOut`,`Landing`,`TakingOff`,`DropOut` 53 | 54 | #### Bounce 55 | `BounceIn`, `BounceInDown`, `BounceInLeft`, `BounceInRight`, `BounceInUp` 56 | 57 | #### Fade 58 | `FadeIn`, `FadeInUp`, `FadeInDown`, `FadeInLeft`, `FadeInRight` 59 | 60 | `FadeOut`, `FadeOutDown`, `FadeOutLeft`, `FadeOutRight`, `FadeOutUp` 61 | 62 | #### Flip 63 | `FlipInX`, `FlipOutX`, `FlipOutY` 64 | 65 | #### Rotate 66 | `RotateIn`, `RotateInDownLeft`, `RotateInDownRight`, `RotateInUpLeft`, `RotateInUpRight` 67 | 68 | `RotateOut`, `RotateOutDownLeft`, `RotateOutDownRight`, `RotateOutUpLeft`, `RotateOutUpRight` 69 | 70 | #### Slide 71 | `SlideInLeft`, `SlideInRight`, `SlideInUp`, `SlideInDown` 72 | 73 | `SlideOutLeft`, `SlideOutRight`, `SlideOutUp`, `SlideOutDown` 74 | 75 | #### Zoom 76 | `ZoomIn`, `ZoomInDown`, `ZoomInLeft`, `ZoomInRight`, `ZoomInUp` 77 | 78 | `ZoomOut`, `ZoomOutDown`, `ZoomOutLeft`, `ZoomOutRight`, `ZoomOutUp` 79 | 80 | Welcome contribute your amazing animation effect. :-D 81 | 82 | # Thanks 83 | 84 | - [AFViewShaker](https://github.com/ArtFeel/AFViewShaker) 85 | - [Animate.css](https://github.com/daneden/animate.css) 86 | 87 | # Why YoYo? 88 | 89 | YoYo is a [toy](https://en.wikipedia.org/wiki/Yo-yo), with a lot of [Techniques](./library/src/main/java/com/daimajia/androidanimations/library/Techniques.java). 90 | 91 | # About me 92 | 93 | (2013) 94 | A student in mainland China. 95 | 96 | Welcome to [offer me an internship](mailto:daimajia@gmail.com). 97 | If you have any new idea about this project, feel free to [contact me](mailto:daimajia@gmail.com). 98 | 99 | (2019) 100 | Five years later, now I become an investment associate in China. 101 | 102 | Welcome to send your business plan to [me](mailto:daimajia@gmail.com). Maybe I would have a better understanding on your startup project than others. Trust me. 103 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | google() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:4.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | jcenter() 15 | google() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /demo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion COMPILE_SDK_VERSION.toInteger() 5 | 6 | defaultConfig { 7 | applicationId GROUP 8 | minSdkVersion MIN_SDK_VERSION.toInteger() 9 | targetSdkVersion TARGET_SDK_VERSION.toInteger() 10 | versionCode VERSION_CODE.toInteger() 11 | versionName VERSION_NAME 12 | } 13 | 14 | buildTypes { 15 | release { 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | 20 | lintOptions{ 21 | abortOnError false 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: 'libs', include: ['*.jar']) 27 | implementation project(':library') 28 | } 29 | -------------------------------------------------------------------------------- /demo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/Android Studio.app/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /demo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 | package="com.daimajia.androidanimations" > 4 | 5 | <application 6 | android:allowBackup="true" 7 | android:icon="@drawable/ic_launcher" 8 | android:label="@string/app_name" 9 | android:theme="@style/AppTheme" > 10 | <activity 11 | android:name=".MyActivity" 12 | android:label="@string/app_name" > 13 | <intent-filter> 14 | <action android:name="android.intent.action.MAIN" /> 15 | 16 | <category android:name="android.intent.category.LAUNCHER" /> 17 | </intent-filter> 18 | </activity> 19 | <activity android:name=".ExampleActivity"/> 20 | </application> 21 | 22 | </manifest> 23 | -------------------------------------------------------------------------------- /demo/src/main/java/com/daimajia/androidanimations/EffectAdapter.java: -------------------------------------------------------------------------------- 1 | package com.daimajia.androidanimations; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.BaseAdapter; 8 | import android.widget.TextView; 9 | 10 | import com.daimajia.androidanimations.library.Techniques; 11 | 12 | public class EffectAdapter extends BaseAdapter { 13 | 14 | private Context mContext; 15 | 16 | public EffectAdapter(Context context){ 17 | mContext = context; 18 | } 19 | 20 | @Override 21 | public int getCount() { 22 | return Techniques.values().length; 23 | } 24 | 25 | @Override 26 | public Object getItem(int position) { 27 | return Techniques.values()[position].getAnimator(); 28 | } 29 | 30 | @Override 31 | public long getItemId(int position) { 32 | return position; 33 | } 34 | 35 | @Override 36 | public View getView(final int position, View convertView, ViewGroup parent) { 37 | View v = LayoutInflater.from(mContext).inflate(R.layout.item,null,false); 38 | TextView t = (TextView)v.findViewById(R.id.list_item_text); 39 | Object o = getItem(position); 40 | int start = o.getClass().getName().lastIndexOf(".") + 1; 41 | String name = o.getClass().getName().substring(start); 42 | t.setText(name); 43 | v.setTag(Techniques.values()[position]); 44 | return v; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /demo/src/main/java/com/daimajia/androidanimations/ExampleActivity.java: -------------------------------------------------------------------------------- 1 | package com.daimajia.androidanimations; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.TextView; 7 | 8 | import com.daimajia.androidanimations.library.Techniques; 9 | import com.daimajia.androidanimations.library.YoYo; 10 | 11 | public class ExampleActivity extends Activity { 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.example); 16 | 17 | final TextView t = (TextView) findViewById(R.id.notice); 18 | t.setText("Please input your Email and Password"); 19 | 20 | findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() { 21 | @Override 22 | public void onClick(View v) { 23 | 24 | YoYo.with(Techniques.Tada) 25 | .duration(700) 26 | .playOn(findViewById(R.id.edit_area)); 27 | 28 | t.setText("Wrong password!"); 29 | } 30 | }); 31 | 32 | final TextView t2 = (TextView) findViewById(R.id.notice2); 33 | t2.setText("Please input your Email and Password"); 34 | 35 | findViewById(R.id.submit2).setOnClickListener(new View.OnClickListener() { 36 | @Override 37 | public void onClick(View v) { 38 | 39 | YoYo.with(Techniques.Shake).playOn(findViewById(R.id.edit_area2)); 40 | 41 | t2.setText("Wrong password!"); 42 | } 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /demo/src/main/java/com/daimajia/androidanimations/MyActivity.java: -------------------------------------------------------------------------------- 1 | package com.daimajia.androidanimations; 2 | 3 | import android.animation.Animator; 4 | import android.app.Activity; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.view.Menu; 8 | import android.view.MenuItem; 9 | import android.view.View; 10 | import android.view.animation.AccelerateDecelerateInterpolator; 11 | import android.widget.AdapterView; 12 | import android.widget.ListView; 13 | import android.widget.Toast; 14 | 15 | import com.daimajia.androidanimations.library.Techniques; 16 | import com.daimajia.androidanimations.library.YoYo; 17 | 18 | public class MyActivity extends Activity { 19 | 20 | private ListView mListView; 21 | private EffectAdapter mAdapter; 22 | private View mTarget; 23 | private YoYo.YoYoString rope; 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | setContentView(R.layout.activity_my); 29 | 30 | mListView = (ListView) findViewById(R.id.list_items); 31 | mTarget = findViewById(R.id.hello_world); 32 | 33 | mAdapter = new EffectAdapter(this); 34 | mListView.setAdapter(mAdapter); 35 | 36 | mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { 37 | @Override 38 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) { 39 | if (rope != null) { 40 | rope.stop(true); 41 | } 42 | Techniques technique = (Techniques) view.getTag(); 43 | rope = YoYo.with(technique) 44 | .duration(1200) 45 | .repeat(YoYo.INFINITE) 46 | .pivot(YoYo.CENTER_PIVOT, YoYo.CENTER_PIVOT) 47 | .interpolate(new AccelerateDecelerateInterpolator()) 48 | .withListener(new Animator.AnimatorListener() { 49 | @Override 50 | public void onAnimationStart(Animator animation) { 51 | 52 | } 53 | 54 | @Override 55 | public void onAnimationEnd(Animator animation) { 56 | } 57 | 58 | @Override 59 | public void onAnimationCancel(Animator animation) { 60 | Toast.makeText(MyActivity.this, "canceled previous animation", Toast.LENGTH_SHORT).show(); 61 | } 62 | 63 | @Override 64 | public void onAnimationRepeat(Animator animation) { 65 | 66 | } 67 | }) 68 | .playOn(mTarget); 69 | } 70 | }); 71 | findViewById(R.id.hello_world).setOnClickListener(new View.OnClickListener() { 72 | @Override 73 | public void onClick(View v) { 74 | if (rope != null) { 75 | rope.stop(true); 76 | } 77 | } 78 | }); 79 | } 80 | 81 | @Override 82 | public void onWindowFocusChanged(boolean hasFocus) { 83 | if (hasFocus) { 84 | rope = YoYo.with(Techniques.FadeIn).duration(1000).playOn(mTarget);// after start,just click mTarget view, rope is not init 85 | } 86 | } 87 | 88 | 89 | @Override 90 | public boolean onCreateOptionsMenu(Menu menu) { 91 | // Inflate the menu; this adds items to the action bar if it is present. 92 | getMenuInflater().inflate(R.menu.my, menu); 93 | return true; 94 | } 95 | 96 | @Override 97 | public boolean onOptionsItemSelected(MenuItem item) { 98 | // Handle action bar item clicks here. The action bar will 99 | // automatically handle clicks on the Home/Up button, so long 100 | // as you specify a parent activity in AndroidManifest.xml. 101 | int id = item.getItemId(); 102 | if (id == R.id.action_settings) { 103 | startActivity(new Intent(this, ExampleActivity.class)); 104 | return true; 105 | } 106 | return super.onOptionsItemSelected(item); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/AndroidViewAnimations/6a35c466d23e49c5cd174289ebe8d9ccdbc69044/demo/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/AndroidViewAnimations/6a35c466d23e49c5cd174289ebe8d9ccdbc69044/demo/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/AndroidViewAnimations/6a35c466d23e49c5cd174289ebe8d9ccdbc69044/demo/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/AndroidViewAnimations/6a35c466d23e49c5cd174289ebe8d9ccdbc69044/demo/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_my.xml: -------------------------------------------------------------------------------- 1 | 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 | xmlns:tools="http://schemas.android.com/tools" 4 | android:layout_width="match_parent" 5 | android:layout_height="match_parent" 6 | android:paddingLeft="@dimen/activity_horizontal_margin" 7 | android:paddingRight="@dimen/activity_horizontal_margin" 8 | android:paddingTop="@dimen/activity_vertical_margin" 9 | android:paddingBottom="@dimen/activity_vertical_margin" 10 | tools:context=".MyActivity"> 11 | 12 | <LinearLayout 13 | android:id="@+id/wrapper" 14 | android:layout_width="match_parent" 15 | android:layout_height="wrap_content"> 16 | <TextView 17 | android:gravity="center" 18 | android:layout_weight="1" 19 | android:padding="30dp" 20 | android:textSize="40sp" 21 | android:id="@+id/hello_world" 22 | android:text="@string/hello_world" 23 | android:layout_centerHorizontal="true" 24 | android:layout_width="wrap_content" 25 | android:layout_height="wrap_content" /> 26 | </LinearLayout> 27 | <ListView 28 | android:id="@+id/list_items" 29 | android:layout_below="@+id/wrapper" 30 | android:layout_width="wrap_content" 31 | android:layout_height="wrap_content"/> 32 | </RelativeLayout> -------------------------------------------------------------------------------- /demo/src/main/res/layout/example.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 3 | android:layout_width="match_parent" 4 | android:layout_height="match_parent"> 5 | 6 | <LinearLayout 7 | android:orientation="vertical" 8 | android:layout_width="match_parent" 9 | android:padding="@dimen/activity_horizontal_margin" 10 | android:layout_height="match_parent"> 11 | 12 | <LinearLayout 13 | android:padding="@dimen/activity_horizontal_margin" 14 | android:id="@+id/edit_area2" 15 | android:orientation="vertical" 16 | android:layout_width="match_parent" 17 | android:layout_height="wrap_content"> 18 | 19 | <EditText 20 | android:hint="Username" 21 | android:layout_width="match_parent" 22 | android:layout_height="wrap_content" /> 23 | 24 | <EditText 25 | android:hint="Password" 26 | android:layout_width="match_parent" 27 | android:layout_height="wrap_content" /> 28 | </LinearLayout> 29 | 30 | <LinearLayout 31 | android:padding="@dimen/activity_horizontal_margin" 32 | android:orientation="vertical" 33 | android:layout_width="wrap_content" 34 | android:layout_height="wrap_content"> 35 | 36 | <TextView 37 | android:id="@+id/notice2" 38 | android:layout_width="wrap_content" 39 | android:layout_height="wrap_content" /> 40 | 41 | <Button 42 | android:id="@+id/submit2" 43 | android:text="Submit" 44 | android:layout_width="wrap_content" 45 | android:layout_height="wrap_content" /> 46 | </LinearLayout> 47 | 48 | <LinearLayout 49 | android:padding="@dimen/activity_horizontal_margin" 50 | android:id="@+id/edit_area" 51 | android:orientation="vertical" 52 | android:layout_width="match_parent" 53 | android:layout_height="wrap_content"> 54 | 55 | <EditText 56 | android:hint="Username" 57 | android:layout_width="match_parent" 58 | android:layout_height="wrap_content" /> 59 | 60 | <EditText 61 | android:hint="Password" 62 | android:layout_width="match_parent" 63 | android:layout_height="wrap_content" /> 64 | </LinearLayout> 65 | 66 | <LinearLayout 67 | android:padding="@dimen/activity_horizontal_margin" 68 | android:orientation="vertical" 69 | android:layout_width="wrap_content" 70 | android:layout_height="wrap_content"> 71 | 72 | <TextView 73 | android:id="@+id/notice" 74 | android:layout_width="wrap_content" 75 | android:layout_height="wrap_content" /> 76 | 77 | <Button 78 | android:id="@+id/submit" 79 | android:text="Submit" 80 | android:layout_width="wrap_content" 81 | android:layout_height="wrap_content" /> 82 | </LinearLayout> 83 | 84 | </LinearLayout> 85 | 86 | </ScrollView> 87 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/item.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | 3 | <TextView xmlns:android="http://schemas.android.com/apk/res/android" 4 | android:layout_width="match_parent" 5 | android:layout_height="50dp" 6 | android:id="@+id/list_item_text" 7 | android:textSize="16sp" 8 | android:gravity="left|center_vertical" 9 | android:padding="10dp" /> -------------------------------------------------------------------------------- /demo/src/main/res/menu/my.xml: -------------------------------------------------------------------------------- 1 | <menu xmlns:android="http://schemas.android.com/apk/res/android" 2 | xmlns:tools="http://schemas.android.com/tools" 3 | xmlns:app="http://schemas.android.com/apk/res-auto" 4 | tools:context=".MyActivity" > 5 | <item android:id="@+id/action_settings" 6 | android:title="@string/action_example" 7 | android:orderInCategory="100" 8 | android:showAsAction="always" /> 9 | </menu> 10 | -------------------------------------------------------------------------------- /demo/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | <!-- Example customization of dimensions originally defined in res/values/dimens.xml 3 | (such as screen margins) for screens with more than 820dp of available width. This 4 | would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> 5 | <dimen name="activity_horizontal_margin">64dp</dimen> 6 | </resources> 7 | -------------------------------------------------------------------------------- /demo/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | <!-- Default screen margins, per the Android Design guidelines. --> 3 | <dimen name="activity_horizontal_margin">16dp</dimen> 4 | <dimen name="activity_vertical_margin">16dp</dimen> 5 | </resources> 6 | -------------------------------------------------------------------------------- /demo/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | 4 | <string name="app_name">AndroidAnimations</string> 5 | <string name="hello_world">Hello world!</string> 6 | <string name="action_example">Example</string> 7 | 8 | </resources> 9 | -------------------------------------------------------------------------------- /demo/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | 3 | <!-- Base application theme. --> 4 | <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar"> 5 | <!-- Customize your theme here. --> 6 | </style> 7 | 8 | </resources> 9 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | COMPILE_SDK_VERSION=29 21 | TARGET_SDK_VERSION=29 22 | MIN_SDK_VERSION=14 23 | 24 | VERSION_NAME=2.4 25 | VERSION_CODE=32 26 | GROUP=com.daimajia.androidanimations 27 | 28 | POM_DESCRIPTION=Collect android animations 29 | POM_URL=https://github.com/daimajia/AndroidAnimations 30 | POM_SCM_URL=https://github.com/daimajia/AndroidAnimations 31 | POM_SCM_CONNECTION=scm:https://github.com/daimajia/AndroidAnimations.git 32 | POM_SCM_DEV_CONNECTION=scm:https://github.com/daimajia/AndroidAnimations.git 33 | POM_LICENCE_NAME=MIT 34 | POM_LICENCE_URL=http://opensource.org/licenses/MIT 35 | POM_LICENCE_DIST=repo 36 | POM_DEVELOPER_ID=daimajia 37 | POM_DEVELOPER_NAME=daimajia 38 | 39 | android.useAndroidX=true 40 | android.enableJetifier=true 41 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimajia/AndroidViewAnimations/6a35c466d23e49c5cd174289ebe8d9ccdbc69044/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Aug 22 18:15:38 CST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)#39;` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion COMPILE_SDK_VERSION.toInteger() 5 | 6 | defaultConfig { 7 | minSdkVersion MIN_SDK_VERSION.toInteger() 8 | targetSdkVersion TARGET_SDK_VERSION.toInteger() 9 | versionCode VERSION_CODE.toInteger() 10 | versionName VERSION_NAME 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | consumerProguardFiles 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(dir: 'libs', include: ['*.jar']) 23 | implementation 'com.daimajia.easing:library:2.4@aar' 24 | implementation 'androidx.core:core:1.3.1' 25 | } 26 | 27 | apply from: './gradle-mvn-push.gradle' 28 | -------------------------------------------------------------------------------- /library/gradle-mvn-push.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Banes 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: 'maven' 18 | apply plugin: 'signing' 19 | 20 | def isReleaseBuild() { 21 | return VERSION_NAME.contains("SNAPSHOT") == false 22 | } 23 | 24 | def getReleaseRepositoryUrl() { 25 | return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL 26 | : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" 27 | } 28 | 29 | def getSnapshotRepositoryUrl() { 30 | return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL 31 | : "https://oss.sonatype.org/content/repositories/snapshots/" 32 | } 33 | 34 | def getRepositoryUsername() { 35 | return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" 36 | } 37 | 38 | def getRepositoryPassword() { 39 | return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" 40 | } 41 | 42 | afterEvaluate { project -> 43 | uploadArchives { 44 | repositories { 45 | mavenDeployer { 46 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } 47 | 48 | pom.groupId = GROUP 49 | pom.artifactId = POM_ARTIFACT_ID 50 | pom.version = VERSION_NAME 51 | 52 | repository(url: getReleaseRepositoryUrl()) { 53 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 54 | } 55 | snapshotRepository(url: getSnapshotRepositoryUrl()) { 56 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 57 | } 58 | 59 | pom.project { 60 | name POM_NAME 61 | packaging POM_PACKAGING 62 | description POM_DESCRIPTION 63 | url POM_URL 64 | 65 | scm { 66 | url POM_SCM_URL 67 | connection POM_SCM_CONNECTION 68 | developerConnection POM_SCM_DEV_CONNECTION 69 | } 70 | 71 | licenses { 72 | license { 73 | name POM_LICENCE_NAME 74 | url POM_LICENCE_URL 75 | distribution POM_LICENCE_DIST 76 | } 77 | } 78 | 79 | developers { 80 | developer { 81 | id POM_DEVELOPER_ID 82 | name POM_DEVELOPER_NAME 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | 90 | signing { 91 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } 92 | sign configurations.archives 93 | } 94 | 95 | task apklib(type: Zip){ 96 | appendix = extension = 'apklib' 97 | 98 | from 'AndroidManifest.xml' 99 | into('res') { 100 | from 'res' 101 | } 102 | into('src') { 103 | from 'src' 104 | } 105 | } 106 | 107 | task jar(type: Jar) { 108 | from android.sourceSets.main.java.srcDirs 109 | } 110 | 111 | task androidJavadocs(type: Javadoc) { 112 | source = android.sourceSets.main.java.srcDirs 113 | classpath += project.files(android.getBootClasspath() .join(File.pathSeparator)) 114 | } 115 | 116 | task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { 117 | classifier = 'javadoc' 118 | from androidJavadocs.destinationDir 119 | } 120 | 121 | task androidSourcesJar(type: Jar) { 122 | classifier = 'sources' 123 | from android.sourceSets.main.java.srcDirs 124 | } 125 | 126 | artifacts { 127 | archives androidSourcesJar 128 | archives androidJavadocsJar 129 | archives apklib 130 | archives jar 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /library/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | POM_NAME=AndroidAnimations Library 21 | POM_ARTIFACT_ID=library 22 | POM_PACKAGING=aar 23 | -------------------------------------------------------------------------------- /library/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/Android Studio.app/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -keep class com.daimajia.androidanimations.** { *; } 19 | -keep interface com.daimajia.androidanimations.** { *; } -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <manifest package="com.daimajia.androidanimations.library"> 2 | 3 | 4 | </manifest> 5 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/BaseViewAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library; 26 | 27 | import android.animation.Animator; 28 | import android.animation.AnimatorSet; 29 | import android.animation.ValueAnimator; 30 | import android.view.View; 31 | import android.view.animation.Interpolator; 32 | 33 | import androidx.core.view.ViewCompat; 34 | 35 | public abstract class BaseViewAnimator { 36 | 37 | public static final long DURATION = 1000; 38 | 39 | private AnimatorSet mAnimatorSet; 40 | 41 | private long mDuration = DURATION; 42 | private int mRepeatTimes = 0; 43 | private int mRepeatMode = ValueAnimator.RESTART; 44 | 45 | { 46 | mAnimatorSet = new AnimatorSet(); 47 | } 48 | 49 | 50 | protected abstract void prepare(View target); 51 | 52 | public BaseViewAnimator setTarget(View target) { 53 | reset(target); 54 | prepare(target); 55 | return this; 56 | } 57 | 58 | public void animate() { 59 | start(); 60 | } 61 | 62 | public void restart() { 63 | mAnimatorSet = mAnimatorSet.clone(); 64 | start(); 65 | } 66 | 67 | /** 68 | * reset the view to default status 69 | * 70 | * @param target 71 | */ 72 | public void reset(View target) { 73 | ViewCompat.setAlpha(target, 1); 74 | ViewCompat.setScaleX(target, 1); 75 | ViewCompat.setScaleY(target, 1); 76 | ViewCompat.setTranslationX(target, 0); 77 | ViewCompat.setTranslationY(target, 0); 78 | ViewCompat.setRotation(target, 0); 79 | ViewCompat.setRotationY(target, 0); 80 | ViewCompat.setRotationX(target, 0); 81 | } 82 | 83 | /** 84 | * start to animate 85 | */ 86 | public void start() { 87 | for (Animator animator : mAnimatorSet.getChildAnimations()) { 88 | if (animator instanceof ValueAnimator) { 89 | ((ValueAnimator) animator).setRepeatCount(mRepeatTimes); 90 | ((ValueAnimator) animator).setRepeatMode(mRepeatMode); 91 | } 92 | } 93 | mAnimatorSet.setDuration(mDuration); 94 | mAnimatorSet.start(); 95 | } 96 | 97 | public BaseViewAnimator setDuration(long duration) { 98 | mDuration = duration; 99 | return this; 100 | } 101 | 102 | public BaseViewAnimator setStartDelay(long delay) { 103 | getAnimatorAgent().setStartDelay(delay); 104 | return this; 105 | } 106 | 107 | public long getStartDelay() { 108 | return mAnimatorSet.getStartDelay(); 109 | } 110 | 111 | public BaseViewAnimator addAnimatorListener(Animator.AnimatorListener l) { 112 | mAnimatorSet.addListener(l); 113 | return this; 114 | } 115 | 116 | public void cancel() { 117 | mAnimatorSet.cancel(); 118 | } 119 | 120 | public boolean isRunning() { 121 | return mAnimatorSet.isRunning(); 122 | } 123 | 124 | public boolean isStarted() { 125 | return mAnimatorSet.isStarted(); 126 | } 127 | 128 | public void removeAnimatorListener(Animator.AnimatorListener l) { 129 | mAnimatorSet.removeListener(l); 130 | } 131 | 132 | public void removeAllListener() { 133 | mAnimatorSet.removeAllListeners(); 134 | } 135 | 136 | public BaseViewAnimator setInterpolator(Interpolator interpolator) { 137 | mAnimatorSet.setInterpolator(interpolator); 138 | return this; 139 | } 140 | 141 | public long getDuration() { 142 | return mDuration; 143 | } 144 | 145 | public AnimatorSet getAnimatorAgent() { 146 | return mAnimatorSet; 147 | } 148 | 149 | public BaseViewAnimator setRepeatTimes(int repeatTimes) { 150 | mRepeatTimes = repeatTimes; 151 | return this; 152 | } 153 | 154 | public BaseViewAnimator setRepeatMode(int repeatMode) { 155 | mRepeatMode = repeatMode; 156 | return this; 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/Techniques.java: -------------------------------------------------------------------------------- 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.FlipInYAnimator; 55 | import com.daimajia.androidanimations.library.flippers.FlipOutXAnimator; 56 | import com.daimajia.androidanimations.library.flippers.FlipOutYAnimator; 57 | import com.daimajia.androidanimations.library.rotating_entrances.RotateInAnimator; 58 | import com.daimajia.androidanimations.library.rotating_entrances.RotateInDownLeftAnimator; 59 | import com.daimajia.androidanimations.library.rotating_entrances.RotateInDownRightAnimator; 60 | import com.daimajia.androidanimations.library.rotating_entrances.RotateInUpLeftAnimator; 61 | import com.daimajia.androidanimations.library.rotating_entrances.RotateInUpRightAnimator; 62 | import com.daimajia.androidanimations.library.rotating_exits.RotateOutAnimator; 63 | import com.daimajia.androidanimations.library.rotating_exits.RotateOutDownLeftAnimator; 64 | import com.daimajia.androidanimations.library.rotating_exits.RotateOutDownRightAnimator; 65 | import com.daimajia.androidanimations.library.rotating_exits.RotateOutUpLeftAnimator; 66 | import com.daimajia.androidanimations.library.rotating_exits.RotateOutUpRightAnimator; 67 | import com.daimajia.androidanimations.library.sliders.SlideInDownAnimator; 68 | import com.daimajia.androidanimations.library.sliders.SlideInLeftAnimator; 69 | import com.daimajia.androidanimations.library.sliders.SlideInRightAnimator; 70 | import com.daimajia.androidanimations.library.sliders.SlideInUpAnimator; 71 | import com.daimajia.androidanimations.library.sliders.SlideOutDownAnimator; 72 | import com.daimajia.androidanimations.library.sliders.SlideOutLeftAnimator; 73 | import com.daimajia.androidanimations.library.sliders.SlideOutRightAnimator; 74 | import com.daimajia.androidanimations.library.sliders.SlideOutUpAnimator; 75 | import com.daimajia.androidanimations.library.specials.HingeAnimator; 76 | import com.daimajia.androidanimations.library.specials.RollInAnimator; 77 | import com.daimajia.androidanimations.library.specials.RollOutAnimator; 78 | import com.daimajia.androidanimations.library.specials.in.DropOutAnimator; 79 | import com.daimajia.androidanimations.library.specials.in.LandingAnimator; 80 | import com.daimajia.androidanimations.library.specials.out.TakingOffAnimator; 81 | import com.daimajia.androidanimations.library.zooming_entrances.ZoomInAnimator; 82 | import com.daimajia.androidanimations.library.zooming_entrances.ZoomInDownAnimator; 83 | import com.daimajia.androidanimations.library.zooming_entrances.ZoomInLeftAnimator; 84 | import com.daimajia.androidanimations.library.zooming_entrances.ZoomInRightAnimator; 85 | import com.daimajia.androidanimations.library.zooming_entrances.ZoomInUpAnimator; 86 | import com.daimajia.androidanimations.library.zooming_exits.ZoomOutAnimator; 87 | import com.daimajia.androidanimations.library.zooming_exits.ZoomOutDownAnimator; 88 | import com.daimajia.androidanimations.library.zooming_exits.ZoomOutLeftAnimator; 89 | import com.daimajia.androidanimations.library.zooming_exits.ZoomOutRightAnimator; 90 | import com.daimajia.androidanimations.library.zooming_exits.ZoomOutUpAnimator; 91 | 92 | public enum Techniques { 93 | 94 | DropOut(DropOutAnimator.class), 95 | Landing(LandingAnimator.class), 96 | TakingOff(TakingOffAnimator.class), 97 | 98 | Flash(FlashAnimator.class), 99 | Pulse(PulseAnimator.class), 100 | RubberBand(RubberBandAnimator.class), 101 | Shake(ShakeAnimator.class), 102 | Swing(SwingAnimator.class), 103 | Wobble(WobbleAnimator.class), 104 | Bounce(BounceAnimator.class), 105 | Tada(TadaAnimator.class), 106 | StandUp(StandUpAnimator.class), 107 | Wave(WaveAnimator.class), 108 | 109 | Hinge(HingeAnimator.class), 110 | RollIn(RollInAnimator.class), 111 | RollOut(RollOutAnimator.class), 112 | 113 | BounceIn(BounceInAnimator.class), 114 | BounceInDown(BounceInDownAnimator.class), 115 | BounceInLeft(BounceInLeftAnimator.class), 116 | BounceInRight(BounceInRightAnimator.class), 117 | BounceInUp(BounceInUpAnimator.class), 118 | 119 | FadeIn(FadeInAnimator.class), 120 | FadeInUp(FadeInUpAnimator.class), 121 | FadeInDown(FadeInDownAnimator.class), 122 | FadeInLeft(FadeInLeftAnimator.class), 123 | FadeInRight(FadeInRightAnimator.class), 124 | 125 | FadeOut(FadeOutAnimator.class), 126 | FadeOutDown(FadeOutDownAnimator.class), 127 | FadeOutLeft(FadeOutLeftAnimator.class), 128 | FadeOutRight(FadeOutRightAnimator.class), 129 | FadeOutUp(FadeOutUpAnimator.class), 130 | 131 | FlipInX(FlipInXAnimator.class), 132 | FlipOutX(FlipOutXAnimator.class), 133 | FlipInY(FlipInYAnimator.class), 134 | FlipOutY(FlipOutYAnimator.class), 135 | RotateIn(RotateInAnimator.class), 136 | RotateInDownLeft(RotateInDownLeftAnimator.class), 137 | RotateInDownRight(RotateInDownRightAnimator.class), 138 | RotateInUpLeft(RotateInUpLeftAnimator.class), 139 | RotateInUpRight(RotateInUpRightAnimator.class), 140 | 141 | RotateOut(RotateOutAnimator.class), 142 | RotateOutDownLeft(RotateOutDownLeftAnimator.class), 143 | RotateOutDownRight(RotateOutDownRightAnimator.class), 144 | RotateOutUpLeft(RotateOutUpLeftAnimator.class), 145 | RotateOutUpRight(RotateOutUpRightAnimator.class), 146 | 147 | SlideInLeft(SlideInLeftAnimator.class), 148 | SlideInRight(SlideInRightAnimator.class), 149 | SlideInUp(SlideInUpAnimator.class), 150 | SlideInDown(SlideInDownAnimator.class), 151 | 152 | SlideOutLeft(SlideOutLeftAnimator.class), 153 | SlideOutRight(SlideOutRightAnimator.class), 154 | SlideOutUp(SlideOutUpAnimator.class), 155 | SlideOutDown(SlideOutDownAnimator.class), 156 | 157 | ZoomIn(ZoomInAnimator.class), 158 | ZoomInDown(ZoomInDownAnimator.class), 159 | ZoomInLeft(ZoomInLeftAnimator.class), 160 | ZoomInRight(ZoomInRightAnimator.class), 161 | ZoomInUp(ZoomInUpAnimator.class), 162 | 163 | ZoomOut(ZoomOutAnimator.class), 164 | ZoomOutDown(ZoomOutDownAnimator.class), 165 | ZoomOutLeft(ZoomOutLeftAnimator.class), 166 | ZoomOutRight(ZoomOutRightAnimator.class), 167 | ZoomOutUp(ZoomOutUpAnimator.class); 168 | 169 | 170 | 171 | private Class animatorClazz; 172 | 173 | private Techniques(Class clazz) { 174 | animatorClazz = clazz; 175 | } 176 | 177 | public BaseViewAnimator getAnimator() { 178 | try { 179 | return (BaseViewAnimator) animatorClazz.newInstance(); 180 | } catch (Exception e) { 181 | throw new Error("Can not init animatorClazz instance"); 182 | } 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/YoYo.java: -------------------------------------------------------------------------------- 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 android.animation.Animator; 29 | import android.animation.ValueAnimator; 30 | import android.view.View; 31 | import android.view.animation.Interpolator; 32 | 33 | import androidx.core.view.ViewCompat; 34 | 35 | import java.util.ArrayList; 36 | import java.util.List; 37 | 38 | public class YoYo { 39 | 40 | private static final long DURATION = BaseViewAnimator.DURATION; 41 | private static final long NO_DELAY = 0; 42 | public static final int INFINITE = -1; 43 | public static final float CENTER_PIVOT = Float.MAX_VALUE; 44 | 45 | private BaseViewAnimator animator; 46 | private long duration; 47 | private long delay; 48 | private boolean repeat; 49 | private int repeatTimes; 50 | private int repeatMode; 51 | private Interpolator interpolator; 52 | private float pivotX, pivotY; 53 | private List<Animator.AnimatorListener> callbacks; 54 | private View target; 55 | 56 | private YoYo(AnimationComposer animationComposer) { 57 | animator = animationComposer.animator; 58 | duration = animationComposer.duration; 59 | delay = animationComposer.delay; 60 | repeat = animationComposer.repeat; 61 | repeatTimes = animationComposer.repeatTimes; 62 | repeatMode = animationComposer.repeatMode; 63 | interpolator = animationComposer.interpolator; 64 | pivotX = animationComposer.pivotX; 65 | pivotY = animationComposer.pivotY; 66 | callbacks = animationComposer.callbacks; 67 | target = animationComposer.target; 68 | } 69 | 70 | public static AnimationComposer with(Techniques techniques) { 71 | return new AnimationComposer(techniques); 72 | } 73 | 74 | public static AnimationComposer with(BaseViewAnimator animator) { 75 | return new AnimationComposer(animator); 76 | } 77 | 78 | public interface AnimatorCallback { 79 | public void call(Animator animator); 80 | } 81 | 82 | private static class EmptyAnimatorListener implements Animator.AnimatorListener { 83 | @Override 84 | public void onAnimationStart(Animator animation) { 85 | } 86 | 87 | @Override 88 | public void onAnimationEnd(Animator animation) { 89 | } 90 | 91 | @Override 92 | public void onAnimationCancel(Animator animation) { 93 | } 94 | 95 | @Override 96 | public void onAnimationRepeat(Animator animation) { 97 | } 98 | } 99 | 100 | public static final class AnimationComposer { 101 | 102 | private List<Animator.AnimatorListener> callbacks = new ArrayList<>(); 103 | 104 | private BaseViewAnimator animator; 105 | private long duration = DURATION; 106 | 107 | private long delay = NO_DELAY; 108 | private boolean repeat = false; 109 | private int repeatTimes = 0; 110 | private int repeatMode = ValueAnimator.RESTART; 111 | private float pivotX = YoYo.CENTER_PIVOT, pivotY = YoYo.CENTER_PIVOT; 112 | private Interpolator interpolator; 113 | private View target; 114 | 115 | private AnimationComposer(Techniques techniques) { 116 | this.animator = techniques.getAnimator(); 117 | } 118 | 119 | private AnimationComposer(BaseViewAnimator animator) { 120 | this.animator = animator; 121 | } 122 | 123 | public AnimationComposer duration(long duration) { 124 | this.duration = duration; 125 | return this; 126 | } 127 | 128 | public AnimationComposer delay(long delay) { 129 | this.delay = delay; 130 | return this; 131 | } 132 | 133 | public AnimationComposer interpolate(Interpolator interpolator) { 134 | this.interpolator = interpolator; 135 | return this; 136 | } 137 | 138 | public AnimationComposer pivot(float pivotX, float pivotY) { 139 | this.pivotX = pivotX; 140 | this.pivotY = pivotY; 141 | return this; 142 | } 143 | 144 | public AnimationComposer pivotX(float pivotX) { 145 | this.pivotX = pivotX; 146 | return this; 147 | } 148 | 149 | public AnimationComposer pivotY(float pivotY) { 150 | this.pivotY = pivotY; 151 | return this; 152 | } 153 | 154 | public AnimationComposer repeat(int times) { 155 | if (times < INFINITE) { 156 | throw new RuntimeException("Can not be less than -1, -1 is infinite loop"); 157 | } 158 | repeat = times != 0; 159 | repeatTimes = times; 160 | return this; 161 | } 162 | 163 | public AnimationComposer repeatMode(int mode) { 164 | repeatMode = mode; 165 | return this; 166 | } 167 | 168 | public AnimationComposer withListener(Animator.AnimatorListener listener) { 169 | callbacks.add(listener); 170 | return this; 171 | } 172 | 173 | public AnimationComposer onStart(final AnimatorCallback callback) { 174 | callbacks.add(new EmptyAnimatorListener() { 175 | @Override 176 | public void onAnimationStart(Animator animation) { 177 | callback.call(animation); 178 | } 179 | }); 180 | return this; 181 | } 182 | 183 | public AnimationComposer onEnd(final AnimatorCallback callback) { 184 | callbacks.add(new EmptyAnimatorListener() { 185 | @Override 186 | public void onAnimationEnd(Animator animation) { 187 | callback.call(animation); 188 | } 189 | }); 190 | return this; 191 | } 192 | 193 | public AnimationComposer onCancel(final AnimatorCallback callback) { 194 | callbacks.add(new EmptyAnimatorListener() { 195 | @Override 196 | public void onAnimationCancel(Animator animation) { 197 | callback.call(animation); 198 | } 199 | }); 200 | return this; 201 | } 202 | 203 | public AnimationComposer onRepeat(final AnimatorCallback callback) { 204 | callbacks.add(new EmptyAnimatorListener() { 205 | @Override 206 | public void onAnimationRepeat(Animator animation) { 207 | callback.call(animation); 208 | } 209 | }); 210 | return this; 211 | } 212 | 213 | public YoYoString playOn(View target) { 214 | this.target = target; 215 | return new YoYoString(new YoYo(this).play(), this.target); 216 | } 217 | 218 | } 219 | 220 | /** 221 | * YoYo string, you can use this string to control your YoYo. 222 | */ 223 | public static final class YoYoString { 224 | 225 | private BaseViewAnimator animator; 226 | private View target; 227 | 228 | private YoYoString(BaseViewAnimator animator, View target) { 229 | this.target = target; 230 | this.animator = animator; 231 | } 232 | 233 | public boolean isStarted() { 234 | return animator.isStarted(); 235 | } 236 | 237 | public boolean isRunning() { 238 | return animator.isRunning(); 239 | } 240 | 241 | public void stop() { 242 | stop(true); 243 | } 244 | 245 | public void stop(boolean reset) { 246 | animator.cancel(); 247 | 248 | if (reset) 249 | animator.reset(target); 250 | } 251 | } 252 | 253 | private BaseViewAnimator play() { 254 | animator.setTarget(target); 255 | 256 | if (pivotX == YoYo.CENTER_PIVOT) { 257 | ViewCompat.setPivotX(target, target.getMeasuredWidth() / 2.0f); 258 | } else { 259 | target.setPivotX(pivotX); 260 | } 261 | if (pivotY == YoYo.CENTER_PIVOT) { 262 | ViewCompat.setPivotY(target, target.getMeasuredHeight() / 2.0f); 263 | } else { 264 | target.setPivotY(pivotY); 265 | } 266 | 267 | animator.setDuration(duration) 268 | .setRepeatTimes(repeatTimes) 269 | .setRepeatMode(repeatMode) 270 | .setInterpolator(interpolator) 271 | .setStartDelay(delay); 272 | 273 | if (callbacks.size() > 0) { 274 | for (Animator.AnimatorListener callback : callbacks) { 275 | animator.addAnimatorListener(callback); 276 | } 277 | } 278 | animator.animate(); 279 | return animator; 280 | } 281 | 282 | } 283 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/BounceAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class BounceAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "translationY", 0, 0, -30, 0, -15, 0, 0) 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/FlashAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FlashAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0, 1, 0, 1) 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/PulseAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class PulseAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "scaleY", 1, 1.1f, 1), 37 | ObjectAnimator.ofFloat(target, "scaleX", 1, 1.1f, 1) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/RubberBandAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RubberBandAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "scaleX", 1, 1.25f, 0.75f, 1.15f, 1), 37 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.75f, 1.25f, 0.85f, 1) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/ShakeAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | 28 | import android.animation.ObjectAnimator; 29 | import android.view.View; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class ShakeAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "translationX", 0, 25, -25, 25, -25, 15, -15, 6, -6, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/StandUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | 33 | public class StandUpAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | float x = (target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()) / 2 37 | + target.getPaddingLeft(); 38 | float y = target.getHeight() - target.getPaddingBottom(); 39 | getAnimatorAgent().playTogether( 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y), 42 | ObjectAnimator.ofFloat(target, "rotationX", 55, -30, 15, -15, 0) 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/SwingAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class SwingAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "rotation", 0, 10, -10, 6, -6, 3, -3, 0) 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/TadaAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class TadaAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "scaleX", 1, 0.9f, 0.9f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1), 37 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.9f, 0.9f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1), 38 | ObjectAnimator.ofFloat(target, "rotation", 0, -3, -3, 3, -3, 3, -3, 3, -3, 0) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/WaveAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class WaveAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = (target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()) / 2 36 | + target.getPaddingLeft(); 37 | float y = target.getHeight() - target.getPaddingBottom(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "rotation", 12, -12, 3, -3, 0), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/attention/WobbleAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.attention; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class WobbleAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float width = target.getWidth(); 36 | float one = (float) (width / 100.0); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "translationX", 0 * one, -25 * one, 20 * one, -15 * one, 10 * one, -5 * one, 0 * one, 0), 39 | ObjectAnimator.ofFloat(target, "rotation", 0, -5, 3, -3, 2, -1, 0) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.bouncing_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class BounceInAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1, 1), 37 | ObjectAnimator.ofFloat(target, "scaleX", 0.3f, 1.05f, 0.9f, 1), 38 | ObjectAnimator.ofFloat(target, "scaleY", 0.3f, 1.05f, 0.9f, 1) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInDownAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.bouncing_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class BounceInDownAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1, 1), 37 | ObjectAnimator.ofFloat(target, "translationY", -target.getHeight(), 30, -10, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.bouncing_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class BounceInLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "translationX", -target.getWidth(), 30, -10, 0), 37 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1, 1) 38 | ); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.bouncing_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class BounceInRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "translationX", target.getMeasuredWidth() + target.getWidth(), -30, 10, 0), 37 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1, 1) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.bouncing_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class BounceInUpAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "translationY", target.getMeasuredHeight(), -30, 10, 0), 37 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1, 1) 38 | ); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeInAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1) 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInDownAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeInDownAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 37 | ObjectAnimator.ofFloat(target, "translationY", -target.getHeight() / 4, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeInLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 37 | ObjectAnimator.ofFloat(target, "translationX", -target.getWidth() / 4, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeInRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 37 | ObjectAnimator.ofFloat(target, "translationX", target.getWidth() / 4, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeInUpAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 37 | ObjectAnimator.ofFloat(target, "translationY", target.getHeight() / 4, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeOutAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0) 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutDownAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeOutDownAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "translationY", 0, target.getHeight() / 4) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeOutLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "translationX", 0, -target.getWidth() / 4) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeOutRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "translationX", 0, target.getWidth() / 4) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.fading_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FadeOutUpAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "translationY", 0, -target.getHeight() / 4) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/flippers/FlipInXAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.flippers; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FlipInXAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "rotationX", 90, -15, 15, 0), 37 | ObjectAnimator.ofFloat(target, "alpha", 0.25f, 0.5f, 0.75f, 1) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/flippers/FlipInYAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.flippers; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FlipInYAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "rotationY", 90, -15, 15, 0), 37 | ObjectAnimator.ofFloat(target, "alpha", 0.25f, 0.5f, 0.75f, 1) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/flippers/FlipOutXAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.flippers; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FlipOutXAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "rotationX", 0, 90), 37 | ObjectAnimator.ofFloat(target, "alpha", 1, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/flippers/FlipOutYAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.flippers; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class FlipOutYAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "rotationY", 0, 90), 37 | ObjectAnimator.ofFloat(target, "alpha", 1, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateInAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "rotation", -200, 0), 37 | ObjectAnimator.ofFloat(target, "alpha", 0, 1) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInDownLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateInDownLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getPaddingLeft(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "rotation", -90, 0), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInDownRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateInDownRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getWidth() - target.getPaddingRight(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "rotation", 90, 0), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInUpLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateInUpLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getPaddingLeft(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "rotation", 90, 0), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInUpRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateInUpRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getWidth() - target.getPaddingRight(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "rotation", -90, 0), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateOutAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "rotation", 0, 200) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutDownLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateOutDownLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getPaddingLeft(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 39 | ObjectAnimator.ofFloat(target, "rotation", 0, 90), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutDownRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateOutDownRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getWidth() - target.getPaddingRight(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 39 | ObjectAnimator.ofFloat(target, "rotation", 0, -90), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutUpLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateOutUpLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getPaddingLeft(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 39 | ObjectAnimator.ofFloat(target, "rotation", 0, -90), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutUpRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.rotating_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RotateOutUpRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | float x = target.getWidth() - target.getPaddingRight(); 36 | float y = target.getHeight() - target.getPaddingBottom(); 37 | getAnimatorAgent().playTogether( 38 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 39 | ObjectAnimator.ofFloat(target, "rotation", 0, 90), 40 | ObjectAnimator.ofFloat(target, "pivotX", x, x), 41 | ObjectAnimator.ofFloat(target, "pivotY", y, y) 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInDownAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class SlideInDownAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | int distance = target.getTop() + target.getHeight(); 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 38 | ObjectAnimator.ofFloat(target, "translationY", -distance, 0) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class SlideInLeftAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getWidth() - target.getLeft(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 40 | ObjectAnimator.ofFloat(target, "translationX", -distance, 0) 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class SlideInRightAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getWidth() - target.getLeft(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 40 | ObjectAnimator.ofFloat(target, "translationX", distance, 0) 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class SlideInUpAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getHeight() - target.getTop(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 40 | ObjectAnimator.ofFloat(target, "translationY", distance, 0) 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutDownAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class SlideOutDownAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getHeight() - target.getTop(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 40 | ObjectAnimator.ofFloat(target, "translationY", 0, distance) 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class SlideOutLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "translationX", 0, -target.getRight()) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class SlideOutRightAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getWidth() - target.getLeft(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 40 | ObjectAnimator.ofFloat(target, "translationX", 0, distance) 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.sliders; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class SlideOutUpAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "translationY", 0, -target.getBottom()) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/specials/HingeAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.specials; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | import com.daimajia.easing.Glider; 32 | import com.daimajia.easing.Skill; 33 | 34 | public class HingeAnimator extends BaseViewAnimator { 35 | @Override 36 | public void prepare(View target) { 37 | float x = target.getPaddingLeft(); 38 | float y = target.getPaddingTop(); 39 | getAnimatorAgent().playTogether( 40 | Glider.glide(Skill.SineEaseInOut, 1300, ObjectAnimator.ofFloat(target, "rotation", 0, 80, 60, 80, 60, 60)), 41 | ObjectAnimator.ofFloat(target, "translationY", 0, 0, 0, 0, 0, 700), 42 | ObjectAnimator.ofFloat(target, "alpha", 1, 1, 1, 1, 1, 0), 43 | ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x, x), 44 | ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y, y) 45 | ); 46 | 47 | setDuration(1300); 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/specials/RollInAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.specials; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RollInAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 37 | ObjectAnimator.ofFloat(target, "translationX", -(target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()), 0), 38 | ObjectAnimator.ofFloat(target, "rotation", -120, 0) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/specials/RollOutAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.specials; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class RollOutAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 37 | ObjectAnimator.ofFloat(target, "translationX", 0, target.getWidth()), 38 | ObjectAnimator.ofFloat(target, "rotation", 0, 120) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/specials/in/DropOutAnimator.java: -------------------------------------------------------------------------------- 1 | package com.daimajia.androidanimations.library.specials.in; 2 | 3 | import android.animation.ObjectAnimator; 4 | import android.view.View; 5 | 6 | import com.daimajia.androidanimations.library.BaseViewAnimator; 7 | import com.daimajia.easing.Glider; 8 | import com.daimajia.easing.Skill; 9 | 10 | public class DropOutAnimator extends BaseViewAnimator { 11 | @Override 12 | protected void prepare(View target) { 13 | int distance = target.getTop() + target.getHeight(); 14 | getAnimatorAgent().playTogether( 15 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 16 | Glider.glide(Skill.BounceEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "translationY", -distance, 0)) 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/specials/in/LandingAnimator.java: -------------------------------------------------------------------------------- 1 | package com.daimajia.androidanimations.library.specials.in; 2 | 3 | import android.animation.ObjectAnimator; 4 | import android.view.View; 5 | 6 | import com.daimajia.androidanimations.library.BaseViewAnimator; 7 | import com.daimajia.easing.Glider; 8 | import com.daimajia.easing.Skill; 9 | 10 | public class LandingAnimator extends BaseViewAnimator { 11 | @Override 12 | protected void prepare(View target) { 13 | getAnimatorAgent().playTogether( 14 | Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleX", 1.5f, 1f)), 15 | Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleY", 1.5f, 1f)), 16 | Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "alpha", 0, 1f)) 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/specials/out/TakingOffAnimator.java: -------------------------------------------------------------------------------- 1 | package com.daimajia.androidanimations.library.specials.out; 2 | 3 | import android.animation.ObjectAnimator; 4 | import android.view.View; 5 | 6 | import com.daimajia.androidanimations.library.BaseViewAnimator; 7 | import com.daimajia.easing.Glider; 8 | import com.daimajia.easing.Skill; 9 | 10 | public class TakingOffAnimator extends BaseViewAnimator { 11 | @Override 12 | protected void prepare(View target) { 13 | getAnimatorAgent().playTogether( 14 | Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleX", 1f, 1.5f)), 15 | Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleY", 1f, 1.5f)), 16 | Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "alpha", 1, 0)) 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class ZoomInAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "scaleX", 0.45f, 1), 37 | ObjectAnimator.ofFloat(target, "scaleY", 0.45f, 1), 38 | ObjectAnimator.ofFloat(target, "alpha", 0, 1) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInDownAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class ZoomInDownAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), 37 | ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), 38 | ObjectAnimator.ofFloat(target, "translationY", -target.getBottom(), 60, 0), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class ZoomInLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), 37 | ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), 38 | ObjectAnimator.ofFloat(target, "translationX", -target.getRight(), 48, 0), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class ZoomInRightAnimator extends BaseViewAnimator { 33 | @Override 34 | public void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), 37 | ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), 38 | ObjectAnimator.ofFloat(target, "translationX", target.getWidth() + target.getPaddingRight(), -48, 0), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_entrances; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class ZoomInUpAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getHeight() - target.getTop(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1), 40 | ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), 41 | ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), 42 | ObjectAnimator.ofFloat(target, "translationY", distance, -60, 0) 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class ZoomOutAnimator extends BaseViewAnimator { 33 | @Override 34 | protected void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 0, 0), 37 | ObjectAnimator.ofFloat(target, "scaleX", 1, 0.3f, 0), 38 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.3f, 0) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutDownAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class ZoomOutDownAnimator extends BaseViewAnimator { 34 | @Override 35 | protected void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getHeight() - target.getTop(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), 40 | ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), 41 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), 42 | ObjectAnimator.ofFloat(target, "translationY", 0, -60, distance) 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class ZoomOutLeftAnimator extends BaseViewAnimator { 33 | @Override 34 | protected void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), 37 | ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), 38 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), 39 | ObjectAnimator.ofFloat(target, "translationX", 0, 42, -target.getRight()) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutRightAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | import android.view.ViewGroup; 30 | 31 | import com.daimajia.androidanimations.library.BaseViewAnimator; 32 | 33 | public class ZoomOutRightAnimator extends BaseViewAnimator { 34 | @Override 35 | protected void prepare(View target) { 36 | ViewGroup parent = (ViewGroup) target.getParent(); 37 | int distance = parent.getWidth() - parent.getLeft(); 38 | getAnimatorAgent().playTogether( 39 | ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), 40 | ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), 41 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), 42 | ObjectAnimator.ofFloat(target, "translationX", 0, -42, distance) 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /library/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutUpAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.daimajia.androidanimations.library.zooming_exits; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.daimajia.androidanimations.library.BaseViewAnimator; 31 | 32 | public class ZoomOutUpAnimator extends BaseViewAnimator { 33 | @Override 34 | protected void prepare(View target) { 35 | getAnimatorAgent().playTogether( 36 | ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), 37 | ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), 38 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), 39 | ObjectAnimator.ofFloat(target, "translationY", 0, 60, -target.getBottom()) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | 4 | <!-- hack to prevent missing R.txt, it's pretty wired.--> 5 | <string name="android_animations_lib_name">AndroidAnimations</string> 6 | 7 | </resources> 8 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':library', 'demo' 2 | --------------------------------------------------------------------------------