[6.7.0]冷启动添加到登录页面
This commit is contained in:
@@ -17,6 +17,7 @@ import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.ColdStartView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -43,6 +44,7 @@ import kotlinx.android.synthetic.main.biz_login_view.biz_login_svp
|
||||
import kotlinx.android.synthetic.main.biz_login_view.bv_switch_business
|
||||
import kotlinx.android.synthetic.main.biz_login_view.cl_login_info
|
||||
import kotlinx.android.synthetic.main.biz_login_view.eiv_Info
|
||||
import kotlinx.android.synthetic.main.biz_login_view.viewColdStart
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
|
||||
@@ -106,56 +108,67 @@ class LoginFragment : MvpFragment<LoginFragment?, LoginPresenter?>(), ILoginView
|
||||
biz_login_svp.setIsTouchWigetFull(false)
|
||||
biz_login_svp.enableshowProgressDialog = false
|
||||
biz_login_svp.enableDoubleClick = false
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl)
|
||||
.setCacheWithPlay(false)
|
||||
.setPlayTag("TaxiPassengerArrivedView")
|
||||
.build(biz_login_svp)
|
||||
|
||||
biz_login_svp.setVideoAllCallBack(object : GSYSampleCallBack() {
|
||||
override fun onAutoComplete(url: String?, vararg objects: Any?) {
|
||||
if (AppIdentityModeUtils.isT1T2(FunctionBuildConfig.appIdentityMode)) {
|
||||
biz_login_svp?.setBackgroundResource(R.drawable.biz_login_bg_taxi_end)
|
||||
}else{
|
||||
biz_login_svp?.setBackgroundResource(R.drawable.biz_login_bg_bus_end)
|
||||
}
|
||||
viewColdStart.setColdStartResultListener(object: ColdStartView.ColdStartResultListener{
|
||||
override fun coldStartSuccess() {
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl)
|
||||
.setCacheWithPlay(false)
|
||||
.setPlayTag("TaxiPassengerArrivedView")
|
||||
.build(biz_login_svp)
|
||||
|
||||
}
|
||||
})
|
||||
if (showLoginInfoAnimator1 == null) {
|
||||
showLoginInfoAnimator1 = ObjectAnimator.ofFloat(cl_login_info, "alpha", 0f, 1f)
|
||||
showLoginInfoAnimator1?.interpolator = LinearInterpolator()
|
||||
}
|
||||
if (showLoginInfoAnimator2 == null) {
|
||||
val dp2px = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(), -50f)
|
||||
showLoginInfoAnimator2 = ObjectAnimator.ofFloat(cl_login_info, "translationY", 0f, dp2px.toFloat())
|
||||
showLoginInfoAnimator2?.interpolator = DecelerateInterpolator()
|
||||
}
|
||||
UiThreadHandler.postDelayed({
|
||||
cl_login_info?.let {
|
||||
val animatorSet = AnimatorSet()
|
||||
animatorSet.playTogether(showLoginInfoAnimator1, showLoginInfoAnimator2)
|
||||
animatorSet.duration = 500
|
||||
animatorSet.addListener(object :AnimatorListener{
|
||||
override fun onAnimationStart(animation: Animator) {
|
||||
cl_login_info?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
biz_login_svp.setVideoAllCallBack(object : GSYSampleCallBack() {
|
||||
override fun onAutoComplete(url: String?, vararg objects: Any?) {
|
||||
if (AppIdentityModeUtils.isT1T2(FunctionBuildConfig.appIdentityMode)) {
|
||||
biz_login_svp?.setBackgroundResource(R.drawable.biz_login_bg_taxi_end)
|
||||
}else{
|
||||
biz_login_svp?.setBackgroundResource(R.drawable.biz_login_bg_bus_end)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAnimationCancel(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
animatorSet.start()
|
||||
if (showLoginInfoAnimator1 == null) {
|
||||
showLoginInfoAnimator1 = ObjectAnimator.ofFloat(cl_login_info, "alpha", 0f, 1f)
|
||||
showLoginInfoAnimator1?.interpolator = LinearInterpolator()
|
||||
}
|
||||
if (showLoginInfoAnimator2 == null) {
|
||||
val dp2px = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(), -50f)
|
||||
showLoginInfoAnimator2 = ObjectAnimator.ofFloat(cl_login_info, "translationY", 0f, dp2px.toFloat())
|
||||
showLoginInfoAnimator2?.interpolator = DecelerateInterpolator()
|
||||
}
|
||||
UiThreadHandler.postDelayed({
|
||||
cl_login_info?.let {
|
||||
val animatorSet = AnimatorSet()
|
||||
animatorSet.playTogether(showLoginInfoAnimator1, showLoginInfoAnimator2)
|
||||
animatorSet.duration = 500
|
||||
animatorSet.addListener(object :AnimatorListener{
|
||||
override fun onAnimationStart(animation: Animator) {
|
||||
cl_login_info?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAnimationCancel(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
animatorSet.start()
|
||||
}
|
||||
},2_000,UiThreadHandler.MODE.QUEUE)
|
||||
biz_login_svp.startPlayLogic()
|
||||
}
|
||||
},2_000,UiThreadHandler.MODE.QUEUE)
|
||||
|
||||
override fun coldStartFail() {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
inputPhoneNormal()
|
||||
@@ -304,7 +317,6 @@ class LoginFragment : MvpFragment<LoginFragment?, LoginPresenter?>(), ILoginView
|
||||
biz_cl_driver_main?.viewTreeObserver?.addOnGlobalLayoutListener(onlayoutListener)
|
||||
super.onResume()
|
||||
CallerLogger.d(TAG, "onResume")
|
||||
biz_login_svp.startPlayLogic()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
|
||||
Reference in New Issue
Block a user