From 1a8d42024f25fbaf02ee19fce7f5009acc99a287 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 22 Feb 2023 21:31:38 +0800 Subject: [PATCH] =?UTF-8?q?[m1]=20[1.0.2]=20[=E6=B7=BB=E5=8A=A0loading]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/BusPassengerFunctionSoftFragment.kt | 28 ++++++++++++++++++ .../src/m1/res/anim/bus_p_loading_rotate.xml | 8 +++++ .../m1/res/drawable-nodpi/bus_p_loading.png | Bin 0 -> 2560 bytes 3 files changed, 36 insertions(+) create mode 100644 OCH/mogo-och-bus-passenger/src/m1/res/anim/bus_p_loading_rotate.xml create mode 100644 OCH/mogo-och-bus-passenger/src/m1/res/drawable-nodpi/bus_p_loading.png diff --git a/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/BusPassengerFunctionSoftFragment.kt b/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/BusPassengerFunctionSoftFragment.kt index 7609d3c5b6..c68675ac85 100644 --- a/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/BusPassengerFunctionSoftFragment.kt +++ b/OCH/mogo-och-bus-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/BusPassengerFunctionSoftFragment.kt @@ -10,6 +10,9 @@ import android.media.AudioManager import android.os.Bundle import android.view.Gravity import android.view.View +import android.view.animation.Animation +import android.view.animation.AnimationUtils +import android.view.animation.LinearInterpolator import android.widget.RadioButton import android.widget.SeekBar import android.widget.SeekBar.OnSeekBarChangeListener @@ -39,6 +42,7 @@ import kotlinx.android.synthetic.m1.bus_p_function_setting_soft_fragment.* import me.jessyan.autosize.utils.AutoSizeUtils import java.util.concurrent.TimeUnit + /** * @author: yangyakun * @date: 2023/1/28 @@ -55,8 +59,14 @@ class BusPassengerFunctionSoftFragment : private var subscribeLightTop1: Disposable? = null private var subscribeLightTop2: Disposable? = null private var subscribeAtmosphere: Disposable? = null + private var subscribeAnimator: Disposable? = null private var animator1: ObjectAnimator? = null + private val loadingAni = ObjectAnimator.ofFloat(iv_loading, "rotation", 0f, 90f ,180f, 270f, 360f).apply { + repeatCount = -1 + interpolator = LinearInterpolator() + duration = 1000 + } override fun initViews() { @@ -66,16 +76,21 @@ class BusPassengerFunctionSoftFragment : g_aircondition_setting.visibility = View.VISIBLE g_light_setting.visibility = View.GONE g_voice_setting.visibility = View.GONE + if(loadingAni.isRunning){ + iv_loading.visibility = View.VISIBLE + } } R.id.tv_setting_lighting -> { g_light_setting.visibility = View.VISIBLE g_voice_setting.visibility = View.GONE g_aircondition_setting.visibility = View.GONE + iv_loading.visibility = View.GONE } R.id.tv_setting_voice -> { g_voice_setting.visibility = View.VISIBLE g_aircondition_setting.visibility = View.GONE g_light_setting.visibility = View.GONE + iv_loading.visibility = View.GONE } else -> {} } @@ -100,6 +115,18 @@ class BusPassengerFunctionSoftFragment : } } + fun showAni(){ + iv_loading.visibility = View.VISIBLE + loadingAni.start() + g_aircondition_setting.visibility = View.GONE + subscribeAnimator = Observable.timer(5000, TimeUnit.MILLISECONDS) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe { + loadingAni.cancel() + iv_loading.visibility = View.GONE + g_aircondition_setting.visibility = View.VISIBLE + } + } private fun setAirconditionListener() { // 开关空调或暖风机 tv_aircondition_switch.setOnCheckedChangeListener { buttonView, isChecked -> @@ -114,6 +141,7 @@ class BusPassengerFunctionSoftFragment : } else { openAircondition()// 打开空调 } + showAni() }else{// 关闭 tv_aircondition_switch.setText("打开空调") closeHeater()// 关闭暖风机 diff --git a/OCH/mogo-och-bus-passenger/src/m1/res/anim/bus_p_loading_rotate.xml b/OCH/mogo-och-bus-passenger/src/m1/res/anim/bus_p_loading_rotate.xml new file mode 100644 index 0000000000..a0d7903789 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/m1/res/anim/bus_p_loading_rotate.xml @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m1/res/drawable-nodpi/bus_p_loading.png b/OCH/mogo-och-bus-passenger/src/m1/res/drawable-nodpi/bus_p_loading.png new file mode 100644 index 0000000000000000000000000000000000000000..ca42ea6abbec17ebeb3aa20400f96c1fdf45c095 GIT binary patch literal 2560 zcmV+b3jg(qP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91N1y`$1ONa40RR91NdN!<0Bh4+iU0r!YDq*vRCodHTzzm<)fGSI?QXI_ z#Y6&$It9io5fV&H(-x`iKw7E{P8t6w)}bXsizc9T94Ku^`$3?cehhw1og${rBpC-s z8=bM!I!;khtJ5liPy-E+>=F~ilAwGDD@k_W?eA{golW+A-1pecZkT;DJMZ0d&pG#; z-@BjZ-nT?KbgdA=Q#ByUt{oJY<$_t93r3Wm5I4e(Uyz`BK~x}Zf?@r5-cejizuL?1t%axp%|cF1B49#Ml%9{nSz38b!Y~^X_TKyT2{e9jd@H6TC3pT1+SNCkCgBs z1>Ur=7{0BvX}3@`=Y;sCA}~^mKN6uf*(X`3OnX+=z=;w);Lw`|@1CR;4rMNiJuBc; zoD^51kEwQSxlYR*%Upy&R=|lyX_gzC(Q(gqBj;8oE8uuM6merP3mS1F=T^q+MzG?r zD2ZO6WiYl9!>k`oq+e*XGgQr;D*Chn3R0AGv*FuR2h$PLybNSG8p`X0@SW| z;WK73W9dqW!uVBAfRTluxvY`~jxBI(x~G(%^l4Nj!NhML1O~vsaw&~gFn9r!JG%sxRd&%#2)%D7cz8M=2ajzn zv(ppLmoH_`52!4jPQDLCs1)gQ$uzTPrJ94rRBWceiXK7#W0jw&y!o5SCv=l8U_@~M zfN@ITpw*l1CCePxL?aqwCS`Dee!+ljNKyg^&FT$9X)7Yr(IeOL2UaYZ z%425P+ohDv8i}iPl1*6YQUXW#s2u<~n({;O6G|3jh^eQQ2mM|;s`)4^mn#74?DQh) zdaaF>YYu!?yD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