Commit 46a9e52832c0a136163768bfac78d93c1fb6ef75
1 parent
ae727992
1 新增个人资料页
Showing
116 changed files
with
5026 additions
and
512 deletions
app/strike/src/main/AndroidManifest.xml
| ... | ... | @@ -17,13 +17,12 @@ |
| 17 | 17 | android:roundIcon="@mipmap/ic_launcher_round" |
| 18 | 18 | android:supportsRtl="true" |
| 19 | 19 | android:theme="@style/AppTheme"> |
| 20 | - | |
| 20 | + <activity android:name=".demo.activity.DemoAnimActivity" /> | |
| 21 | 21 | <activity |
| 22 | 22 | android:name=".LoginSuccessActivity" |
| 23 | 23 | android:label="UserAPI" |
| 24 | 24 | android:theme="@style/AppTheme.TranslucentFullScreenTheme" /> |
| 25 | 25 | <activity android:name=".demo.activity.DemoActivity" /> |
| 26 | - <activity android:name=".MyActivity"></activity> | |
| 27 | 26 | <activity android:name=".imgutil.ImgActivity" /> |
| 28 | 27 | <activity android:name=".MainActivity"> |
| 29 | 28 | |
| ... | ... | @@ -33,7 +32,6 @@ |
| 33 | 32 | <category android:name="android.intent.category.LAUNCHER" /> |
| 34 | 33 | </intent-filter> |
| 35 | 34 | </activity> |
| 36 | - <activity android:name=".MyActivityTest1" /> | |
| 37 | 35 | <activity android:name=".demo.activity.DemoMvpActivity" /> |
| 38 | 36 | |
| 39 | 37 | <meta-data | ... | ... |
app/strike/src/main/java/com/cnlive/strike/MyActivity.java deleted
100644 → 0
| 1 | -package com.cnlive.strike; | |
| 2 | - | |
| 3 | - | |
| 4 | -import android.content.Intent; | |
| 5 | -import android.text.TextUtils; | |
| 6 | -import android.view.View; | |
| 7 | - | |
| 8 | -import com.alibaba.android.arouter.facade.annotation.Route; | |
| 9 | -import com.cnlive.core.libs.base.frame.activity.BaseActivity; | |
| 10 | -import com.cnlive.core.libs.base.util.NetworkUtil; | |
| 11 | -import com.cnlive.moudle.collectionTrace.commonInfo.CollCommonInfo; | |
| 12 | -import com.cnlive.moudle.collectionTrace.ui.activity.RaceListActivity; | |
| 13 | -import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; | |
| 14 | -import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; | |
| 15 | -import com.cnlive.moudle.pedometer.ui.fragment.RunLineFragment; | |
| 16 | -import com.cnlive.strike.databinding.ActivityMyBinding; | |
| 17 | -import com.cnlive.strike.user.auth.UserService; | |
| 18 | -import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; | |
| 19 | - | |
| 20 | -@Route(path = "/strick/MyActivity") | |
| 21 | -public class MyActivity extends BaseActivity { | |
| 22 | - public ActivityMyBinding binding; | |
| 23 | - | |
| 24 | -// @Override | |
| 25 | -// protected int getBindLayoutId() { | |
| 26 | -// return R.layout.activity_my; | |
| 27 | -// } | |
| 28 | - | |
| 29 | -// @Override | |
| 30 | -// protected void initBindingData() { | |
| 31 | -// super.initBindingData(); | |
| 32 | -// binding = (ActivityMyBinding) baseBinding; | |
| 33 | -// } | |
| 34 | - | |
| 35 | - @Override | |
| 36 | - protected void initView() { | |
| 37 | -// loadRootFragment(new EmptyFragment()); | |
| 38 | - initXiaoJiaSoundBoxData(); | |
| 39 | - startActivity(new Intent(MyActivity.this, RunLineActivity.class)); | |
| 40 | -// RaceListActivity.newInstance(me, UserService.getUid(me), | |
| 41 | -// UserService.getInstance(me).getAppAccount().getNickName(), | |
| 42 | -// UserService.getInstance(me).getAppAccount().getFaceUrl()); | |
| 43 | -// finish(); | |
| 44 | -// binding.btnChange.setOnClickListener(new View.OnClickListener() { | |
| 45 | -// @Override | |
| 46 | -// public void onClick(View v) { | |
| 47 | -//// Bitmap bitmap=ImageUtils.drawable2Bitmap(getResources().getDrawable(R.mipmap.timg)); | |
| 48 | -// binding.btnChange.setText(NetworkUtil.getNetWorkType(me) + ""); | |
| 49 | -// binding.ivImg.setImageBitmap(screenShot()); | |
| 50 | -// startActivity(new Intent(MyActivity.this, RunLineActivity.class)); | |
| 51 | - | |
| 52 | -// WjjPay.passwordIsExisting(UserService.getUid(me), new NetCallBack<BaseResult<GroupBalanceInfo>>() { | |
| 53 | -// @Override | |
| 54 | -// public void onRequestState(int state) { | |
| 55 | -// | |
| 56 | -// } | |
| 57 | -// | |
| 58 | -// @Override | |
| 59 | -// public void onSuccess(BaseResult<GroupBalanceInfo> data) { | |
| 60 | -// QMUITipDialogUtil.successDialog(me, data.getErrorCode() + "" + data.getData().getBalance(), 5); | |
| 61 | -// } | |
| 62 | -// | |
| 63 | -// @Override | |
| 64 | -// public void onFailure(String errCode, String errMsg) { | |
| 65 | -// QMUITipDialogUtil.failedDialog(me, errMsg, 3); | |
| 66 | -// } | |
| 67 | -// }); | |
| 68 | -// WjjPay.setPassword(UserService.getUid(me), "123456", new NetCallBack<BaseResult>() { | |
| 69 | -// @Override | |
| 70 | -// public void onRequestState(int state) { | |
| 71 | -// if (state == HttpConn.ON_START) { | |
| 72 | -// QMUITipDialogUtil.loadingDialog(me, "修改中", true); | |
| 73 | -// } | |
| 74 | -// } | |
| 75 | -// | |
| 76 | -// @Override | |
| 77 | -// public void onSuccess(BaseResult data) { | |
| 78 | -// QMUITipDialogUtil.successDialog(me, data.getMessage(), 5); | |
| 79 | -// } | |
| 80 | -// | |
| 81 | -// @Override | |
| 82 | -// public void onFailure(String errCode, String errMsg) { | |
| 83 | -// QMUITipDialogUtil.failedDialog(me, errMsg, 3); | |
| 84 | -// } | |
| 85 | -// }); | |
| 86 | -// } | |
| 87 | -// }); | |
| 88 | - } | |
| 89 | - | |
| 90 | - @Override | |
| 91 | - protected void initData() { | |
| 92 | - } | |
| 93 | - | |
| 94 | - /** | |
| 95 | - * 初始化小家音箱数据 | |
| 96 | - */ | |
| 97 | - private void initXiaoJiaSoundBoxData() { | |
| 98 | -// XiaoJIaCommInfo.setUserId(this, "10514333"); | |
| 99 | -// XiaoJIaCommInfo.setUserPhone(this, "18301489586"); | |
| 100 | - if (!TextUtils.isEmpty(UserService.getUid(this))) { | |
| 101 | - XiaoJIaCommInfo.setUserId(this, UserService.getUid(this)); | |
| 102 | - } | |
| 103 | - if (null == UserService.getInstance(this).getAppAccount()) { | |
| 104 | - return; | |
| 105 | - } | |
| 106 | - if (null != UserService.getInstance(this).getAppAccount().getMobile() && !TextUtils.isEmpty(UserService.getInstance(this).getAppAccount().getMobile())) { | |
| 107 | - XiaoJIaCommInfo.setUserPhone(this, UserService.getInstance(this).getAppAccount().getMobile()); | |
| 108 | - } | |
| 109 | - if (!TextUtils.isEmpty(UserService.getInstance(this).getAppAccount().getFaceUrl())) { | |
| 110 | - XiaoJIaCommInfo.setUserIcon(this, UserService.getInstance(this).getAppAccount().getFaceUrl()); | |
| 111 | - } | |
| 112 | - if (!TextUtils.isEmpty(UserService.getInstance(this).getAppAccount().getNickName())) { | |
| 113 | - XiaoJIaCommInfo.setUserNickName(this, UserService.getInstance(this).getAppAccount().getNickName()); | |
| 114 | - } | |
| 115 | - if (null != UserService.getInstance(this).getAppAccount().getMobile() && !TextUtils.isEmpty(UserService.getInstance(this).getAppAccount().getMobile())) { | |
| 116 | - CommonInfo.setUserInfo(this, UserService.getUid(this), UserService.getInstance(this).getAppAccount().getNickName(), UserService.getInstance(this).getAppAccount().getFaceUrl(), UserService.getInstance(this).getAppAccount().getMobile()); | |
| 117 | - } | |
| 118 | - } | |
| 119 | -} |
app/strike/src/main/java/com/cnlive/strike/MyActivityTest1.java deleted
100644 → 0
| 1 | -package com.cnlive.strike; | |
| 2 | - | |
| 3 | -import com.cnlive.core.libs.base.frame.activity.BaseActivity; | |
| 4 | - | |
| 5 | - | |
| 6 | -public class MyActivityTest1 extends BaseActivity { | |
| 7 | - | |
| 8 | - @Override | |
| 9 | - protected int getViewLayoutId() { | |
| 10 | - return R.layout.activity_my1; | |
| 11 | - } | |
| 12 | - | |
| 13 | - @Override | |
| 14 | - protected void initView() { | |
| 15 | - getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyFragment1()).commitAllowingStateLoss(); | |
| 16 | - } | |
| 17 | - | |
| 18 | - @Override | |
| 19 | - protected void initData() { | |
| 20 | - } | |
| 21 | -} |
app/strike/src/main/java/com/cnlive/strike/MyFragment.java deleted
100644 → 0
| 1 | -package com.cnlive.strike; | |
| 2 | - | |
| 3 | - | |
| 4 | -import android.Manifest; | |
| 5 | -import android.os.Bundle; | |
| 6 | -import android.util.Log; | |
| 7 | -import android.view.View; | |
| 8 | -import android.widget.TextView; | |
| 9 | - | |
| 10 | -import com.cnlive.core.libs.base.frame.fragment.BaseFragment; | |
| 11 | -import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; | |
| 12 | -import com.cnlive.core.libs.base.util.QMUITipDialogUtil; | |
| 13 | -import com.cnlive.core.network.model.BaseResult; | |
| 14 | -import com.cnlive.core.network.HttpConn; | |
| 15 | -import com.cnlive.core.network.NetCallBack; | |
| 16 | -import com.cnlive.core.libs.base.util.StatusBarConfig; | |
| 17 | -import com.cnlive.core.network.request.BaseRequest; | |
| 18 | -import com.cnlive.strike.network.api.ApiService; | |
| 19 | -import com.cnlive.strike.network.bean.LetHimNoSeeBean; | |
| 20 | -import com.cnlive.strike.network.bean.TestBean; | |
| 21 | -import com.me.yokeyword.fragmentation.anim.DefaultVerticalAnimator; | |
| 22 | -import com.me.yokeyword.fragmentation.anim.FragmentAnimator; | |
| 23 | - | |
| 24 | -import org.greenrobot.eventbus.Subscribe; | |
| 25 | -import org.greenrobot.eventbus.ThreadMode; | |
| 26 | - | |
| 27 | -import java.util.HashMap; | |
| 28 | -import java.util.Map; | |
| 29 | - | |
| 30 | -import io.reactivex.Observable; | |
| 31 | -import io.reactivex.functions.Function; | |
| 32 | - | |
| 33 | - | |
| 34 | -public class MyFragment extends BaseFragment<MyFragmentView, MyPresenter> { | |
| 35 | - public TextView textView; | |
| 36 | - | |
| 37 | - @Override | |
| 38 | - protected int getViewLayoutId() { | |
| 39 | - return R.layout.activity_main1; | |
| 40 | - } | |
| 41 | - | |
| 42 | - @Override | |
| 43 | - protected void initView() { | |
| 44 | - super.initView(); | |
| 45 | - setSwipeBackEnable(true); | |
| 46 | - setStatusBarColor(R.color.green, 0); | |
| 47 | - setStatusBarTextColor(StatusBarConfig.BLACK); | |
| 48 | - textView = getBaseView().findViewById(R.id.tv1); | |
| 49 | - getBaseView().findViewById(R.id.btn_test2).setOnClickListener(new View.OnClickListener() { | |
| 50 | - @Override | |
| 51 | - public void onClick(View v) { | |
| 52 | - requestPermission(010001, "测试", new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, new OnPermissionResponseListener() { | |
| 53 | - @Override | |
| 54 | - public void onSuccess(String[] permissions) { | |
| 55 | - Log.e(TAG, "onSuccess: "); | |
| 56 | - } | |
| 57 | - | |
| 58 | - @Override | |
| 59 | - public void onFail() { | |
| 60 | - Log.e(TAG, "onFail: "); | |
| 61 | - } | |
| 62 | - }); | |
| 63 | - } | |
| 64 | - }); | |
| 65 | - getBaseView().findViewById(R.id.btn_test1).setOnClickListener(new View.OnClickListener() { | |
| 66 | - @Override | |
| 67 | - public void onClick(View v) { | |
| 68 | -// requestPermission(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, new OnPermissionResponseListener() { | |
| 69 | -// @Override | |
| 70 | -// public void onSuccess(String[] permissions) { | |
| 71 | -// Log.e(TAG, "onSuccess: "); | |
| 72 | -// } | |
| 73 | -// | |
| 74 | -// @Override | |
| 75 | -// public void onFail() { | |
| 76 | -// Log.e(TAG, "onFail: "); | |
| 77 | -// } | |
| 78 | -// }); | |
| 79 | - startForResult(new MyFragment1(), 1001); | |
| 80 | - } | |
| 81 | - }); | |
| 82 | - getBaseView().findViewById(R.id.btn_test).setOnClickListener(new View.OnClickListener() { | |
| 83 | - @Override | |
| 84 | - public void onClick(View v) { | |
| 85 | - //单个请求 | |
| 86 | - HttpConn.action( | |
| 87 | - BaseRequest | |
| 88 | - .init() | |
| 89 | - .setUrl("http://gank.io/api/data/") | |
| 90 | - .service(ApiService.class) | |
| 91 | - .getTest(), new NetCallBack<TestBean>() { | |
| 92 | - @Override | |
| 93 | - public void onRequestState(int state) { | |
| 94 | - | |
| 95 | - } | |
| 96 | - | |
| 97 | - @Override | |
| 98 | - public void onSuccess(TestBean data) { | |
| 99 | - Log.e(TAG, "onSuccess: " + data.getResults().size()); | |
| 100 | - } | |
| 101 | - | |
| 102 | - @Override | |
| 103 | - public void onFailure(String errCode, String errMsg) { | |
| 104 | - Log.e(TAG, "onFailure: " + errMsg); | |
| 105 | - } | |
| 106 | - } | |
| 107 | - ); | |
| 108 | - //多个请求 | |
| 109 | - Map<String, String> param = new HashMap<>(); | |
| 110 | - param.put("sid", "358916"); | |
| 111 | - HttpConn | |
| 112 | - .action( | |
| 113 | - BaseRequest | |
| 114 | - .init() | |
| 115 | - .setUrl("http://gank.io/api/data/") | |
| 116 | - .service(ApiService.class) | |
| 117 | - .getTest() | |
| 118 | - .concatMap(new Function<TestBean, Observable<BaseResult<LetHimNoSeeBean>>>() { | |
| 119 | - @Override | |
| 120 | - public Observable<BaseResult<LetHimNoSeeBean>> apply(TestBean testBean) throws Exception { | |
| 121 | - Log.e(TAG, "apply: " + testBean.getResults().size()); | |
| 122 | - return BaseRequest.init().service(ApiService.class).getLetHimNoSee(param); | |
| 123 | - } | |
| 124 | - }), new NetCallBack<BaseResult<LetHimNoSeeBean>>() { | |
| 125 | - @Override | |
| 126 | - public void onRequestState(int state) { | |
| 127 | - | |
| 128 | - } | |
| 129 | - | |
| 130 | - @Override | |
| 131 | - public void onSuccess(BaseResult<LetHimNoSeeBean> data) { | |
| 132 | - Log.e(TAG, "onSuccess: " + data.getData().getDoNotletFsids().size()); | |
| 133 | - } | |
| 134 | - | |
| 135 | - @Override | |
| 136 | - public void onFailure(String errCode, String errMsg) { | |
| 137 | - Log.e(TAG, "onFailure: " + errMsg); | |
| 138 | - } | |
| 139 | - }); | |
| 140 | - | |
| 141 | - | |
| 142 | - } | |
| 143 | - }); | |
| 144 | - getPresenter().setData("hha"); | |
| 145 | - getMvpView().setData("test"); | |
| 146 | - } | |
| 147 | - | |
| 148 | - @Override | |
| 149 | - public FragmentAnimator onCreateFragmentAnimator() { | |
| 150 | - return new DefaultVerticalAnimator(); | |
| 151 | - } | |
| 152 | - | |
| 153 | - @Override | |
| 154 | - public void onFragmentResult(int requestCode, int resultCode, Bundle data) { | |
| 155 | - super.onFragmentResult(requestCode, resultCode, data); | |
| 156 | - if (requestCode == 1001) { | |
| 157 | - setStatusBarColor(R.color.green, 0); | |
| 158 | - | |
| 159 | - if (null != data) { | |
| 160 | - logError(data.getString("test")); | |
| 161 | - } | |
| 162 | - } | |
| 163 | - } | |
| 164 | - | |
| 165 | - | |
| 166 | -} |
app/strike/src/main/java/com/cnlive/strike/MyFragment1.java deleted
100644 → 0
| 1 | -package com.cnlive.strike; | |
| 2 | - | |
| 3 | - | |
| 4 | -import android.os.Build; | |
| 5 | -import android.os.Bundle; | |
| 6 | -import android.util.Log; | |
| 7 | -import android.view.View; | |
| 8 | - | |
| 9 | -import com.cnlive.core.libs.base.frame.fragment.BaseFragment; | |
| 10 | -import com.cnlive.core.libs.base.util.StatusBarConfig; | |
| 11 | -import com.cnlive.core.network.HttpConn; | |
| 12 | -import com.cnlive.core.network.NetCallBack; | |
| 13 | -import com.cnlive.core.network.request.BaseRequest; | |
| 14 | -import com.cnlive.strike.network.api.ApiService; | |
| 15 | -import com.cnlive.strike.network.bean.TestBean; | |
| 16 | - | |
| 17 | - | |
| 18 | -public class MyFragment1 extends BaseFragment { | |
| 19 | - | |
| 20 | - | |
| 21 | - @Override | |
| 22 | - protected int getViewLayoutId() { | |
| 23 | - return R.layout.fragment_main1; | |
| 24 | - } | |
| 25 | - | |
| 26 | - @Override | |
| 27 | - protected void initView() { | |
| 28 | - super.initView(); | |
| 29 | - Bundle bundle = new Bundle(); | |
| 30 | - bundle.putString("test", "你好"); | |
| 31 | - setFragmentResult(1001, bundle); | |
| 32 | - | |
| 33 | - setStatusBarColor(R.color.qmui_config_color_red, 0); | |
| 34 | - setStatusBarTextColor(StatusBarConfig.BLACK); | |
| 35 | - getBaseView().findViewById(R.id.btn_test).setOnClickListener(new View.OnClickListener() { | |
| 36 | - @Override | |
| 37 | - public void onClick(View v) { | |
| 38 | - //单个请求 | |
| 39 | - HttpConn.action( | |
| 40 | - BaseRequest | |
| 41 | - .init() | |
| 42 | - .setUrl("http://gank.io/api/data/") | |
| 43 | - .service(ApiService.class) | |
| 44 | - .getTest(), new NetCallBack<TestBean>() { | |
| 45 | - @Override | |
| 46 | - public void onRequestState(int state) { | |
| 47 | - | |
| 48 | - } | |
| 49 | - | |
| 50 | - @Override | |
| 51 | - public void onSuccess(TestBean data) { | |
| 52 | - Log.e(TAG, "onSuccess: " + data.getResults().size()); | |
| 53 | - } | |
| 54 | - | |
| 55 | - @Override | |
| 56 | - public void onFailure(String errCode, String errMsg) { | |
| 57 | - Log.e(TAG, "onFailure: " + errMsg); | |
| 58 | - } | |
| 59 | - | |
| 60 | - }); | |
| 61 | - } | |
| 62 | - }); | |
| 63 | - | |
| 64 | - } | |
| 65 | -} |
app/strike/src/main/java/com/cnlive/strike/MyFragment1View.java deleted
100644 → 0
| 1 | -package com.cnlive.strike; | |
| 2 | - | |
| 3 | -import android.util.Log; | |
| 4 | - | |
| 5 | -import com.cnlive.core.libs.base.frame.view.BaseView; | |
| 6 | - | |
| 7 | -public class MyFragment1View extends BaseView { | |
| 8 | -// private MyFragment fragment; | |
| 9 | -// | |
| 10 | -// /** | |
| 11 | -// * 可给可不给,看自己需要 | |
| 12 | -// * | |
| 13 | -// * @param fragment | |
| 14 | -// */ | |
| 15 | - public MyFragment1View(MyFragment1 fragment) { | |
| 16 | -// this.fragment = fragment; | |
| 17 | - Log.e(TAG, "MyFragment1View: " + fragment); | |
| 18 | - } | |
| 19 | - | |
| 20 | - public void setData1(String msg) { | |
| 21 | - Log.e(TAG, "setData1: "); | |
| 22 | - } | |
| 23 | -} |
app/strike/src/main/java/com/cnlive/strike/MyFragmentView.java deleted
100644 → 0
| 1 | -package com.cnlive.strike; | |
| 2 | - | |
| 3 | -import com.cnlive.core.libs.base.frame.view.BaseView; | |
| 4 | - | |
| 5 | -public class MyFragmentView extends BaseView { | |
| 6 | - MyFragment fragment; | |
| 7 | - | |
| 8 | - public MyFragmentView(MyFragment fragment) { | |
| 9 | - this.fragment = fragment; | |
| 10 | - } | |
| 11 | - | |
| 12 | - public void setData(String msg) { | |
| 13 | - fragment.textView.setText(msg); | |
| 14 | - } | |
| 15 | -} |
app/strike/src/main/java/com/cnlive/strike/MyPresenter.java deleted
100644 → 0
app/strike/src/main/java/com/cnlive/strike/MyPresenter1.java deleted
100644 → 0
app/strike/src/main/java/com/cnlive/strike/demo/activity/DemoActivity.java
| 1 | 1 | package com.cnlive.strike.demo.activity; |
| 2 | 2 | |
| 3 | -import android.Manifest; | |
| 4 | -import android.util.Log; | |
| 5 | -import android.view.View; | |
| 6 | - | |
| 7 | 3 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 8 | -import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; | |
| 9 | 4 | import com.cnlive.core.libs.base.util.StatusBarConfig; |
| 10 | -import com.cnlive.strike.MyFragment; | |
| 11 | 5 | import com.cnlive.strike.R; |
| 12 | -import com.cnlive.strike.base.BuildConfig; | |
| 13 | 6 | |
| 14 | 7 | /** |
| 15 | 8 | * 继承BaseActivity |
| ... | ... | @@ -77,71 +70,6 @@ public class DemoActivity extends BaseActivity { |
| 77 | 70 | //px2dp |
| 78 | 71 | px2dp(10); |
| 79 | 72 | |
| 80 | - loadRootFragment(new MyFragment()); | |
| 81 | - | |
| 82 | -// String[] permissions = new String[]{Manifest.permission.ACCESS_FINE_LOCATION, | |
| 83 | -// Manifest.permission.ACCESS_COARSE_LOCATION}; | |
| 84 | -// //请求权限(默认提示语的) | |
| 85 | -// requestPermission(permissions, new OnPermissionResponseListener() { | |
| 86 | -// @Override | |
| 87 | -// public void onSuccess(String[] permissions) { | |
| 88 | -// | |
| 89 | -// } | |
| 90 | -// | |
| 91 | -// @Override | |
| 92 | -// public void onFail() { | |
| 93 | -// | |
| 94 | -// } | |
| 95 | -// }); | |
| 96 | -// //请求权限,自定义状态码,使用默认提示语 | |
| 97 | -// requestPermission(1001, permissions, new OnPermissionResponseListener() { | |
| 98 | -// @Override | |
| 99 | -// public void onSuccess(String[] permissions) { | |
| 100 | -// | |
| 101 | -// } | |
| 102 | -// | |
| 103 | -// @Override | |
| 104 | -// public void onFail() { | |
| 105 | -// | |
| 106 | -// } | |
| 107 | -// }); | |
| 108 | -// //请求权限,自定义状态码,自定义拒绝提示语 | |
| 109 | -// requestPermission(1001, "拒绝提示语", permissions, new OnPermissionResponseListener() { | |
| 110 | -// @Override | |
| 111 | -// public void onSuccess(String[] permissions) { | |
| 112 | -// | |
| 113 | -// } | |
| 114 | -// | |
| 115 | -// @Override | |
| 116 | -// public void onFail() { | |
| 117 | -// | |
| 118 | -// } | |
| 119 | -// }); | |
| 120 | - | |
| 121 | -// findViewById(R.id.go_to1).setOnClickListener(new View.OnClickListener() { | |
| 122 | -// @Override | |
| 123 | -// public void onClick(View v) { | |
| 124 | -// logError("Ada"); | |
| 125 | -// loadRootFragment(R.id.fl_container,new MyFragment()); | |
| 126 | -//// start(new MyFragment()); | |
| 127 | -// } | |
| 128 | -// }); | |
| 129 | -// findViewById(R.id.go_to2).setOnClickListener(new View.OnClickListener() { | |
| 130 | -// @Override | |
| 131 | -// public void onClick(View v) { | |
| 132 | -// requestPermission(10010, "拒绝我了", new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, new OnPermissionResponseListener() { | |
| 133 | -// @Override | |
| 134 | -// public void onSuccess(String[] permissions) { | |
| 135 | -// Log.e(TAG, "onSuccess: "); | |
| 136 | -// } | |
| 137 | -// | |
| 138 | -// @Override | |
| 139 | -// public void onFail() { | |
| 140 | -// Log.e(TAG, "onFail: "); | |
| 141 | -// } | |
| 142 | -// }); | |
| 143 | -// } | |
| 144 | -// }); | |
| 145 | 73 | } |
| 146 | 74 | |
| 147 | 75 | /** | ... | ... |
app/strike/src/main/java/com/cnlive/strike/demo/activity/DemoAnimActivity.java
0 → 100644
| 1 | +package com.cnlive.strike.demo.activity; | |
| 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.cnlive.core.libs.base.frame.activity.BaseActivity; | |
| 16 | +import com.cnlive.strike.R; | |
| 17 | +import com.daimajia.androidanimations.library.Techniques; | |
| 18 | +import com.daimajia.androidanimations.library.YoYo; | |
| 19 | + | |
| 20 | +public class DemoAnimActivity extends BaseActivity { | |
| 21 | + | |
| 22 | + private ListView mListView; | |
| 23 | + private EffectAdapter mAdapter; | |
| 24 | + private View mTarget; | |
| 25 | + private YoYo.YoYoString rope; | |
| 26 | + | |
| 27 | + @Override | |
| 28 | + protected int getViewLayoutId() { | |
| 29 | + return R.layout.activity_demo_anim; | |
| 30 | + } | |
| 31 | + | |
| 32 | + @Override | |
| 33 | + protected void initView() { | |
| 34 | + super.initView(); | |
| 35 | + mListView = (ListView) findViewById(R.id.list_items); | |
| 36 | + mTarget = findViewById(R.id.hello_world); | |
| 37 | + | |
| 38 | + mAdapter = new EffectAdapter(this); | |
| 39 | + mListView.setAdapter(mAdapter); | |
| 40 | + | |
| 41 | + mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
| 42 | + @Override | |
| 43 | + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | |
| 44 | + if (rope != null) { | |
| 45 | + rope.stop(true); | |
| 46 | + } | |
| 47 | + Techniques technique = (Techniques) view.getTag(); | |
| 48 | + rope = YoYo.with(technique) | |
| 49 | + .duration(1200) | |
| 50 | + .repeat(YoYo.INFINITE) | |
| 51 | + .pivot(YoYo.CENTER_PIVOT, YoYo.CENTER_PIVOT) | |
| 52 | + .interpolate(new AccelerateDecelerateInterpolator()) | |
| 53 | + .withListener(new Animator.AnimatorListener() { | |
| 54 | + @Override | |
| 55 | + public void onAnimationStart(Animator animation) { | |
| 56 | + | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Override | |
| 60 | + public void onAnimationEnd(Animator animation) { | |
| 61 | + } | |
| 62 | + | |
| 63 | + @Override | |
| 64 | + public void onAnimationCancel(Animator animation) { | |
| 65 | + Toast.makeText(DemoAnimActivity.this, "canceled previous animation", Toast.LENGTH_SHORT).show(); | |
| 66 | + } | |
| 67 | + | |
| 68 | + @Override | |
| 69 | + public void onAnimationRepeat(Animator animation) { | |
| 70 | + | |
| 71 | + } | |
| 72 | + }) | |
| 73 | + .playOn(mTarget); | |
| 74 | + } | |
| 75 | + }); | |
| 76 | + findViewById(R.id.hello_world).setOnClickListener(new View.OnClickListener() { | |
| 77 | + @Override | |
| 78 | + public void onClick(View v) { | |
| 79 | + if (rope != null) { | |
| 80 | + rope.stop(true); | |
| 81 | + } | |
| 82 | + } | |
| 83 | + }); | |
| 84 | + | |
| 85 | + } | |
| 86 | + | |
| 87 | + | |
| 88 | + @Override | |
| 89 | + public void onWindowFocusChanged(boolean hasFocus) { | |
| 90 | + if (hasFocus) { | |
| 91 | + rope = YoYo.with(Techniques.FadeIn).duration(1000).playOn(mTarget);// after start,just click mTarget view, rope is not init | |
| 92 | + } | |
| 93 | + } | |
| 94 | + | |
| 95 | +} | ... | ... |
app/strike/src/main/java/com/cnlive/strike/demo/activity/DemoFragment.java
| 1 | 1 | package com.cnlive.strike.demo.activity; |
| 2 | 2 | |
| 3 | 3 | import android.os.Handler; |
| 4 | -import android.os.Message; | |
| 5 | - | |
| 6 | -import androidx.annotation.NonNull; | |
| 7 | 4 | |
| 8 | 5 | import com.cnlive.core.libs.base.frame.fragment.BaseFragment; |
| 9 | 6 | import com.cnlive.core.libs.base.util.QMUITipDialogUtil; |
| 10 | -import com.cnlive.strike.MyFragment; | |
| 11 | - | |
| 12 | -import org.greenrobot.eventbus.Subscribe; | |
| 13 | -import org.greenrobot.eventbus.ThreadMode; | |
| 14 | 7 | |
| 15 | 8 | import java.util.Observable; |
| 16 | 9 | ... | ... |
app/strike/src/main/java/com/cnlive/strike/demo/activity/DemoMvpActivity.java
| 1 | 1 | package com.cnlive.strike.demo.activity; |
| 2 | 2 | |
| 3 | +import android.Manifest; | |
| 3 | 4 | import android.content.Intent; |
| 5 | +import android.os.Handler; | |
| 6 | +import android.os.Message; | |
| 4 | 7 | import android.text.TextUtils; |
| 5 | 8 | import android.view.View; |
| 6 | 9 | |
| 10 | +import androidx.annotation.NonNull; | |
| 11 | + | |
| 7 | 12 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 13 | +import com.cnlive.core.libs.base.interfaces.OnPermissionResponseListener; | |
| 14 | +import com.cnlive.core.libs.base.util.QMUITipDialogUtil; | |
| 8 | 15 | import com.cnlive.moudle.collectionTrace.ui.activity.RaceListActivity; |
| 9 | 16 | import com.cnlive.moudle.pedometer.commonInfo.CommonInfo; |
| 10 | 17 | import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; |
| ... | ... | @@ -21,9 +28,15 @@ import com.cnlive.strike.user.ui.activity.PersonalDataActivity; |
| 21 | 28 | import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; |
| 22 | 29 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.AllDeviceActivity; |
| 23 | 30 | |
| 31 | +import org.greenrobot.eventbus.Subscribe; | |
| 32 | +import org.greenrobot.eventbus.ThreadMode; | |
| 33 | + | |
| 34 | +import java.util.Observable; | |
| 35 | + | |
| 24 | 36 | |
| 25 | 37 | public class DemoMvpActivity extends BaseActivity<DemoActivityView, DemoActivityPresenter> { |
| 26 | 38 | public ActivityDemoMvpMainBinding binding; |
| 39 | + private String[] permission = new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}; | |
| 27 | 40 | |
| 28 | 41 | @Override |
| 29 | 42 | protected void initBindingData() { |
| ... | ... | @@ -113,5 +126,179 @@ public class DemoMvpActivity extends BaseActivity<DemoActivityView, DemoActivity |
| 113 | 126 | UserService.getInstance(me).getAppAccount().getFaceUrl()); |
| 114 | 127 | } |
| 115 | 128 | }); |
| 129 | + //获取Handler,onDestory自动解除 | |
| 130 | + binding.btnHandler.setOnClickListener(new View.OnClickListener() { | |
| 131 | + @Override | |
| 132 | + public void onClick(View v) { | |
| 133 | + Handler myHandler = getMyActHandler(); | |
| 134 | + myHandler.sendEmptyMessage(123); | |
| 135 | + } | |
| 136 | + }); | |
| 137 | + | |
| 138 | + //注册Eventbus | |
| 139 | + binding.btnEventbus.setOnClickListener(new View.OnClickListener() { | |
| 140 | + @Override | |
| 141 | + public void onClick(View v) { | |
| 142 | + registerEventBus(); | |
| 143 | + postEvent("发送的postEvent"); | |
| 144 | +// postStickyEvent("发送的粘性postEvent"); | |
| 145 | + } | |
| 146 | + }); | |
| 147 | + //添加观察者,onDestory自动解除 | |
| 148 | + binding.btnObser.setOnClickListener(new View.OnClickListener() { | |
| 149 | + @Override | |
| 150 | + public void onClick(View v) { | |
| 151 | + addObservable(MyOb.getInstance(),MyOb.getInstance(),MyOb.getInstance()); | |
| 152 | + MyOb.getInstance().noti("观察者信息"); | |
| 153 | + } | |
| 154 | + }); | |
| 155 | + //动画特效 | |
| 156 | + binding.btnAnim.setOnClickListener(new View.OnClickListener() { | |
| 157 | + @Override | |
| 158 | + public void onClick(View v) { | |
| 159 | + startActivity(new Intent(me, DemoAnimActivity.class)); | |
| 160 | + } | |
| 161 | + }); | |
| 162 | + | |
| 163 | + //默认权限申请 | |
| 164 | + binding.btnDefaultPermiss.setOnClickListener(new View.OnClickListener() { | |
| 165 | + @Override | |
| 166 | + public void onClick(View v) { | |
| 167 | + requestPermission(permission, new OnPermissionResponseListener() { | |
| 168 | + @Override | |
| 169 | + public void onSuccess(String[] permissions) { | |
| 170 | + | |
| 171 | + } | |
| 172 | + | |
| 173 | + @Override | |
| 174 | + public void onFail() { | |
| 175 | + | |
| 176 | + } | |
| 177 | + }); | |
| 178 | + } | |
| 179 | + }); | |
| 180 | + //默认权限申请,有提示框,拒绝后关闭当前activity | |
| 181 | + binding.btnDefaultCloseHasDailog.setOnClickListener(new View.OnClickListener() { | |
| 182 | + @Override | |
| 183 | + public void onClick(View v) { | |
| 184 | + requestPermission(true, permission, new OnPermissionResponseListener() { | |
| 185 | + @Override | |
| 186 | + public void onSuccess(String[] permissions) { | |
| 187 | + | |
| 188 | + } | |
| 189 | + | |
| 190 | + @Override | |
| 191 | + public void onFail() { | |
| 192 | + | |
| 193 | + } | |
| 194 | + }); | |
| 195 | + } | |
| 196 | + }); | |
| 197 | + //默认权限申请,无提示框,拒绝后关闭当前activity | |
| 198 | + binding.btnDefaultCloseNoDailog.setOnClickListener(new View.OnClickListener() { | |
| 199 | + @Override | |
| 200 | + public void onClick(View v) { | |
| 201 | + requestPermission(true, permission, false, new OnPermissionResponseListener() { | |
| 202 | + @Override | |
| 203 | + public void onSuccess(String[] permissions) { | |
| 204 | + | |
| 205 | + } | |
| 206 | + | |
| 207 | + @Override | |
| 208 | + public void onFail() { | |
| 209 | + | |
| 210 | + } | |
| 211 | + }); | |
| 212 | + } | |
| 213 | + }); | |
| 214 | + //默认权限申请,无提示框 | |
| 215 | + binding.btnDefaultPermissNo.setOnClickListener(new View.OnClickListener() { | |
| 216 | + @Override | |
| 217 | + public void onClick(View v) { | |
| 218 | + requestPermission(permission, false, new OnPermissionResponseListener() { | |
| 219 | + @Override | |
| 220 | + public void onSuccess(String[] permissions) { | |
| 221 | + | |
| 222 | + } | |
| 223 | + | |
| 224 | + @Override | |
| 225 | + public void onFail() { | |
| 226 | + | |
| 227 | + } | |
| 228 | + }); | |
| 229 | + } | |
| 230 | + }); | |
| 231 | + //默认权限申请,自定义申请码 | |
| 232 | + binding.btnDefaultPermissCode.setOnClickListener(new View.OnClickListener() { | |
| 233 | + @Override | |
| 234 | + public void onClick(View v) { | |
| 235 | + requestPermission(1001, permission, new OnPermissionResponseListener() { | |
| 236 | + @Override | |
| 237 | + public void onSuccess(String[] permissions) { | |
| 238 | + | |
| 239 | + } | |
| 240 | + | |
| 241 | + @Override | |
| 242 | + public void onFail() { | |
| 243 | + | |
| 244 | + } | |
| 245 | + }); | |
| 246 | + } | |
| 247 | + }); | |
| 248 | + //默认权限申请,自定义申请码,自定义提示语 | |
| 249 | + binding.btnDefaultPermissCodeTip.setOnClickListener(new View.OnClickListener() { | |
| 250 | + @Override | |
| 251 | + public void onClick(View v) { | |
| 252 | + requestPermission(1001, "我的提示语", permission, new OnPermissionResponseListener() { | |
| 253 | + @Override | |
| 254 | + public void onSuccess(String[] permissions) { | |
| 255 | + | |
| 256 | + } | |
| 257 | + | |
| 258 | + @Override | |
| 259 | + public void onFail() { | |
| 260 | + | |
| 261 | + } | |
| 262 | + }); | |
| 263 | + } | |
| 264 | + }); | |
| 265 | + //默认权限申请,自定义提示语 | |
| 266 | + binding.btnDefaultPermissTip.setOnClickListener(new View.OnClickListener() { | |
| 267 | + @Override | |
| 268 | + public void onClick(View v) { | |
| 269 | + requestPermission("我的提示语", permission, new OnPermissionResponseListener() { | |
| 270 | + @Override | |
| 271 | + public void onSuccess(String[] permissions) { | |
| 272 | + | |
| 273 | + } | |
| 274 | + | |
| 275 | + @Override | |
| 276 | + public void onFail() { | |
| 277 | + | |
| 278 | + } | |
| 279 | + }); | |
| 280 | + } | |
| 281 | + }); | |
| 282 | + } | |
| 283 | + | |
| 284 | + @Subscribe(threadMode = ThreadMode.MAIN) | |
| 285 | + public void onMainEvent(String s) { | |
| 286 | + QMUITipDialogUtil.textDialog(me, s, 2); | |
| 287 | + } | |
| 288 | + | |
| 289 | + @Override | |
| 290 | + public void onReceiveActHandleMessage(@NonNull Message msg) { | |
| 291 | + super.onReceiveActHandleMessage(msg); | |
| 292 | + if (msg.what == 123) { | |
| 293 | + QMUITipDialogUtil.textDialog(me, "发送的一条空消息", 2); | |
| 294 | + } | |
| 295 | + } | |
| 296 | + | |
| 297 | + @Override | |
| 298 | + public void update(Observable o, Object data) { | |
| 299 | + super.update(o, data); | |
| 300 | + if (o instanceof MyOb){ | |
| 301 | + QMUITipDialogUtil.textDialog(me, (String) data, 2); | |
| 302 | + } | |
| 116 | 303 | } |
| 117 | 304 | } | ... | ... |
app/strike/src/main/java/com/cnlive/strike/demo/activity/EffectAdapter.java
0 → 100644
| 1 | +package com.cnlive.strike.demo.activity; | |
| 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.cnlive.strike.R; | |
| 11 | +import com.daimajia.androidanimations.library.Techniques; | |
| 12 | + | |
| 13 | +public class EffectAdapter extends BaseAdapter { | |
| 14 | + | |
| 15 | + private Context mContext; | |
| 16 | + | |
| 17 | + public EffectAdapter(Context context){ | |
| 18 | + mContext = context; | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public int getCount() { | |
| 23 | + return Techniques.values().length; | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public Object getItem(int position) { | |
| 28 | + return Techniques.values()[position].getAnimator(); | |
| 29 | + } | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public long getItemId(int position) { | |
| 33 | + return position; | |
| 34 | + } | |
| 35 | + | |
| 36 | + @Override | |
| 37 | + public View getView(final int position, View convertView, ViewGroup parent) { | |
| 38 | + View v = LayoutInflater.from(mContext).inflate(R.layout.item_demo_anim,null,false); | |
| 39 | + TextView t = (TextView)v.findViewById(R.id.list_item_text); | |
| 40 | + Object o = getItem(position); | |
| 41 | + int start = o.getClass().getName().lastIndexOf(".") + 1; | |
| 42 | + String name = o.getClass().getName().substring(start); | |
| 43 | + t.setText(name); | |
| 44 | + v.setTag(Techniques.values()[position]); | |
| 45 | + return v; | |
| 46 | + } | |
| 47 | +} | ... | ... |
app/strike/src/main/res/layout/activity_demo_anim.xml
0 → 100644
| 1 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 2 | + xmlns:tools="http://schemas.android.com/tools" | |
| 3 | + android:layout_width="match_parent" | |
| 4 | + android:layout_height="match_parent" | |
| 5 | + android:paddingLeft="@dimen/activity_horizontal_margin" | |
| 6 | + android:paddingTop="@dimen/activity_vertical_margin" | |
| 7 | + android:paddingRight="@dimen/activity_horizontal_margin" | |
| 8 | + android:paddingBottom="@dimen/activity_vertical_margin" | |
| 9 | + tools:context=".MyActivity"> | |
| 10 | + | |
| 11 | + <LinearLayout | |
| 12 | + android:id="@+id/wrapper" | |
| 13 | + android:layout_width="match_parent" | |
| 14 | + android:layout_height="wrap_content"> | |
| 15 | + | |
| 16 | + <TextView | |
| 17 | + android:id="@+id/hello_world" | |
| 18 | + android:layout_width="wrap_content" | |
| 19 | + android:layout_height="wrap_content" | |
| 20 | + android:layout_centerHorizontal="true" | |
| 21 | + android:layout_weight="1" | |
| 22 | + android:gravity="center" | |
| 23 | + android:padding="30dp" | |
| 24 | + android:text="hello world" | |
| 25 | + android:textSize="40sp" /> | |
| 26 | + </LinearLayout> | |
| 27 | + | |
| 28 | + <ListView | |
| 29 | + android:id="@+id/list_items" | |
| 30 | + android:layout_width="wrap_content" | |
| 31 | + android:layout_height="wrap_content" | |
| 32 | + android:layout_below="@+id/wrapper" /> | |
| 33 | +</RelativeLayout> | |
| 0 | 34 | \ No newline at end of file | ... | ... |
app/strike/src/main/res/layout/activity_demo_mvp_main.xml
| ... | ... | @@ -63,6 +63,83 @@ |
| 63 | 63 | android:layout_height="wrap_content" |
| 64 | 64 | android:layout_margin="5dp" |
| 65 | 65 | android:text="路径工具" /> |
| 66 | + | |
| 67 | + <Button | |
| 68 | + android:id="@+id/btn_handler" | |
| 69 | + android:layout_width="match_parent" | |
| 70 | + android:layout_height="wrap_content" | |
| 71 | + android:layout_margin="5dp" | |
| 72 | + android:text="获取Handler,onDestory自动解除" /> | |
| 73 | + | |
| 74 | + <Button | |
| 75 | + android:id="@+id/btn_eventbus" | |
| 76 | + android:layout_width="match_parent" | |
| 77 | + android:layout_height="wrap_content" | |
| 78 | + android:layout_margin="5dp" | |
| 79 | + android:text="注册Eventbus,onDestory自动解除" /> | |
| 80 | + | |
| 81 | + <Button | |
| 82 | + android:id="@+id/btn_obser" | |
| 83 | + android:layout_width="match_parent" | |
| 84 | + android:layout_height="wrap_content" | |
| 85 | + android:layout_margin="5dp" | |
| 86 | + android:text="添加观察者,onDestory自动解除" /> | |
| 87 | + | |
| 88 | + <Button | |
| 89 | + android:id="@+id/btn_anim" | |
| 90 | + android:layout_width="match_parent" | |
| 91 | + android:layout_height="wrap_content" | |
| 92 | + android:layout_margin="5dp" | |
| 93 | + android:text="动画特效" /> | |
| 94 | + | |
| 95 | + <Button | |
| 96 | + android:id="@+id/btn_default_permiss" | |
| 97 | + android:layout_width="match_parent" | |
| 98 | + android:layout_height="wrap_content" | |
| 99 | + android:layout_margin="5dp" | |
| 100 | + android:text="默认权限申请" /> | |
| 101 | + | |
| 102 | + <Button | |
| 103 | + android:id="@+id/btn_default_close_has_dailog" | |
| 104 | + android:layout_width="match_parent" | |
| 105 | + android:layout_height="wrap_content" | |
| 106 | + android:layout_margin="5dp" | |
| 107 | + android:text="默认权限申请,有提示框,拒绝后关闭当前activity" /> | |
| 108 | + | |
| 109 | + <Button | |
| 110 | + android:id="@+id/btn_default_close_no_dailog" | |
| 111 | + android:layout_width="match_parent" | |
| 112 | + android:layout_height="wrap_content" | |
| 113 | + android:layout_margin="5dp" | |
| 114 | + android:text="默认权限申请,无提示框,拒绝后关闭当前activity" /> | |
| 115 | + | |
| 116 | + <Button | |
| 117 | + android:id="@+id/btn_default_permiss_no" | |
| 118 | + android:layout_width="match_parent" | |
| 119 | + android:layout_height="wrap_content" | |
| 120 | + android:layout_margin="5dp" | |
| 121 | + android:text="默认权限申请,无拒绝提示框" /> | |
| 122 | + | |
| 123 | + <Button | |
| 124 | + android:id="@+id/btn_default_permiss_code" | |
| 125 | + android:layout_width="match_parent" | |
| 126 | + android:layout_height="wrap_content" | |
| 127 | + android:layout_margin="5dp" | |
| 128 | + android:text="默认权限申请,自定义申请码" /> | |
| 129 | + | |
| 130 | + <Button | |
| 131 | + android:id="@+id/btn_default_permiss_tip" | |
| 132 | + android:layout_width="match_parent" | |
| 133 | + android:layout_height="wrap_content" | |
| 134 | + android:layout_margin="5dp" | |
| 135 | + android:text="默认权限申请,自定义提示语" /> | |
| 136 | + | |
| 137 | + <Button | |
| 138 | + android:id="@+id/btn_default_permiss_code_tip" | |
| 139 | + android:layout_width="match_parent" | |
| 140 | + android:layout_height="wrap_content" | |
| 141 | + android:layout_margin="5dp" | |
| 142 | + android:text="默认权限申请,自定义申请码,自定义提示语" /> | |
| 66 | 143 | </LinearLayout> |
| 67 | 144 | </androidx.core.widget.NestedScrollView> |
| 68 | 145 | </LinearLayout> | ... | ... |
app/strike/src/main/res/layout/item_demo_anim.xml
0 → 100644
| 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" /> | |
| 0 | 10 | \ No newline at end of file | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/BaseViewAnimator.java
0 → 100644
| 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 | + | |
| 36 | +public abstract class BaseViewAnimator { | |
| 37 | + | |
| 38 | + public static final long DURATION = 1000; | |
| 39 | + | |
| 40 | + private AnimatorSet mAnimatorSet; | |
| 41 | + | |
| 42 | + private long mDuration = DURATION; | |
| 43 | + private int mRepeatTimes = 0; | |
| 44 | + private int mRepeatMode = ValueAnimator.RESTART; | |
| 45 | + | |
| 46 | + { | |
| 47 | + mAnimatorSet = new AnimatorSet(); | |
| 48 | + } | |
| 49 | + | |
| 50 | + | |
| 51 | + protected abstract void prepare(View target); | |
| 52 | + | |
| 53 | + public BaseViewAnimator setTarget(View target) { | |
| 54 | + reset(target); | |
| 55 | + prepare(target); | |
| 56 | + return this; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void animate() { | |
| 60 | + start(); | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void restart() { | |
| 64 | + mAnimatorSet = mAnimatorSet.clone(); | |
| 65 | + start(); | |
| 66 | + } | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * reset the view to default status | |
| 70 | + * | |
| 71 | + * @param target | |
| 72 | + */ | |
| 73 | + public void reset(View target) { | |
| 74 | + ViewCompat.setAlpha(target, 1); | |
| 75 | + ViewCompat.setScaleX(target, 1); | |
| 76 | + ViewCompat.setScaleY(target, 1); | |
| 77 | + ViewCompat.setTranslationX(target, 0); | |
| 78 | + ViewCompat.setTranslationY(target, 0); | |
| 79 | + ViewCompat.setRotation(target, 0); | |
| 80 | + ViewCompat.setRotationY(target, 0); | |
| 81 | + ViewCompat.setRotationX(target, 0); | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * start to animate | |
| 86 | + */ | |
| 87 | + public void start() { | |
| 88 | + for (Animator animator : mAnimatorSet.getChildAnimations()) { | |
| 89 | + if (animator instanceof ValueAnimator) { | |
| 90 | + ((ValueAnimator) animator).setRepeatCount(mRepeatTimes); | |
| 91 | + ((ValueAnimator) animator).setRepeatMode(mRepeatMode); | |
| 92 | + } | |
| 93 | + } | |
| 94 | + mAnimatorSet.setDuration(mDuration); | |
| 95 | + mAnimatorSet.start(); | |
| 96 | + } | |
| 97 | + | |
| 98 | + public BaseViewAnimator setDuration(long duration) { | |
| 99 | + mDuration = duration; | |
| 100 | + return this; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public BaseViewAnimator setStartDelay(long delay) { | |
| 104 | + getAnimatorAgent().setStartDelay(delay); | |
| 105 | + return this; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public long getStartDelay() { | |
| 109 | + return mAnimatorSet.getStartDelay(); | |
| 110 | + } | |
| 111 | + | |
| 112 | + public BaseViewAnimator addAnimatorListener(Animator.AnimatorListener l) { | |
| 113 | + mAnimatorSet.addListener(l); | |
| 114 | + return this; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void cancel() { | |
| 118 | + mAnimatorSet.cancel(); | |
| 119 | + } | |
| 120 | + | |
| 121 | + public boolean isRunning() { | |
| 122 | + return mAnimatorSet.isRunning(); | |
| 123 | + } | |
| 124 | + | |
| 125 | + public boolean isStarted() { | |
| 126 | + return mAnimatorSet.isStarted(); | |
| 127 | + } | |
| 128 | + | |
| 129 | + public void removeAnimatorListener(Animator.AnimatorListener l) { | |
| 130 | + mAnimatorSet.removeListener(l); | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void removeAllListener() { | |
| 134 | + mAnimatorSet.removeAllListeners(); | |
| 135 | + } | |
| 136 | + | |
| 137 | + public BaseViewAnimator setInterpolator(Interpolator interpolator) { | |
| 138 | + mAnimatorSet.setInterpolator(interpolator); | |
| 139 | + return this; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public long getDuration() { | |
| 143 | + return mDuration; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public AnimatorSet getAnimatorAgent() { | |
| 147 | + return mAnimatorSet; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public BaseViewAnimator setRepeatTimes(int repeatTimes) { | |
| 151 | + mRepeatTimes = repeatTimes; | |
| 152 | + return this; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public BaseViewAnimator setRepeatMode(int repeatMode) { | |
| 156 | + mRepeatMode = repeatMode; | |
| 157 | + return this; | |
| 158 | + } | |
| 159 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/Techniques.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/YoYo.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/BounceAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/FlashAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/PulseAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/RubberBandAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/ShakeAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/StandUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/SwingAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/TadaAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/WaveAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/attention/WobbleAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInDownAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInLeftAnimator.java
0 → 100644
| 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 | + | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/bouncing_entrances/BounceInUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInDownAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_entrances/FadeInUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutDownAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/fading_exits/FadeOutUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/flippers/FlipInXAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/flippers/FlipInYAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/flippers/FlipOutXAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/flippers/FlipOutYAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInDownLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInDownRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInUpLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_entrances/RotateInUpRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutDownLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutDownRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutUpLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/rotating_exits/RotateOutUpRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInDownAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutDownAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/sliders/SlideOutUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/specials/HingeAnimator.java
0 → 100644
| 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 | + | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/specials/RollInAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/specials/RollOutAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/specials/in/DropOutAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/specials/in/LandingAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/specials/out/TakingOffAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInDownAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_entrances/ZoomInUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutDownAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutLeftAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutRightAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/androidanimations/library/zooming_exits/ZoomOutUpAnimator.java
0 → 100644
| 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 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/BaseEasingMethod.java
0 → 100644
| 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.easing; | |
| 26 | + | |
| 27 | + | |
| 28 | +import android.animation.TypeEvaluator; | |
| 29 | + | |
| 30 | +import java.util.ArrayList; | |
| 31 | + | |
| 32 | +public abstract class BaseEasingMethod implements TypeEvaluator<Number> { | |
| 33 | + protected float mDuration; | |
| 34 | + | |
| 35 | + private ArrayList<EasingListener> mListeners = new ArrayList<EasingListener>(); | |
| 36 | + | |
| 37 | + public interface EasingListener { | |
| 38 | + public void on(float time, float value, float start, float end, float duration); | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void addEasingListener(EasingListener l){ | |
| 42 | + mListeners.add(l); | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void addEasingListeners(EasingListener ...ls){ | |
| 46 | + for(EasingListener l : ls){ | |
| 47 | + mListeners.add(l); | |
| 48 | + } | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void removeEasingListener(EasingListener l){ | |
| 52 | + mListeners.remove(l); | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void clearEasingListeners(){ | |
| 56 | + mListeners.clear(); | |
| 57 | + } | |
| 58 | + | |
| 59 | + public BaseEasingMethod(float duration){ | |
| 60 | + mDuration = duration; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setDuration(float duration) { | |
| 64 | + mDuration = duration; | |
| 65 | + } | |
| 66 | + | |
| 67 | + | |
| 68 | + @Override | |
| 69 | + public final Float evaluate(float fraction, Number startValue, Number endValue){ | |
| 70 | + float t = mDuration * fraction; | |
| 71 | + float b = startValue.floatValue(); | |
| 72 | + float c = endValue.floatValue() - startValue.floatValue(); | |
| 73 | + float d = mDuration; | |
| 74 | + float result = calculate(t,b,c,d); | |
| 75 | + for(EasingListener l : mListeners){ | |
| 76 | + l.on(t,result,b,c,d); | |
| 77 | + } | |
| 78 | + return result; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public abstract Float calculate(float t, float b, float c, float d); | |
| 82 | + | |
| 83 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/Glider.java
0 → 100644
| 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.easing; | |
| 26 | + | |
| 27 | + | |
| 28 | +import android.animation.PropertyValuesHolder; | |
| 29 | +import android.animation.ValueAnimator; | |
| 30 | + | |
| 31 | +public class Glider { | |
| 32 | + | |
| 33 | + public static ValueAnimator glide(Skill skill, float duration, ValueAnimator animator) { | |
| 34 | + return Glider.glide(skill, duration, animator, (BaseEasingMethod.EasingListener[]) null); | |
| 35 | + } | |
| 36 | + | |
| 37 | + public static ValueAnimator glide(Skill skill, float duration, ValueAnimator animator, BaseEasingMethod.EasingListener... listeners) { | |
| 38 | + BaseEasingMethod t = skill.getMethod(duration); | |
| 39 | + | |
| 40 | + if (listeners != null) | |
| 41 | + t.addEasingListeners(listeners); | |
| 42 | + | |
| 43 | + animator.setEvaluator(t); | |
| 44 | + return animator; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public static PropertyValuesHolder glide(Skill skill, float duration, PropertyValuesHolder propertyValuesHolder) { | |
| 48 | + propertyValuesHolder.setEvaluator(skill.getMethod(duration)); | |
| 49 | + return propertyValuesHolder; | |
| 50 | + } | |
| 51 | + | |
| 52 | + | |
| 53 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/Skill.java
0 → 100644
| 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.easing; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.back.BackEaseIn; | |
| 28 | +import com.daimajia.easing.back.BackEaseInOut; | |
| 29 | +import com.daimajia.easing.back.BackEaseOut; | |
| 30 | +import com.daimajia.easing.bounce.BounceEaseIn; | |
| 31 | +import com.daimajia.easing.bounce.BounceEaseInOut; | |
| 32 | +import com.daimajia.easing.bounce.BounceEaseOut; | |
| 33 | +import com.daimajia.easing.circ.CircEaseIn; | |
| 34 | +import com.daimajia.easing.circ.CircEaseInOut; | |
| 35 | +import com.daimajia.easing.circ.CircEaseOut; | |
| 36 | +import com.daimajia.easing.cubic.CubicEaseIn; | |
| 37 | +import com.daimajia.easing.cubic.CubicEaseInOut; | |
| 38 | +import com.daimajia.easing.cubic.CubicEaseOut; | |
| 39 | +import com.daimajia.easing.elastic.ElasticEaseIn; | |
| 40 | +import com.daimajia.easing.elastic.ElasticEaseOut; | |
| 41 | +import com.daimajia.easing.expo.ExpoEaseIn; | |
| 42 | +import com.daimajia.easing.expo.ExpoEaseInOut; | |
| 43 | +import com.daimajia.easing.expo.ExpoEaseOut; | |
| 44 | +import com.daimajia.easing.quad.QuadEaseIn; | |
| 45 | +import com.daimajia.easing.quad.QuadEaseInOut; | |
| 46 | +import com.daimajia.easing.quad.QuadEaseOut; | |
| 47 | +import com.daimajia.easing.quint.QuintEaseIn; | |
| 48 | +import com.daimajia.easing.quint.QuintEaseInOut; | |
| 49 | +import com.daimajia.easing.quint.QuintEaseOut; | |
| 50 | +import com.daimajia.easing.sine.SineEaseIn; | |
| 51 | +import com.daimajia.easing.sine.SineEaseInOut; | |
| 52 | +import com.daimajia.easing.sine.SineEaseOut; | |
| 53 | +import com.daimajia.easing.linear.Linear; | |
| 54 | + | |
| 55 | + | |
| 56 | +public enum Skill { | |
| 57 | + | |
| 58 | + BackEaseIn(BackEaseIn.class), | |
| 59 | + BackEaseOut(BackEaseOut.class), | |
| 60 | + BackEaseInOut(BackEaseInOut.class), | |
| 61 | + | |
| 62 | + BounceEaseIn(BounceEaseIn.class), | |
| 63 | + BounceEaseOut(BounceEaseOut.class), | |
| 64 | + BounceEaseInOut(BounceEaseInOut.class), | |
| 65 | + | |
| 66 | + CircEaseIn(CircEaseIn.class), | |
| 67 | + CircEaseOut(CircEaseOut.class), | |
| 68 | + CircEaseInOut(CircEaseInOut.class), | |
| 69 | + | |
| 70 | + CubicEaseIn(CubicEaseIn.class), | |
| 71 | + CubicEaseOut(CubicEaseOut.class), | |
| 72 | + CubicEaseInOut(CubicEaseInOut.class), | |
| 73 | + | |
| 74 | + ElasticEaseIn(ElasticEaseIn.class), | |
| 75 | + ElasticEaseOut(ElasticEaseOut.class), | |
| 76 | + | |
| 77 | + ExpoEaseIn(ExpoEaseIn.class), | |
| 78 | + ExpoEaseOut(ExpoEaseOut.class), | |
| 79 | + ExpoEaseInOut(ExpoEaseInOut.class), | |
| 80 | + | |
| 81 | + QuadEaseIn(QuadEaseIn.class), | |
| 82 | + QuadEaseOut(QuadEaseOut.class), | |
| 83 | + QuadEaseInOut(QuadEaseInOut.class), | |
| 84 | + | |
| 85 | + QuintEaseIn(QuintEaseIn.class), | |
| 86 | + QuintEaseOut(QuintEaseOut.class), | |
| 87 | + QuintEaseInOut(QuintEaseInOut.class), | |
| 88 | + | |
| 89 | + SineEaseIn(SineEaseIn.class), | |
| 90 | + SineEaseOut(SineEaseOut.class), | |
| 91 | + SineEaseInOut(SineEaseInOut.class), | |
| 92 | + | |
| 93 | + Linear(Linear.class); | |
| 94 | + | |
| 95 | + | |
| 96 | + private Class easingMethod; | |
| 97 | + | |
| 98 | + private Skill(Class clazz) { | |
| 99 | + easingMethod = clazz; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public BaseEasingMethod getMethod(float duration) { | |
| 103 | + try { | |
| 104 | + return (BaseEasingMethod)easingMethod.getConstructor(float.class).newInstance(duration); | |
| 105 | + } catch (Exception e) { | |
| 106 | + e.printStackTrace(); | |
| 107 | + throw new Error("Can not init easingMethod instance"); | |
| 108 | + } | |
| 109 | + } | |
| 110 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/back/BackEaseIn.java
0 → 100644
| 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.easing.back; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class BackEaseIn extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + private float s = 1.70158f; | |
| 32 | + | |
| 33 | + public BackEaseIn(float duration) { | |
| 34 | + super(duration); | |
| 35 | + } | |
| 36 | + | |
| 37 | + public BackEaseIn(float duration, float back){ | |
| 38 | + this(duration); | |
| 39 | + s = back; | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public Float calculate(float t, float b, float c, float d) { | |
| 44 | + return c*(t/=d)*t*((s+1)*t - s) + b; | |
| 45 | + } | |
| 46 | + | |
| 47 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/back/BackEaseInOut.java
0 → 100644
| 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.easing.back; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class BackEaseInOut extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + private float s = 1.70158f; | |
| 32 | + | |
| 33 | + public BackEaseInOut(float duration) { | |
| 34 | + super(duration); | |
| 35 | + } | |
| 36 | + | |
| 37 | + public BackEaseInOut(float duration, float back){ | |
| 38 | + this(duration); | |
| 39 | + s = back; | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public Float calculate(float t, float b, float c, float d) { | |
| 44 | + if ((t /= d / 2) < 1) return c / 2 * (t * t * ((s + 1) * t - s)) + b; | |
| 45 | + return c / 2 * ((t -= 2) * t * ((s + 1) * t + s) + 2) + b; | |
| 46 | + } | |
| 47 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/back/BackEaseOut.java
0 → 100644
| 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.easing.back; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class BackEaseOut extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + private float s = 1.70158f; | |
| 32 | + | |
| 33 | + public BackEaseOut(float duration) { | |
| 34 | + super(duration); | |
| 35 | + } | |
| 36 | + | |
| 37 | + public BackEaseOut(float duration, float back){ | |
| 38 | + this(duration); | |
| 39 | + s = back; | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public Float calculate(float t, float b, float c, float d) { | |
| 44 | + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; | |
| 45 | + } | |
| 46 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/bounce/BounceEaseIn.java
0 → 100644
| 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.easing.bounce; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class BounceEaseIn extends BaseEasingMethod { | |
| 30 | + | |
| 31 | + private BounceEaseOut mBounceEaseOut; | |
| 32 | + | |
| 33 | + public BounceEaseIn(float duration){ | |
| 34 | + super(duration); | |
| 35 | + mBounceEaseOut = new BounceEaseOut(duration); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public Float calculate(float t, float b, float c, float d) { | |
| 40 | + return c - mBounceEaseOut.calculate(d-t, 0, c, d) + b; | |
| 41 | + } | |
| 42 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/bounce/BounceEaseInOut.java
0 → 100644
| 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.easing.bounce; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class BounceEaseInOut extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + private BounceEaseOut mBounceEaseOut; | |
| 32 | + private BounceEaseIn mBounceEaseIn; | |
| 33 | + | |
| 34 | + public BounceEaseInOut(float duration){ | |
| 35 | + super(duration); | |
| 36 | + mBounceEaseIn = new BounceEaseIn(duration); | |
| 37 | + mBounceEaseOut = new BounceEaseOut(duration); | |
| 38 | + } | |
| 39 | + | |
| 40 | + @Override | |
| 41 | + public Float calculate(float t, float b, float c, float d) { | |
| 42 | + if (t < d/2) | |
| 43 | + return mBounceEaseIn.calculate (t*2, 0, c, d) * .5f + b; | |
| 44 | + else | |
| 45 | + return mBounceEaseOut.calculate (t*2-d, 0, c, d) * .5f + c*.5f + b; | |
| 46 | + } | |
| 47 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/bounce/BounceEaseOut.java
0 → 100644
| 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.easing.bounce; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class BounceEaseOut extends BaseEasingMethod { | |
| 30 | + | |
| 31 | + public BounceEaseOut(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + if ((t/=d) < (1/2.75f)) { | |
| 38 | + return c*(7.5625f*t*t) + b; | |
| 39 | + } else if (t < (2/2.75f)) { | |
| 40 | + return c*(7.5625f*(t-=(1.5f/2.75f))*t + .75f) + b; | |
| 41 | + } else if (t < (2.5/2.75)) { | |
| 42 | + return c*(7.5625f*(t-=(2.25f/2.75f))*t + .9375f) + b; | |
| 43 | + } else { | |
| 44 | + return c*(7.5625f*(t-=(2.625f/2.75f))*t + .984375f) + b; | |
| 45 | + } | |
| 46 | + } | |
| 47 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/circ/CircEaseIn.java
0 → 100644
| 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.easing.circ; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class CircEaseIn extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + public CircEaseIn(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + return -c * ((float)Math.sqrt(1 - (t/=d)*t) - 1) + b; | |
| 38 | + } | |
| 39 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/circ/CircEaseInOut.java
0 → 100644
| 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.easing.circ; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class CircEaseInOut extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + public CircEaseInOut(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + if ((t/=d/2) < 1) | |
| 38 | + return -c/2 * ((float)Math.sqrt(1 - t*t) - 1) + b; | |
| 39 | + | |
| 40 | + return c/2 * ((float)Math.sqrt(1 - (t-=2)*t) + 1) + b; | |
| 41 | + } | |
| 42 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/circ/CircEaseOut.java
0 → 100644
| 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.easing.circ; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class CircEaseOut extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + public CircEaseOut(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + return c * (float)Math.sqrt(1 - (t=t/d-1)*t) + b; | |
| 38 | + } | |
| 39 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/cubic/CubicEaseIn.java
0 → 100644
| 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.easing.cubic; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class CubicEaseIn extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + public CubicEaseIn(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + return c*(t/=d)*t*t + b; | |
| 38 | + } | |
| 39 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/cubic/CubicEaseInOut.java
0 → 100644
| 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.easing.cubic; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class CubicEaseInOut extends BaseEasingMethod { | |
| 30 | + | |
| 31 | + public CubicEaseInOut(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + if ((t/=d/2) < 1) | |
| 38 | + return c/2*t*t*t + b; | |
| 39 | + | |
| 40 | + return c/2*((t-=2)*t*t + 2) + b; | |
| 41 | + } | |
| 42 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/cubic/CubicEaseOut.java
0 → 100644
| 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.easing.cubic; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class CubicEaseOut extends BaseEasingMethod { | |
| 30 | + | |
| 31 | + public CubicEaseOut(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + return c*((t=t/d-1)*t*t + 1) + b; | |
| 38 | + } | |
| 39 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/elastic/ElasticEaseIn.java
0 → 100644
| 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.easing.elastic; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class ElasticEaseIn extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + public ElasticEaseIn(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + if (t==0) return b; if ((t/=d)==1) return b+c; | |
| 38 | + float p=d*.3f; | |
| 39 | + float a=c; | |
| 40 | + float s=p/4; | |
| 41 | + return -(a*(float)Math.pow(2,10*(t-=1)) * (float)Math.sin( (t*d-s)*(2*(float)Math.PI)/p )) + b; | |
| 42 | + } | |
| 43 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/elastic/ElasticEaseInOut.java
0 → 100644
| 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 | + | |
| 27 | +package com.daimajia.easing.elastic; | |
| 28 | + | |
| 29 | +import com.daimajia.easing.BaseEasingMethod; | |
| 30 | + | |
| 31 | +public class ElasticEaseInOut extends BaseEasingMethod{ | |
| 32 | + public ElasticEaseInOut(float duration) { | |
| 33 | + super(duration); | |
| 34 | + } | |
| 35 | + | |
| 36 | + @Override | |
| 37 | + public Float calculate(float t, float b, float c, float d) { | |
| 38 | + if (t==0) return b; if ((t/=d/2)==2) return b+c; | |
| 39 | + float p=d*(.3f*1.5f); | |
| 40 | + float a=c; | |
| 41 | + float s=p/4; | |
| 42 | + if (t < 1) return -.5f*(a*(float)Math.pow(2,10*(t-=1)) * (float)Math.sin( (t*d-s)*(2*(float)Math.PI)/p )) + b; | |
| 43 | + return a*(float)Math.pow(2,-10*(t-=1)) * (float)Math.sin( (t*d-s)*(2*(float)Math.PI)/p )*.5f + c + b; | |
| 44 | + } | |
| 45 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/elastic/ElasticEaseOut.java
0 → 100644
| 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.easing.elastic; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class ElasticEaseOut extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + public ElasticEaseOut(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + if (t==0) return b; if ((t/=d)==1) return b+c; | |
| 38 | + float p=d*.3f; | |
| 39 | + float a=c; | |
| 40 | + float s=p/4; | |
| 41 | + return (a*(float)Math.pow(2,-10*t) * (float)Math.sin( (t*d-s)*(2*(float)Math.PI)/p ) + c + b); | |
| 42 | + } | |
| 43 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/expo/ExpoEaseIn.java
0 → 100644
| 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.easing.expo; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class ExpoEaseIn extends BaseEasingMethod{ | |
| 30 | + public ExpoEaseIn(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return (t==0) ? b : c * (float)Math.pow(2, 10 * (t/d - 1)) + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/expo/ExpoEaseInOut.java
0 → 100644
| 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.easing.expo; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class ExpoEaseInOut extends BaseEasingMethod{ | |
| 30 | + public ExpoEaseInOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + if (t==0) return b; | |
| 37 | + if (t==d) return b+c; | |
| 38 | + if ((t/=d/2) < 1) return c/2 * (float)Math.pow(2, 10 * (t - 1)) + b; | |
| 39 | + return c/2 * (-(float)Math.pow(2, -10 * --t) + 2) + b; | |
| 40 | + } | |
| 41 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/expo/ExpoEaseOut.java
0 → 100644
| 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.easing.expo; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class ExpoEaseOut extends BaseEasingMethod{ | |
| 30 | + public ExpoEaseOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return (t==d) ? b+c : c * (-(float)Math.pow(2, -10 * t/d) + 1) + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/linear/Linear.java
0 → 100644
| 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 | + | |
| 27 | +package com.daimajia.easing.linear; | |
| 28 | + | |
| 29 | +import com.daimajia.easing.BaseEasingMethod; | |
| 30 | + | |
| 31 | +public class Linear extends BaseEasingMethod{ | |
| 32 | + public Linear(float duration) { | |
| 33 | + super(duration); | |
| 34 | + } | |
| 35 | + | |
| 36 | + @Override | |
| 37 | + public Float calculate(float t, float b, float c, float d) { | |
| 38 | + return c*t/d + b; | |
| 39 | + } | |
| 40 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/quad/QuadEaseIn.java
0 → 100644
| 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.easing.quad; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class QuadEaseIn extends BaseEasingMethod{ | |
| 30 | + public QuadEaseIn(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return c*(t/=d)*t + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/quad/QuadEaseInOut.java
0 → 100644
| 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.easing.quad; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class QuadEaseInOut extends BaseEasingMethod{ | |
| 30 | + public QuadEaseInOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + if ((t/=d/2) < 1) return c/2*t*t + b; | |
| 37 | + return -c/2 * ((--t)*(t-2) - 1) + b; | |
| 38 | + } | |
| 39 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/quad/QuadEaseOut.java
0 → 100644
| 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.easing.quad; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class QuadEaseOut extends BaseEasingMethod{ | |
| 30 | + public QuadEaseOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return -c *(t/=d)*(t-2) + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/quint/QuintEaseIn.java
0 → 100644
| 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.easing.quint; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class QuintEaseIn extends BaseEasingMethod{ | |
| 30 | + public QuintEaseIn(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return c*(t/=d)*t*t*t*t + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/quint/QuintEaseInOut.java
0 → 100644
| 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.easing.quint; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class QuintEaseInOut extends BaseEasingMethod{ | |
| 30 | + public QuintEaseInOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; | |
| 37 | + return c/2*((t-=2)*t*t*t*t + 2) + b; | |
| 38 | + } | |
| 39 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/quint/QuintEaseOut.java
0 → 100644
| 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.easing.quint; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class QuintEaseOut extends BaseEasingMethod{ | |
| 30 | + public QuintEaseOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return c*((t=t/d-1)*t*t*t*t + 1) + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/sine/SineEaseIn.java
0 → 100644
| 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.easing.sine; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class SineEaseIn extends BaseEasingMethod{ | |
| 30 | + | |
| 31 | + public SineEaseIn(float duration) { | |
| 32 | + super(duration); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Float calculate(float t, float b, float c, float d) { | |
| 37 | + return -c * (float)Math.cos(t/d * (Math.PI/2)) + c + b; | |
| 38 | + } | |
| 39 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/sine/SineEaseInOut.java
0 → 100644
| 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.easing.sine; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class SineEaseInOut extends BaseEasingMethod{ | |
| 30 | + public SineEaseInOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return -c/2 * ((float)Math.cos(Math.PI*t/d) - 1) + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
core/base/src/main/java/com/daimajia/easing/sine/SineEaseOut.java
0 → 100644
| 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.easing.sine; | |
| 26 | + | |
| 27 | +import com.daimajia.easing.BaseEasingMethod; | |
| 28 | + | |
| 29 | +public class SineEaseOut extends BaseEasingMethod{ | |
| 30 | + public SineEaseOut(float duration) { | |
| 31 | + super(duration); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Float calculate(float t, float b, float c, float d) { | |
| 36 | + return c * (float)Math.sin(t/d * (Math.PI/2)) + b; | |
| 37 | + } | |
| 38 | +} | ... | ... |
module/xiaojiasoundbox/build.gradle
| ... | ... | @@ -43,8 +43,5 @@ dependencies { |
| 43 | 43 | implementation "com.clj.fastble:FastBleLib:$rootProject.BleLib" |
| 44 | 44 | // loading动画 |
| 45 | 45 | implementation "com.wang.avi:library:$rootProject.avi" |
| 46 | - // 动画大全 | |
| 47 | - implementation "com.daimajia.easing:library:$rootProject.viewAnimationsEasing" | |
| 48 | - implementation "com.daimajia.androidanimations:library:$rootProject.viewAnimationsAndroid" | |
| 49 | 46 | |
| 50 | 47 | } | ... | ... |
module/xiaojiasoundbox/proguard-rules.pro