[2.11.0/1.6.0] bus司机端/乘客端路线面板绿点闪烁调整
This commit is contained in:
@@ -48,6 +48,7 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
BusPassengerStation station = mStations.get(position);
|
||||
StationViewHolder viewHolder = (StationViewHolder)holder;
|
||||
viewHolder.stationName.setText(station.getName());
|
||||
BlinkAnimationUtil.clearAnimation(viewHolder.stationCircle);
|
||||
if (position == 0){ //第一个 起点
|
||||
viewHolder.stationTagTxt.setText("起");
|
||||
viewHolder.stationStationTag.setBackground(mContext.getDrawable(R.drawable.bg_bus_p_start_tag_bg));
|
||||
@@ -58,7 +59,6 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_green);
|
||||
BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
|
||||
}else {
|
||||
BlinkAnimationUtil.clearAnimation(viewHolder.stationCircle);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
|
||||
}
|
||||
@@ -74,7 +74,6 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
BusPassengerStation preStation = mStations.get(position -1);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_LEAVING ||
|
||||
(station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving())){ //过站
|
||||
BlinkAnimationUtil.clearAnimation(viewHolder.stationCircle);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_grey);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
|
||||
@@ -91,7 +90,6 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
}else if (station.getDrivingStatus() == STATION_STATUS_ARRIVING &&
|
||||
(preStation.getDrivingStatus() == STATION_STATUS_ARRIVING
|
||||
|| preStation.getDrivingStatus() == STATION_STATUS_STOPPED)){ //未到站的并且前面也是未到站或者刚到站的
|
||||
BlinkAnimationUtil.clearAnimation(viewHolder.stationCircle);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_blue);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_blue);
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_260"
|
||||
android:paddingBottom="@dimen/dp_30"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:requiresFadingEdge="vertical"
|
||||
|
||||
@@ -22,12 +22,13 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_arrow_bg"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="62px"
|
||||
android:layout_height="62px"
|
||||
android:src="@drawable/bus_p_point_gray"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_station"/>
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_circle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_circle"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_circle"
|
||||
|
||||
@@ -91,10 +91,6 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
BusOrderModel.getInstance().setPassengerCallback(null);
|
||||
}
|
||||
|
||||
public void queryBusRoutes() {
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
}
|
||||
|
||||
public void abortTask() {
|
||||
BusOrderModel.getInstance().abortTask();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.view.LayoutInflater
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.R
|
||||
import com.mogo.och.common.module.utils.BlinkAnimationUtil
|
||||
import kotlinx.android.synthetic.main.bus_stations_common_item.view.*
|
||||
@@ -33,31 +32,43 @@ class BusStationCommonItem @JvmOverloads constructor(
|
||||
busStationNameTv.setTextColor(color)
|
||||
}
|
||||
|
||||
fun setStationPointBg(type: Int){ // 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站
|
||||
|
||||
UiThreadHandler.post(Runnable {
|
||||
BlinkAnimationUtil.clearAnimation(busCircleIv)
|
||||
|
||||
when(type){
|
||||
0 -> {
|
||||
busCircleIv.setImageDrawable(null)
|
||||
busCircleIv.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_point_grey_bus))
|
||||
}
|
||||
1 -> {
|
||||
busCircleIv.setImageDrawable(null)
|
||||
busCircleIv.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_point_green_bus))
|
||||
BlinkAnimationUtil.setAnimation(busCircleIv)
|
||||
}
|
||||
2 -> {
|
||||
busCircleIv.setImageDrawable(null)
|
||||
busCircleIv.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_point_blue_bus))
|
||||
}
|
||||
fun setStationPointBg(type: Int) { // 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站
|
||||
BlinkAnimationUtil.clearAnimation(busCircleIv)
|
||||
when (type) {
|
||||
0 -> {
|
||||
busCircleIvBg.visibility = GONE
|
||||
busCircleIv.setImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.icon_point_grey_bus
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
1 -> {
|
||||
busCircleIvBg.visibility = VISIBLE
|
||||
busCircleIv.setImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.icon_point_green_bus
|
||||
)
|
||||
)
|
||||
BlinkAnimationUtil.setAnimation(busCircleIv)
|
||||
}
|
||||
2 -> {
|
||||
busCircleIvBg.visibility = GONE
|
||||
busCircleIv.setImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.icon_point_blue_bus
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun getCircleImageView() : ImageView{
|
||||
return busCircleIv;
|
||||
return busCircleIv
|
||||
}
|
||||
|
||||
fun setStationArrowBg(type: Int){// 0:灰色 过站 1:绿色 前往下一站 2:蓝色 未到站
|
||||
|
||||
@@ -12,6 +12,13 @@ public class BlinkAnimationUtil {
|
||||
|
||||
//实现图片闪烁效果
|
||||
public static void setAnimation(ImageView imageView) {
|
||||
Object animObject = imageView.getTag(imageView.getId());
|
||||
if (animObject instanceof AnimatorSet){
|
||||
AnimatorSet animatorSet = (AnimatorSet)animObject;
|
||||
animatorSet.start();
|
||||
return;
|
||||
}
|
||||
|
||||
AnimatorSet animationSet = new AnimatorSet();
|
||||
imageView.setTag(imageView.getId(),animationSet);
|
||||
|
||||
@@ -32,7 +39,7 @@ public class BlinkAnimationUtil {
|
||||
Object animObject = imageView.getTag(imageView.getId());
|
||||
if (animObject instanceof AnimatorSet){
|
||||
AnimatorSet animatorSet = (AnimatorSet)animObject;
|
||||
animatorSet.cancel();
|
||||
animatorSet.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user