[2.11.0/1.6.0]bus司机端/乘客端动画调整,bus司机端语音播报调整

This commit is contained in:
wangmingjun
2022-09-26 19:47:37 +08:00
parent 6ce6a01de5
commit bc93b06dc2
6 changed files with 19 additions and 13 deletions

View File

@@ -146,7 +146,7 @@
android:id="@+id/bus_p_line_stations_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_280"
android:layout_marginTop="@dimen/dp_260"
android:paddingBottom="@dimen/dp_30"
android:paddingLeft="@dimen/dp_30"
android:paddingRight="@dimen/bus_p_route_info_margin_right"

View File

@@ -111,7 +111,7 @@ public class BusLineModel {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort("网络异常,请稍后重试");
}else {
ToastUtils.showShort("切换路线失败:"+failMsg);
ToastUtils.showShort("选择任务失败:"+failMsg);
}
}
});

View File

@@ -591,7 +591,7 @@ public class BusOrderModel {
return;
}
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
String arriveStation = stationList.get(arrivedStationIndex).getName();
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex);
BusServiceManager.getInstance().arriveSiteStation(mContext ,
@@ -603,6 +603,11 @@ public class BusOrderModel {
public void onSuccess(BaseData o) {
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation success");
queryBusRoutes();
ttsTips(String.format(mContext
.getString(R.string.bus_arrived_station_tip),
arriveStation));
//5s轮询核销乘客
startOrStopQueryPassengerWriteOff(true);
}
@@ -728,7 +733,7 @@ public class BusOrderModel {
}
}
if (backgroundCurrentStationIndex == 0){ //默认是第一站到站查询
if (backgroundCurrentStationIndex == 0 && stationList.get(0).getStatus() == STATION_STATUS_STOPPED){ //默认是第一站到站查询
startOrStopQueryPassengerWriteOff(true);
}

View File

@@ -32,9 +32,11 @@ class BusStationCommonItem @JvmOverloads constructor(
}
fun setStationPointBg(type: Int){ // 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
BlinkAnimationUtil.clearAnimation(busCircleIv)
when(type){
0 -> {
BlinkAnimationUtil.clearAnimation(busCircleIv)
busCircleIv.setImageResource(R.drawable.icon_point_grey_bus)
}
@@ -43,7 +45,6 @@ class BusStationCommonItem @JvmOverloads constructor(
BlinkAnimationUtil.setAnimation(busCircleIv)
}
2 -> {
BlinkAnimationUtil.clearAnimation(busCircleIv)
busCircleIv.setImageResource(R.drawable.icon_point_blue_bus)
}
}

View File

@@ -41,4 +41,6 @@
<string name="bus_no_task_tip">暂无任务</string>
<string name="bus_leave_station_tip">车辆起步,请扶稳坐好,前方到站是%1$s请下车的乘客做好准备。</string>
<string name="bus_end_task_tip">感谢您体验\'蘑菇车联\'无人驾驶小巴车,请您携带好随身物品,我们下次再见。</string>
<string name="bus_arrived_station_tip">已到达%1$s站带好随身物品下车请注意安全。</string>
</resources>

View File

@@ -2,7 +2,6 @@ package com.mogo.och.common.module.utils;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.animation.Animation;
import android.widget.ImageView;
/**
@@ -14,6 +13,7 @@ public class BlinkAnimationUtil {
//实现图片闪烁效果
public static void setAnimation(ImageView imageView) {
AnimatorSet animationSet = new AnimatorSet();
imageView.setTag(imageView.getId(),animationSet);
ObjectAnimator valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha",0f, 1.0f);
ObjectAnimator valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha",1.0f, 0f);
@@ -25,16 +25,14 @@ public class BlinkAnimationUtil {
animationSet.playTogether(valueAnimatorDisappare, valueAnimator);
animationSet.start();
}
//消除动画
public static void clearAnimation(ImageView imageView){
Animation animation = imageView.getAnimation();
if (animation != null){
animation.cancel();
Object animObject = imageView.getTag(imageView.getId());
if (animObject instanceof AnimatorSet){
AnimatorSet animatorSet = (AnimatorSet)animObject;
animatorSet.cancel();
}
imageView.clearAnimation();
imageView.setAnimation(null);
}
}