|
|
@@ -1,26 +1,57 @@
|
|
|
package com.yingyang.personalcenter.agreement
|
|
|
|
|
|
+import android.annotation.SuppressLint
|
|
|
+import android.view.MotionEvent
|
|
|
+import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
+import com.yingyang.personalcenter.R
|
|
|
import com.yingyang.personalcenter.databinding.ActivityLeaseAgreementBinding
|
|
|
import com.yingyangfly.baselib.base.BaseActivity
|
|
|
+import com.yingyangfly.baselib.ext.getEndAnimation
|
|
|
+import com.yingyangfly.baselib.ext.getScaleAnimation
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
|
|
|
/**
|
|
|
* 租赁协议
|
|
|
*/
|
|
|
@Route(path = RouterUrlCommon.leaseAgreement)
|
|
|
-class LeaseAgreementActivity : BaseActivity<ActivityLeaseAgreementBinding>() {
|
|
|
+class LeaseAgreementActivity : BaseActivity<ActivityLeaseAgreementBinding>(),
|
|
|
+ View.OnTouchListener {
|
|
|
|
|
|
override fun initViews() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @SuppressLint("ClickableViewAccessibility")
|
|
|
override fun initListener() {
|
|
|
-
|
|
|
+ binding.backLayout.setOnTouchListener(this@LeaseAgreementActivity)
|
|
|
}
|
|
|
|
|
|
override fun initData() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @SuppressLint("ClickableViewAccessibility")
|
|
|
+ override fun onTouch(v: View, event: MotionEvent): Boolean {
|
|
|
+ when (event.action) {
|
|
|
+ MotionEvent.ACTION_DOWN -> {
|
|
|
+ if (v.id == R.id.backLayout) {
|
|
|
+ v.startAnimation(getScaleAnimation())
|
|
|
+ }
|
|
|
+ }
|
|
|
+ MotionEvent.ACTION_UP -> {
|
|
|
+ v.startAnimation(getEndAnimation())
|
|
|
+ if (v.id == R.id.backLayout) {
|
|
|
+ finish()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ MotionEvent.ACTION_CANCEL -> {
|
|
|
+ if (v.id == R.id.backLayout) {
|
|
|
+ v.startAnimation(getEndAnimation())
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
}
|