// Path: app/src/main/java/com/wheat7/cashew/base/BaseActivity.java
// public abstract class BaseActivity<T extends ViewDataBinding> extends AppCompatActivity {
// 
//     private View mainView;
//     private ViewDataBinding binding;
// 
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         int layoutId = getLayoutId();
//         super.onCreate(savedInstanceState);
//         SwipeBackHelper.onCreate(this);
//         SwipeBackHelper.getCurrentPage(this)
//                 .setSwipeBackEnable(true)
//                 .setSwipeSensitivity(0.5f)
//                 .setSwipeRelateEnable(true)
//                 .setSwipeRelateOffset(300)
//                 .setSwipeEdgePercent(0.1f);
//         try {
//             binding = DataBindingUtil.setContentView(this, layoutId);
//             if (binding != null) {
//                 mainView = binding.getRoot();
//             } else {
//                 mainView = LayoutInflater.from(this).inflate(layoutId, null);
//                 setContentView(mainView);
//             }
// 
//         } catch (NoClassDefFoundError e) {
//             mainView = LayoutInflater.from(this).inflate(layoutId, null);
//             setContentView(mainView);
//         }
//         initView(savedInstanceState);
//     }
// 
//     @Override
//     public void onPostCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
//         super.onPostCreate(savedInstanceState, persistentState);
//         SwipeBackHelper.onPostCreate(this);
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         SwipeBackHelper.onDestroy(this);
//     }
// 
//     public T getBinding() {
//         return (T) binding;
//     }
// 
//     public abstract int getLayoutId();
// 
//     public abstract void initView(Bundle savedInstanceState);
// 
// }


import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.DecelerateInterpolator;
import com.wheat7.cashew.R;
import com.wheat7.cashew.base.BaseActivity;
import com.wheat7.cashew.databinding.ActivityWelcomeBinding;
package com.wheat7.cashew.activity;



/**
 * Created by wheat7 on 2017/8/19.
 */

public class WelcomeActivity extends BaseActivity<ActivityWelcomeBinding> {

    @Override
    public int getLayoutId() {
        return R.layout.activity_welcome;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                ObjectAnimator animator = ObjectAnimator.ofFloat(getBinding().welcome, "alpha", 1f, 0f);
                animator.setDuration(1500);
// Path: app/src/main/java/com/wheat7/cashew/base/BaseActivity.java
// public abstract class BaseActivity<T extends ViewDataBinding> extends AppCompatActivity {
// 
//     private View mainView;
//     private ViewDataBinding binding;
// 
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         int layoutId = getLayoutId();
//         super.onCreate(savedInstanceState);
//         SwipeBackHelper.onCreate(this);
//         SwipeBackHelper.getCurrentPage(this)
//                 .setSwipeBackEnable(true)
//                 .setSwipeSensitivity(0.5f)
//                 .setSwipeRelateEnable(true)
//                 .setSwipeRelateOffset(300)
//                 .setSwipeEdgePercent(0.1f);
//         try {
//             binding = DataBindingUtil.setContentView(this, layoutId);
//             if (binding != null) {
//                 mainView = binding.getRoot();
//             } else {
//                 mainView = LayoutInflater.from(this).inflate(layoutId, null);
//                 setContentView(mainView);
//             }
// 
//         } catch (NoClassDefFoundError e) {
//             mainView = LayoutInflater.from(this).inflate(layoutId, null);
//             setContentView(mainView);
//         }
//         initView(savedInstanceState);
//     }
// 
//     @Override
//     public void onPostCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
//         super.onPostCreate(savedInstanceState, persistentState);
//         SwipeBackHelper.onPostCreate(this);
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//         SwipeBackHelper.onDestroy(this);
//     }
// 
//     public T getBinding() {
//         return (T) binding;
//     }
// 
//     public abstract int getLayoutId();
// 
//     public abstract void initView(Bundle savedInstanceState);
// 
// }


// Path: app/src/main/java/com/wheat7/cashew/activity/WelcomeActivity.java
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.DecelerateInterpolator;
import com.wheat7.cashew.R;
import com.wheat7.cashew.base.BaseActivity;
import com.wheat7.cashew.databinding.ActivityWelcomeBinding;

package com.wheat7.cashew.activity;



/**
 * Created by wheat7 on 2017/8/19.
 */

public class WelcomeActivity extends BaseActivity<ActivityWelcomeBinding> {

    @Override
    public int getLayoutId() {
        return R.layout.activity_welcome;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                ObjectAnimator animator = ObjectAnimator.ofFloat(getBinding().welcome, "alpha", 1f, 0f);
                animator.setDuration(1500);
                animator.setInterpolator(new DecelerateInterpolator());