[bus passenger v1.0.0] bus 乘客屏UI更新,站点逻辑更新

This commit is contained in:
wangmingjun
2022-04-08 19:13:29 +08:00
parent e0e6a66d1b
commit 4406db2d6e
39 changed files with 824 additions and 561 deletions

BIN
OCH/mogo-och-bus-passenger/src/main/assets/map_style.data Executable file → Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -12,7 +12,6 @@ import com.mogo.map.MogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.ui.BusPassengerBaseFragment;
import com.mogo.och.bus.passenger.ui.BusPassengerRouteLineFragment;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
@@ -32,7 +31,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
private FragmentActivity mActivity;
private int mContainerId;
private BusPassengerRouteLineFragment mPassengerFragment;
private BusPassengerBaseFragment mPassengerFragment;
@Override
public void createCoverage(FragmentActivity activity, int containerId) {
@@ -91,7 +90,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
private void showFragment() {
if (mPassengerFragment == null) {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "准备add fragment======");
mPassengerFragment = BusPassengerRouteLineFragment.newInstance();
mPassengerFragment = new BusPassengerBaseFragment();
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, mPassengerFragment).commitAllowingStateLoss();
return;
}

View File

@@ -58,30 +58,40 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
if (holder instanceof StartStationViewHolder){
StartStationViewHolder viewHolder = (StartStationViewHolder)holder;
viewHolder.startStationName.setText(station.getName());
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//到站
viewHolder.curStationBg.setVisibility(View.VISIBLE);
viewHolder.stationCircle.setVisibility(View.GONE);
viewHolder.startStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
}else {
viewHolder.curStationBg.setVisibility(View.GONE);
viewHolder.stationCircle.setVisibility(View.VISIBLE);
viewHolder.startStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
}
}else if (holder instanceof EndStationViewHolder){
EndStationViewHolder viewHolder = (EndStationViewHolder)holder;
viewHolder.endStationName.setText(station.getName());
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){
BusPassengerStation preStation = mStations.get(position -1);
if ((preStation.getDrivingStatus() == STATION_STATUS_STOPPED && preStation.isLeaving())
|| (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving())){//到站
viewHolder.curStationBg.setVisibility(View.VISIBLE);
viewHolder.stationCircle.setVisibility(View.GONE);
viewHolder.endStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
}else {
viewHolder.curStationBg.setVisibility(View.GONE);
viewHolder.stationCircle.setVisibility(View.VISIBLE);
viewHolder.endStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
}
}else {
MiddleStationViewHolder viewHolder = (MiddleStationViewHolder)holder;
viewHolder.middleStationName.setText(station.getName());
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){
BusPassengerStation preStation = mStations.get(position -1);
if ((preStation.getDrivingStatus() == STATION_STATUS_STOPPED && preStation.isLeaving())
|| (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving())) {//到站
viewHolder.curStationBg.setVisibility(View.VISIBLE);
viewHolder.middleStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
}else {
viewHolder.curStationBg.setVisibility(View.GONE);
viewHolder.middleStationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
}
}
}

View File

@@ -12,52 +12,7 @@ public
class BusPassengerQueryLineRequest {
private String sn;
private double lat;
private double lon;
private boolean markDrivingStatus; // 默认falsetrue:是否需要返回站点的行驶状态对应返回的drivingStatus
// 0 - 关闭、1 - 启动
// public String status;
public BusPassengerQueryLineRequest(String sn,double lon, double lat, boolean markDrivingStatus) {
public BusPassengerQueryLineRequest(String sn) {
this.sn = sn;
this.lat = lat;
this.lon = lon;
this.markDrivingStatus = markDrivingStatus;
}
public boolean isMarkDrivingStatus() {
return markDrivingStatus;
}
public void setMarkDrivingStatus(boolean markDrivingStatus) {
this.markDrivingStatus = markDrivingStatus;
}
public void setLat(double lat) {
this.lat = lat;
}
public void setLon(double lon) {
this.lon = lon;
}
public String getSn() {
return sn;
}
public double getLat() {
return lat;
}
public double getLon() {
return lon;
}
// public OchBusOperationStatusRequest shutdown() {
// status = "0";
// return this;
// }
//
// public OchBusOperationStatusRequest launch() {
// status = "1";
// return this;
// }
}

View File

@@ -10,5 +10,5 @@ import java.util.List;
*/
public interface IBusPassengerRouteLineInfoCallback {
void updateLineInfo(String lineName, String lineDurTime);
void updateStationsInfo(List<BusPassengerStation> stations);
void updateStationsInfo(List<BusPassengerStation> stations,int currentStationIndex);
}

View File

@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
@@ -25,6 +26,7 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse;
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse;
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResult;
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
import com.mogo.och.bus.passenger.callback.IBusPassegerDriverStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerADASStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerAutopilotPlanningCallback;
@@ -49,6 +51,7 @@ import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
/**
* Created on 2022/3/31
@@ -112,14 +115,13 @@ public class BusPassengerModel {
}
public void queryDriverSiteByCoordinate(){
BusPassengerServiceManager.getInstance().queryDriverSiteByCoordinate(mContext,mLongitude,mLatitude
BusPassengerServiceManager.getInstance().queryDriverSiteByCoordinate(mContext
, new BusPassengerServiceCallback<BusPassengerRoutesResponse>() {
@Override
public void onSuccess(BusPassengerRoutesResponse data) {
if ( data == null
|| data.getResult() == null
|| data.getResult().getSites() == null
|| data.getResult().getSites().isEmpty() ) {
|| data.getResult().getSites() == null) {
return;
}
updatePassengerRouteInfo(data.getResult());
@@ -136,7 +138,17 @@ public class BusPassengerModel {
if (mRouteLineInfoCallback != null){
mRouteLineInfoCallback.updateLineInfo(result.getName(),result.getRunningDur());
if (result.getSites() != null){
mRouteLineInfoCallback.updateStationsInfo(result.getSites());
List<BusPassengerStation> stations = result.getSites();
for (int i = 0; i< stations.size(); i++){
BusPassengerStation station = stations.get(i);
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
mRouteLineInfoCallback.updateStationsInfo(stations,i+1);
return;
}else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){
mRouteLineInfoCallback.updateStationsInfo(stations,i);
return;
}
}
}
}
@@ -317,20 +329,26 @@ public class BusPassengerModel {
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
if (null != routeList && routeList.getWayPointsList().size() > 0){
mAutopilotPlanningCallback.routeResult(
BPCoordinateCalculateRouteUtil.coordinateConverterWgsToGcjListCommon(mContext
,routeList.getWayPointsList()));
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onAutopilotRotting = "
+ GsonUtil.jsonFromObject(routeList));
List<MessagePad.Location> mRoutePoints = routeList.getWayPointsList();
if (null != routeList && mRoutePoints.size() > 0){
updateRoutePoints(mRoutePoints);
}
}
};
public void updateRoutePoints(List<MessagePad.Location> routePoints) {
mAutopilotPlanningCallback.routeResult(
BPCoordinateCalculateRouteUtil.coordinateConverterWgsToGcjListCommon(mContext
, routePoints));
}
private void startOrStopOrderLoop(boolean start) {
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "startOrStopOrderLoop() " + start);
if (start) {

View File

@@ -20,8 +20,6 @@ import retrofit2.http.Query;
interface BusPassengerServiceApi {
/**
* 查询bus司机端绑定路线
*
* @param driverSn 请求参数 司机端的sn并不是乘客屏的sn
* @return 接口返回数据
*/
@Headers( {"Content-Type:application/json;charset=UTF-8"} )

View File

@@ -47,8 +47,8 @@ public class BusPassengerServiceManager {
* @return
*/
private String getDriverAppSn(){
return CallerTelematicManager.INSTANCE.getServerToken();
// return "X2020211111NG0XNFK";
// return CallerTelematicManager.INSTANCE.getServerToken();
return "X2020211111NG0XNFK";
}
/**
@@ -56,12 +56,11 @@ public class BusPassengerServiceManager {
* @param context
* @param callback
*/
public void queryDriverSiteByCoordinate(Context context,double lon,double lat
public void queryDriverSiteByCoordinate(Context context
,BusPassengerServiceCallback<BusPassengerRoutesResponse> callback){
mBusPassengerServiceApi.queryDriverSiteByCoordinate(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken()
,new BusPassengerQueryLineRequest(getDriverAppSn(),lon
,lat,true))
,new BusPassengerQueryLineRequest(getDriverAppSn()))
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"queryDriverSiteByCoordinate"));

View File

@@ -9,6 +9,7 @@ import androidx.lifecycle.LifecycleOwner;
import com.amap.api.maps.model.LatLng;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
@@ -18,7 +19,7 @@ import com.mogo.och.bus.passenger.callback.IBusPassengerAutopilotPlanningCallbac
import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerRouteLineInfoCallback;
import com.mogo.och.bus.passenger.model.BusPassengerModel;
import com.mogo.och.bus.passenger.ui.BusPassengerRouteLineFragment;
import com.mogo.och.bus.passenger.ui.BusPassengerBaseFragment;
import java.util.List;
@@ -27,11 +28,11 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS
/**
* Created on 2022/3/31
*/
public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteLineFragment> implements
public class BaseBusPassengerPresenter extends Presenter<BusPassengerBaseFragment> implements
IBusPassengerADASStatusCallback, IBusPassengerControllerStatusCallback, IBusPassegerDriverStatusCallback, IBusPassengerRouteLineInfoCallback, IBusPassengerAutopilotPlanningCallback {
private static final String TAG = BaseBusPassengerPresenter.class.getSimpleName();
public BaseBusPassengerPresenter(BusPassengerRouteLineFragment view) {
public BaseBusPassengerPresenter(BusPassengerBaseFragment view) {
super(view);
BusPassengerModel.getInstance().init(AbsMogoApplication.getApp());
initListeners();
@@ -86,17 +87,20 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteLineFr
@Override
public void onAutopilotEnable() {
runOnUIThread(() -> mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
}
@Override
public void onAutopilotDisable() {
runOnUIThread(() -> mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
}
@Override
public void onAutopilotRunning() {
runOnUIThread(() -> mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
@Override
@@ -107,27 +111,27 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteLineFr
@Override
public void onCarLocationChanged(Location location) {
if (location != null){
mView.onCarLocationChanged(location);
runOnUIThread(() -> mView.onCarLocationChanged(location));
}
}
@Override
public void changeOperationStatus(boolean changeStatus) {
mView.changeOperationStatus(changeStatus);
runOnUIThread(() -> mView.changeOperationStatus(changeStatus));
}
@Override
public void updateLineInfo(String lineName, String lineDurTime) {
mView.updateLineInfo(lineName, lineDurTime);
runOnUIThread(() -> mView.updateLineInfo(lineName, lineDurTime));
}
@Override
public void updateStationsInfo(List<BusPassengerStation> stations) {
mView.updateStationsInfo(stations);
public void updateStationsInfo(List<BusPassengerStation> stations,int currentStationIndex) {
runOnUIThread(() -> mView.updateStationsInfo(stations,currentStationIndex));
}
@Override
public void routeResult(List<LatLng> models) {
mView.routeResult(models);
runOnUIThread(() -> mView.routeResult(models));
}
}

View File

@@ -1,55 +1,44 @@
package com.mogo.och.bus.passenger.ui;
import android.location.Location;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.amap.api.maps.model.LatLng;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.app.AppConfigInfo;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.adapter.BusPassengerLineStationsAdapter;
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
/**
* Created on 2022/3/31
* <p>
* Bus乘客端基础Fragment
*/
public abstract class BusPassengerBaseFragment <V extends IView, P extends Presenter<V>> extends MvpFragment<V, P>{
public class BusPassengerBaseFragment extends MvpFragment<BusPassengerBaseFragment, BaseBusPassengerPresenter> {
private static final String TAG = BusPassengerBaseFragment.class.getSimpleName();
private FrameLayout mPassengerLayout;
protected TextView mCurrentArriveStation;
private TextView mCurrentArriveStation;
private ImageView mAutopilotIv;
private BusPassengerRouteLineDialogFragment mRouteFragment;
/**
* 改变自动驾驶状态
*
* @param status 2 - running 1 - enable 2 - disable
*/
private int mPrevAPStatus = -1;
@Override
protected int getLayoutId() {
@@ -65,7 +54,10 @@ public abstract class BusPassengerBaseFragment <V extends IView, P extends Prese
protected void initViews() {
//隐藏小地图
CallerSmpManager.INSTANCE.hidePanel();
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
mAutopilotIv = findViewById(R.id.bus_p_autopilot_iv);
showRouteFragment();
}
@@ -78,15 +70,64 @@ public abstract class BusPassengerBaseFragment <V extends IView, P extends Prese
* 显示线路信息
*/
public void showRouteFragment() {
mPassengerLayout = findViewById(R.id.bus_p_panel_container);
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), mPassengerLayout);
mRouteFragment = new BusPassengerRouteLineDialogFragment();
mRouteFragment.showNow(getChildFragmentManager(),"RouteFragment");
}
/**
* 获取站点面板view在{@link #initViews()}时候添加到container中
*
* @return 站点面板view
*/
public abstract int getStationPanelViewId();
public void updateArrivedStation(String station){
if (null == station){
mCurrentArriveStation.setText("----");
}else {
mCurrentArriveStation.setText(station);
}
}
@NonNull
@Override
protected BaseBusPassengerPresenter createPresenter() {
return new BaseBusPassengerPresenter(this);
}
public void onCarLocationChanged(Location location){
if (mRouteFragment != null) mRouteFragment.onCarLocationChanged(location);
}
public void changeOperationStatus(boolean changeStatus){
if (mRouteFragment != null) mRouteFragment.changeOperationStatus(changeStatus);
}
public void updateLineInfo(String lineName, String lineDurTime){
if (mRouteFragment != null) mRouteFragment.updateLineInfo(lineName,lineDurTime);
}
public void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex){
if (mRouteFragment != null) mRouteFragment.updateStationsInfo(stations);
updateArrivedStation(stations.get(currentStationIndex).getName());
}
public void routeResult(List<LatLng> models){
if (mRouteFragment != null) mRouteFragment.routeResult(models);
}
public void onAutopilotStatusChanged(int status) {
getActivity().runOnUiThread(() -> {
// 3. 其他过程直接更新
if (mPrevAPStatus != status){
AutopilotStatusChanged(status);
}
mPrevAPStatus = status;
});
}
public void AutopilotStatusChanged(int status) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
mAutopilotIv.setImageResource(R.drawable.bus_p_auto_nor);
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){
mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor);
} else {
mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor);
}
}
}

View File

@@ -38,7 +38,7 @@ import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil;
import java.util.ArrayList;
import java.util.List;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
/**
* 乘客屏小地图
@@ -88,7 +88,7 @@ public class BusPassengerMapDirectionView
}
private void initView(Context context) {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "initView");
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "initView");
mContext = context;
@@ -148,7 +148,7 @@ public class BusPassengerMapDirectionView
mAMap.setOnMapLoadedListener(new AMap.OnMapLoadedListener() {
@Override
public void onMapLoaded() {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "smp---onMapLoaded");
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "smp---onMapLoaded");
// 加载自定义样式
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
.setEnable(true)
@@ -173,7 +173,7 @@ public class BusPassengerMapDirectionView
@Override
public void onLocationChanged(@Nullable MogoLocation location) {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2 :" + location.getLatitude()+":"+location.getLongitude());
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude()+":"+location.getLongitude());
if (location == null){
return;
}
@@ -181,7 +181,7 @@ public class BusPassengerMapDirectionView
//更新车辆位置
if (mCarMarker != null) {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "location.getBearing() = " + location.getBearing());
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "location.getBearing() = " + location.getBearing());
mCarMarker.setRotateAngle(360 - location.getBearing());
mCarMarker.setPosition(currentLatLng);
mCarMarker.setToTop();
@@ -226,9 +226,9 @@ public class BusPassengerMapDirectionView
//设置线段纹理
PolylineOptions polylineOptions = new PolylineOptions();
polylineOptions.addAll(mCoordinatesLatLng);
polylineOptions.colorValues(colorList); // 1FC3FF -> 57ABFF
polylineOptions.colorValues(colorList);
polylineOptions.useGradient(true);
polylineOptions.width(5);
polylineOptions.width(10); //线段宽度
// 绘制线
mPolyline = mAMap.addPolyline(polylineOptions);
@@ -242,11 +242,7 @@ public class BusPassengerMapDirectionView
*/
private void addRouteColorList() {
for (int i = 0; i < mCoordinatesLatLng.size(); i++){
if (i <= mCoordinatesLatLng.size()/2){
colorList.add(Color.argb(255, 31, 195, 255));//start
}else {
colorList.add(Color.argb(255, 87, 171, 255));//end
}
colorList.add(Color.argb(255, 70, 147, 253));//路线颜色
}
}
@@ -270,7 +266,6 @@ public class BusPassengerMapDirectionView
@Override
public void clearPolyline() {
// mCoordinatesLatLng.clear();
if (mPolyline != null) {
mPolyline.remove();
}

View File

@@ -0,0 +1,446 @@
package com.mogo.och.bus.passenger.ui;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Point;
import android.location.Location;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.DialogFragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.amap.api.maps.model.LatLng;
import com.mogo.eagle.core.data.app.AppConfigInfo;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.adapter.BusPassengerLineStationsAdapter;
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
import com.mogo.och.bus.passenger.model.BusPassengerModel;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
/**
* @author: wangmingjun
* @date: 2022/4/8
*/
public class BusPassengerRouteLineDialogFragment extends DialogFragment implements IBusPassengerMapViewCallback {
private final String TAG = "BusPassengerRouteLineDialogFragment";
private BusPassengerTrafficLightView mTrafficLightView;
private List<BusPassengerStation> mStationsList = new ArrayList<>();
private TextView mSpeedTv;
private ConstraintLayout mNoLineInfoView;
private TextView mCarPlateNum;
private TextView mLineName;
private TextView mOperationTime;
private ConstraintLayout mRouteInfoView;
private RecyclerView mStationsListRv;
private BusPassengerMapDirectionView mMapDirectionView;
private ImageView mMapArrowIcon;
private RotateAnimation rotateAnimation;
private float lastBearing = 0;
private BusPassengerLineStationsAdapter mAdapter;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.bus_p_route_fragment, container, false);
initView(view);
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mMapDirectionView = view.findViewById(R.id.bus_p_line_map_view);
mMapDirectionView.onCreateView(savedInstanceState);
mMapDirectionView.setTaxiPassengerMapViewCallback(this);
}
@Override
public void onStart() {
super.onStart();
setCancelable(false);
getDialog().setCanceledOnTouchOutside(false);
Window window = getDialog().getWindow();
//dialog padding 去掉
window.getDecorView().setPadding(0,0,0,0);
window.setDimAmount(0f);
WindowManager.LayoutParams params = window.getAttributes();
CallerLogger.INSTANCE.d(M_BUS_P + TAG,"params.flags= "+params.flags);
params.flags = params.flags | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
CallerLogger.INSTANCE.d(M_BUS_P + TAG,"params.flags= "+params.flags);
params.x = 0;
params.y = 0;
WindowManager windowManager = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE);
Point point = new Point();
windowManager.getDefaultDisplay().getSize(point);
params.width = (int)(point.x * 0.225);
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
CallerLogger.INSTANCE.d(M_BUS_P + TAG,"width= "+params.width+"height= "+params.height);
window.setAttributes(params);
window.getDecorView().setBackgroundColor(Color.parseColor("#00FFFFFF"));//设置背景, 不然显示不全
window.setGravity(Gravity.RIGHT|Gravity.BOTTOM);
}
@Override
public void onResume() {
super.onResume();
if (mMapDirectionView != null) {
mMapDirectionView.onResume();
}
}
@Override
public void onPause() {
super.onPause();
if (mMapDirectionView != null) {
mMapDirectionView.onPause();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (mMapDirectionView != null) {
mMapDirectionView.onDestroy();
}
}
private void initView(View view) {
mTrafficLightView = view.findViewById(R.id.bus_p_traffic_light_view);
CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
mSpeedTv = view.findViewById(R.id.bus_p_speed_tv);
mNoLineInfoView = view.findViewById(R.id.bus_p_no_order_data_view);
mCarPlateNum = view.findViewById(R.id.bus_p_driver_num_plate_tv);
mLineName = view.findViewById(R.id.bus_p_line_name_tv);
mOperationTime = view.findViewById(R.id.line_operation_time_tv);
mRouteInfoView = view.findViewById(R.id.bus_p_line_cl);
mStationsListRv = view.findViewById(R.id.bus_p_line_stations_rl);
LinearLayoutManager manager = new LinearLayoutManager(getContext());
mStationsListRv.setLayoutManager(manager);
mAdapter = new BusPassengerLineStationsAdapter(getContext(), mStationsList);
mStationsListRv.setAdapter(mAdapter);
mMapArrowIcon = view.findViewById(R.id.bus_p_arrow_nor);
//测试
mSpeedTv.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
String listStr = "{\"models\":[{\n" +
"\t\t\"lat\": 40.19927810144466,\n" +
"\t\t\"lon\": 116.73527259387767\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19927836356079,\n" +
"\t\t\"lon\": 116.73513114732762\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19927759500293,\n" +
"\t\t\"lon\": 116.73497660879111\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.199264819842284,\n" +
"\t\t\"lon\": 116.73480063747202\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1992510141554,\n" +
"\t\t\"lon\": 116.73463922037767\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.199245872804,\n" +
"\t\t\"lon\": 116.73445960685193\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19924673374912,\n" +
"\t\t\"lon\": 116.73427704009703\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19924747108264,\n" +
"\t\t\"lon\": 116.7340707102972\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19924828745573,\n" +
"\t\t\"lon\": 116.73385916927226\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19924941093133,\n" +
"\t\t\"lon\": 116.73364048294795\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19924939253381,\n" +
"\t\t\"lon\": 116.73340837408566\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19924949105934,\n" +
"\t\t\"lon\": 116.73317368725336\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19925040039033,\n" +
"\t\t\"lon\": 116.73296532811216\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1992515355653,\n" +
"\t\t\"lon\": 116.73277787366743\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1992512720328,\n" +
"\t\t\"lon\": 116.73263377253741\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.199205174954606,\n" +
"\t\t\"lon\": 116.73249773114644\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1991015743076,\n" +
"\t\t\"lon\": 116.7324219601283\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.198971862686285,\n" +
"\t\t\"lon\": 116.73239393296355\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19883883071582,\n" +
"\t\t\"lon\": 116.73237676435652\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19870171355796,\n" +
"\t\t\"lon\": 116.73236052150362\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1985491853193,\n" +
"\t\t\"lon\": 116.73234157857011\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1983890047355,\n" +
"\t\t\"lon\": 116.73232167996464\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1982209877466,\n" +
"\t\t\"lon\": 116.73230101645792\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.198037574138326,\n" +
"\t\t\"lon\": 116.73227735486083\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19787327856243,\n" +
"\t\t\"lon\": 116.73225676816314\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19771917207499,\n" +
"\t\t\"lon\": 116.73223814728027\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.197548305175935,\n" +
"\t\t\"lon\": 116.73221624705808\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19739568979691,\n" +
"\t\t\"lon\": 116.73219618210774\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19724703821575,\n" +
"\t\t\"lon\": 116.73217598293311\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1970956560885,\n" +
"\t\t\"lon\": 116.73215773721505\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19697703483188,\n" +
"\t\t\"lon\": 116.73214337172284\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19687000725696,\n" +
"\t\t\"lon\": 116.73210037067965\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.196833449601726,\n" +
"\t\t\"lon\": 116.73196646708011\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19685833847804,\n" +
"\t\t\"lon\": 116.73181315361103\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.196889170203264,\n" +
"\t\t\"lon\": 116.73164355747393\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19692242860347,\n" +
"\t\t\"lon\": 116.7314555399657\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19696431701069,\n" +
"\t\t\"lon\": 116.7312261834129\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19700025925464,\n" +
"\t\t\"lon\": 116.73102774016093\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19703414798773,\n" +
"\t\t\"lon\": 116.73084270562073\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19707287604138,\n" +
"\t\t\"lon\": 116.73062835248406\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19710951629977,\n" +
"\t\t\"lon\": 116.73041744082339\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19714593807105,\n" +
"\t\t\"lon\": 116.73021414314803\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.197183297026285,\n" +
"\t\t\"lon\": 116.7300057066447\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.1972247359487,\n" +
"\t\t\"lon\": 116.7297751515664\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19726518822745,\n" +
"\t\t\"lon\": 116.72954958923812\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19730538240706,\n" +
"\t\t\"lon\": 116.72932440756041\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19734272112662,\n" +
"\t\t\"lon\": 116.72911631453036\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.197379191549075,\n" +
"\t\t\"lon\": 116.72890982812105\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.197417565369314,\n" +
"\t\t\"lon\": 116.72869447869044\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19746052080799,\n" +
"\t\t\"lon\": 116.72845641541247\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19750040582118,\n" +
"\t\t\"lon\": 116.72823569991117\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19753999704064,\n" +
"\t\t\"lon\": 116.72801998373052\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19757796882569,\n" +
"\t\t\"lon\": 116.72781280504363\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.197617062364586,\n" +
"\t\t\"lon\": 116.72759949431683\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19765391602761,\n" +
"\t\t\"lon\": 116.72739776789756\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19768973009218,\n" +
"\t\t\"lon\": 116.72719980764646\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.197726191028785,\n" +
"\t\t\"lon\": 116.72699719861669\n" +
"\t}, {\n" +
"\t\t\"lat\": 40.19776233489642,\n" +
"\t\t\"lon\": 116.72679516155276\n" +
"\t}]}\n";
List<MessagePad.Location> list = new ArrayList<>();
try {
JSONObject jsonObject = new JSONObject(listStr);
JSONArray jsonElements = jsonObject.getJSONArray("models");
for (int i = 0; i < jsonElements.length(); i++){
JSONObject s = jsonElements.getJSONObject(i);
MessagePad.Location.Builder routeModels = MessagePad.Location.newBuilder();
routeModels.setLatitude(s.getDouble("lat"));
routeModels.setLongitude(s.getDouble("lon"));
list.add(routeModels.build());
}
BusPassengerModel.getInstance().updateRoutePoints(list);
} catch (JSONException e) {
e.printStackTrace();
}
return false;
}
});
}
public void routeResult(List<LatLng> latLngList) {
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "routeResult:" + latLngList.size());
if (latLngList.size() > 0) {
drawablePolyline(latLngList);
} else {
clearPolyline();
}
}
/**
* 绘制
*
* @param coordinates
*/
private void drawablePolyline(List<LatLng> coordinates) {
if (mMapDirectionView != null) {
mMapDirectionView.setCoordinatesLatLng(coordinates);
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mMapDirectionView.drawablePolyline();
}
});
}
}
private void clearPolyline() {
if (mMapDirectionView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mMapDirectionView.clearPolyline();
}
});
}
}
public void changeOperationStatus(boolean status) {
if (status) {
mNoLineInfoView.setVisibility(View.GONE);
mRouteInfoView.setVisibility(View.VISIBLE);
} else {
mNoLineInfoView.setVisibility(View.VISIBLE);
mRouteInfoView.setVisibility(View.GONE);
}
}
public void updateLineInfo(String lineName, String lineDurTime) {
mLineName.setText(lineName);
mOperationTime.setText(lineDurTime);
mCarPlateNum.setText(null == AppConfigInfo.INSTANCE.getPlateNumber() ? "京B65H5B" : AppConfigInfo.INSTANCE.getPlateNumber());
}
public void updateStationsInfo(List<BusPassengerStation> stations) {
mStationsList.clear();
mStationsList.addAll(stations);
mAdapter.notifyDataSetChanged();
}
@Override
public void onCameraChange(float bearing) {
startIvCompass(bearing);
}
/**
* 设置指南针旋转
*
* @param bearing
*/
private void startIvCompass(float bearing) {
bearing = 360 - bearing;
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "startIvCompass: " + bearing);
rotateAnimation = new RotateAnimation(lastBearing, bearing, Animation.RELATIVE_TO_SELF
, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setFillAfter(true);
mMapArrowIcon.startAnimation(rotateAnimation);
lastBearing = bearing;
}
public void onCarLocationChanged(Location location) {
updateSpeedView(location.getSpeed());
}
public void updateSpeedView(float speed){
int speedKM = (int) (Math.abs(speed) * 3.6F);
mSpeedTv.setText(String.valueOf(speedKM));
}
}

View File

@@ -1,229 +0,0 @@
package com.mogo.och.bus.passenger.ui;
import android.location.Location;
import android.os.Bundle;
import android.os.Looper;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.amap.api.maps.model.LatLng;
import com.mogo.eagle.core.data.app.AppConfigInfo;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.adapter.BusPassengerLineStationsAdapter;
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
import java.util.ArrayList;
import java.util.List;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
/**
* @author: wangmingjun
* @date: 2022/4/6
*/
public class BusPassengerRouteLineFragment extends BusPassengerBaseFragment<BusPassengerRouteLineFragment, BaseBusPassengerPresenter>
implements IBusPassengerMapViewCallback {
private static final String TAG = BusPassengerBaseFragment.class.getSimpleName();
private BusPassengerTrafficLightView mTrafficLightView;
private List<BusPassengerStation> mStationsList = new ArrayList<>();
private TextView mSpeedTv;
private ConstraintLayout mNoLineInfoView;
private TextView mCarPlateNum;
private TextView mLineName;
private TextView mOperationTime;
private ConstraintLayout mRouteInfoView;
private RecyclerView mStationsListRv;
private BusPassengerMapDirectionView mMapDirectionView;
private ImageView mMapArrowIcon;
private RotateAnimation rotateAnimation;
private float lastBearing = 0;
public static BusPassengerRouteLineFragment newInstance() {
Bundle args = new Bundle();
BusPassengerRouteLineFragment fragment = new BusPassengerRouteLineFragment();
fragment.setArguments(args);
return fragment;
}
@Override
protected void initViews() {
super.initViews();
mTrafficLightView = findViewById(R.id.bus_p_traffic_light_view);
CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
mSpeedTv = findViewById(R.id.bus_p_speed_tv);
mNoLineInfoView = findViewById(R.id.bus_p_no_order_data_view);
mCarPlateNum = findViewById(R.id.bus_p_driver_num_plate_tv);
mLineName = findViewById(R.id.bus_p_line_name_tv);
mOperationTime = findViewById(R.id.line_operation_time_tv);
mRouteInfoView = findViewById(R.id.bus_p_line_cl);
mStationsListRv = findViewById(R.id.bus_p_line_stations_rl);
LinearLayoutManager manager = new LinearLayoutManager(getContext());
mStationsListRv.setLayoutManager(manager);
mStationsListRv.setAdapter(new BusPassengerLineStationsAdapter(getContext(), mStationsList));
mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor);
}
@Override
protected void initViews(Bundle savedInstanceState) {
super.initViews(savedInstanceState);
mMapDirectionView = findViewById(R.id.bus_p_line_map_view);
mMapDirectionView.onCreateView(savedInstanceState);
mMapDirectionView.setTaxiPassengerMapViewCallback(this);
}
@Override
public int getStationPanelViewId() {
return R.layout.bus_p_route_fragment;
}
@Override
public void onResume() {
super.onResume();
if (mMapDirectionView != null) {
mMapDirectionView.onResume();
}
}
@Override
public void onPause() {
super.onPause();
if (mMapDirectionView != null) {
mMapDirectionView.onPause();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (mMapDirectionView != null) {
mMapDirectionView.onDestroy();
}
}
public void routeResult(List<LatLng> latLngList) {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "routeResult:" + latLngList.size());
if (latLngList.size() > 0) {
drawablePolyline(latLngList);
} else {
clearPolyline();
}
}
/**
* 绘制
*
* @param coordinates
*/
private void drawablePolyline(List<LatLng> coordinates) {
if (mMapDirectionView != null) {
mMapDirectionView.setCoordinatesLatLng(coordinates);
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mMapDirectionView.drawablePolyline();
}
});
}
}
private void clearPolyline() {
if (mMapDirectionView != null) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mMapDirectionView.clearPolyline();
}
});
}
}
public void changeOperationStatus(boolean status) {
if (status) {
mNoLineInfoView.setVisibility(View.GONE);
mRouteInfoView.setVisibility(View.VISIBLE);
} else {
mNoLineInfoView.setVisibility(View.VISIBLE);
mRouteInfoView.setVisibility(View.GONE);
}
}
public void updateLineInfo(String lineName, String lineDurTime) {
mLineName.setText(lineName);
mOperationTime.setText(lineDurTime);
mCarPlateNum.setText(AppConfigInfo.INSTANCE.getPlateNumber());
}
public void updateStationsInfo(List<BusPassengerStation> stations) {
mStationsList.clear();
mStationsList.addAll(stations);
}
@Override
public void onCameraChange(float bearing) {
startIvCompass(bearing);
}
/**
* 设置指南针旋转
*
* @param bearing
*/
private void startIvCompass(float bearing) {
bearing = 360 - bearing;
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "startIvCompass: " + bearing);
rotateAnimation = new RotateAnimation(lastBearing, bearing, Animation.RELATIVE_TO_SELF
, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setFillAfter(true);
mMapArrowIcon.startAnimation(rotateAnimation);
lastBearing = bearing;
}
public void onCarLocationChanged(Location location) {
runOnUIThread(() -> updateSpeedView(location.getSpeed()));
}
public void updateSpeedView(float speed){
int speedKM = (int) (Math.abs(speed) * 3.6F);
mSpeedTv.setText(speedKM);
}
@NonNull
@Override
protected BaseBusPassengerPresenter createPresenter() {
return new BaseBusPassengerPresenter(this);
}
private void runOnUIThread(Runnable executor) {
if (executor == null) {
return;
}
if (Looper.myLooper() != Looper.getMainLooper()) {
UiThreadHandler.post(executor);
} else {
executor.run();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -5,7 +5,7 @@
<shape android:shape="rectangle">
<corners android:radius="@dimen/bus_p_station_tag_radius_size"/>
<gradient
android:angle="-225"
android:angle="90"
android:endColor="@color/bus_p_end_tag_bg_color1"
android:startColor="@color/bus_p_end_tag_bg_color2"
android:type="linear" />

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="@dimen/bus_p_cur_station_circle_width"
android:height="@dimen/bus_p_cur_station_circle_height">
<shape android:shape="rectangle">
<corners android:radius="@dimen/bus_p_mid_station_circle_cor"/>
<gradient
android:angle="90"
android:endColor="@color/bus_p_middle_station_circle_color1"
android:startColor="@color/bus_p_middle_station_circle_color2"
android:type="linear" />
</shape>
</item>
</layer-list>

View File

@@ -5,7 +5,7 @@
<shape android:shape="rectangle">
<corners android:radius="@dimen/bus_p_station_tag_radius_size"/>
<gradient
android:angle="-225"
android:angle="90"
android:endColor="@color/bus_p_start_tag_bg_color1"
android:startColor="@color/bus_p_start_tag_bg_color2"
android:type="linear" />

View File

@@ -5,52 +5,64 @@
android:layout_height="match_parent">
<ImageView
android:id="@+id/bus_p_autopilot_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin"
android:layout_marginTop="@dimen/bus_p_auto_icon_margin_top"
android:scaleType="fitXY"
android:layout_gravity="center_horizontal"
android:src="@drawable/bus_p_un_auto_nor"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<androidx.cardview.widget.CardView
android:id="@+id/iv_bg"
android:layout_width="@dimen/bus_p_curent_station_panel_width"
android:layout_height="@dimen/bus_p_curent_station_panel_height"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin"
android:layout_marginBottom="@dimen/bus_p_curent_station_panel_margin"
android:background="@color/bus_p_panel_cur_station_panel_color"/>
app:cardBackgroundColor="@color/bus_p_panel_cur_station_panel_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:cardCornerRadius="20px"/>
<TextView
android:id="@+id/bus_p_cur_station_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/bus_p_curent_station_txt_size"
android:textColor="@color/bus_p_panel_cur_txt_color"
android:text="@string/bus_p_cur_station_title"
app:layout_constraintLeft_toLeftOf="@+id/iv_bg"
app:layout_constraintTop_toTopOf="@+id/iv_bg"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginLeft="@dimen/dp_27"/>
android:id="@+id/bus_p_cur_station_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_27"
android:layout_marginTop="@dimen/dp_40"
android:elevation="4px"
android:text="@string/bus_p_cur_station_title"
android:textStyle="bold"
android:textColor="@color/bus_p_panel_cur_txt_color"
android:textSize="@dimen/bus_p_curent_station_txt_size"
app:layout_constraintLeft_toLeftOf="@+id/iv_bg"
app:layout_constraintTop_toTopOf="@+id/iv_bg" />
<TextView
android:id="@+id/bus_p_cur_station_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/bus_p_curent_station_txt_size1"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/bus_p_panel_cur_station_txt_color"
android:textSize="@dimen/bus_p_curent_station_txt_size1"
android:textStyle="bold"
android:elevation="4px"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title"
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title"
android:layout_marginTop="@dimen/dp_10" />
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title" />
<TextView
android:id="@+id/bus_p_cur_station_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/bus_p_curent_station_tip_size1"
android:textColor="@color/bus_p_panel_cur_station_tips_color"
android:layout_marginTop="@dimen/dp_20"
android:text="@string/bus_p_cur_station_arrived_tip"
android:elevation="4px"
android:textColor="@color/bus_p_panel_cur_station_tips_color"
android:textSize="@dimen/bus_p_curent_station_tip_size1"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_name"
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name"
android:layout_marginTop="@dimen/dp_20" />
<FrameLayout
android:id="@+id/bus_p_panel_container"
android:layout_width="@dimen/bus_p_route_info_panel_width"
android:layout_height="match_parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,138 +3,161 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bus_p_route_bg">
<TextView
android:id="@+id/bus_p_speed_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/bus_p_speed_txt_size"
android:textColor="@color/bus_p_speed_txt_color"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:includeFontPadding = "false"
android:letterSpacing="-0.05"
android:textStyle="bold"
android:text="0"
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
android:layout_marginTop="@dimen/bus_p_route_info_margin_top"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_speed_tv"
app:layout_constraintLeft_toRightOf="@+id/bus_p_speed_tv"
android:textColor="@color/bus_p_speed_txt_color"
android:textSize="@dimen/bus_p_speed_unit_txt_size"
android:text="@string/bus_p_speed_unit_txt"
android:includeFontPadding="false"
android:layout_marginBottom="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"/>
<com.mogo.och.bus.passenger.ui.BusPassengerTrafficLightView
android:id="@+id/bus_p_traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
android:layout_marginTop="@dimen/bus_p_route_info_margin_top"/>
<View
android:id="@+id/dividing_line_1"
android:layout_width="match_parent"
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
android:background="@drawable/bus_p_dividing_line_bg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv"
android:layout_marginTop="@dimen/bus_p_route_info_margin_top"/>
<include layout="@layout/bus_p_no_data_common_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1"
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bus_p_line_cl"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1"
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view">
<TextView
android:id="@+id/bus_p_driver_num_plate_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="@dimen/bus_p_driver_number_plate_margin_top"
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
android:textColor="@color/bus_p_driver_number_plate_color"
android:textSize="@dimen/bus_p_driver_number_plate_size"
android:textStyle="bold"
android:text="京 HBBB"/>
<TextView
android:id="@+id/bus_p_line_name_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/bus_p_line_name_color"
android:textSize="@dimen/bus_p_driver_number_plate_size"
android:layout_marginLeft="@dimen/dp_20"
android:text="15路"
app:layout_constraintTop_toTopOf="@+id/bus_p_driver_num_plate_tv"
app:layout_constraintLeft_toRightOf="@+id/bus_p_driver_num_plate_tv"/>
<TextView
android:id="@+id/line_operation_time_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/bus_p_line_operation_time_size"
android:textColor="@color/bus_p_line_operation_time_color"
app:layout_constraintTop_toTopOf="parent"
android:text="早 8:00 - 晚 8:00"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
android:layout_marginTop="@dimen/bus_p_line_operation_time_margin_top"/>
<View
android:id="@+id/dividing_line_2"
android:layout_width="match_parent"
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
android:background="@drawable/bus_p_dividing_line_bg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/bus_p_route_dividing_line2_margin_top"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/bus_p_line_stations_rl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/dividing_line_2"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.mogo.och.bus.passenger.ui.BusPassengerMapDirectionView
android:id="@+id/bus_p_line_map_view"
android:layout_width="match_parent"
android:layout_height="@dimen/bus_p_route_line_map_view_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
android:background="@android:color/transparent">
<ImageView
android:id="@+id/bus_p_arrow_nor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_430"
android:src="@drawable/bus_p_arrow_nor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
android:id="@+id/edge_view"
android:layout_width="@dimen/dp_10"
android:layout_height="match_parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/bus_p_route_view_left_edge_shadow"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:background="@drawable/bus_p_route_bg"
app:layout_constraintLeft_toRightOf="@+id/edge_view"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/bus_p_speed_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
android:layout_marginTop="@dimen/bus_p_route_info_margin_top"
android:includeFontPadding="false"
android:letterSpacing="-0.05"
android:text="0"
android:textColor="@color/bus_p_speed_txt_color"
android:textSize="@dimen/bus_p_speed_txt_size"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
android:layout_marginBottom="@dimen/dp_20"
android:includeFontPadding="false"
android:text="@string/bus_p_speed_unit_txt"
android:textColor="@color/bus_p_speed_txt_color"
android:textSize="@dimen/bus_p_speed_unit_txt_size"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_speed_tv"
app:layout_constraintLeft_toRightOf="@+id/bus_p_speed_tv" />
<com.mogo.och.bus.passenger.ui.BusPassengerTrafficLightView
android:id="@+id/bus_p_traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/bus_p_route_info_margin_top"
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/dividing_line_1"
android:layout_width="match_parent"
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
android:layout_marginTop="@dimen/dp_30"
android:background="@drawable/bus_p_dividing_line_bg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv" />
<include
layout="@layout/bus_p_no_data_common_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bus_p_line_cl"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1">
<TextView
android:id="@+id/bus_p_driver_num_plate_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
android:layout_marginTop="@dimen/bus_p_driver_number_plate_margin_top"
android:text="京 HBBB"
android:textColor="@color/bus_p_driver_number_plate_color"
android:textSize="@dimen/bus_p_driver_number_plate_size"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/bus_p_line_name_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:text="15路"
android:textColor="@color/bus_p_line_name_color"
android:textSize="@dimen/bus_p_driver_number_plate_size"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/bus_p_driver_num_plate_tv"
app:layout_constraintTop_toTopOf="@+id/bus_p_driver_num_plate_tv"
app:layout_goneMarginLeft="0px" />
<TextView
android:id="@+id/line_operation_time_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/bus_p_line_operation_time_margin_top"
android:text="早 8:00 - 晚 8:00"
android:textColor="@color/bus_p_line_operation_time_color"
android:textSize="@dimen/bus_p_line_operation_time_size"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/dividing_line_2"
android:layout_width="match_parent"
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
android:layout_marginTop="@dimen/bus_p_route_dividing_line2_margin_top"
android:background="@drawable/bus_p_dividing_line_bg"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/bus_p_line_stations_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/bus_p_driver_number_plate_margin_top"
android:paddingLeft="@dimen/bus_p_route_info_margin_left"
android:paddingRight="@dimen/bus_p_route_info_margin_right"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
app:layout_constraintTop_toBottomOf="@+id/dividing_line_2" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.mogo.och.bus.passenger.ui.BusPassengerMapDirectionView
android:id="@+id/bus_p_line_map_view"
android:layout_width="match_parent"
android:layout_height="@dimen/bus_p_route_line_map_view_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<ImageView
android:id="@+id/bus_p_arrow_nor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_400"
android:src="@drawable/bus_p_arrow_nor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -8,7 +8,7 @@
android:layout_width="@dimen/bus_p_station_tag_line_width"
android:layout_height="@dimen/bus_p_station_tag_line_height"
android:background="@color/bus_p_tag_line_color"
android:layout_marginLeft="@dimen/dp_3"
android:layout_marginLeft="@dimen/dp_7"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
@@ -18,13 +18,15 @@
android:layout_height="wrap_content"
android:text="--"
android:textSize="@dimen/bus_p_station_txt_size"
android:textStyle="bold"
android:includeFontPadding = "false"
android:textColor="@color/bus_p_station_txt_color"
android:layout_marginLeft="@dimen/dp_25"
app:layout_constraintLeft_toRightOf="@+id/bus_p_end_circle"
android:layout_marginLeft="@dimen/dp_45"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_p_end_tag"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_end_tag"/>
<View
<ImageView
android:id="@+id/bus_p_end_circle"
android:layout_width="@dimen/bus_p_station_circle_width_height"
android:layout_height="@dimen/bus_p_station_circle_width_height"
@@ -35,10 +37,9 @@
<ImageView
android:id="@+id/bus_p_cur_end_station_tag"
android:layout_width="@dimen/bus_p_cur_station_circle_width"
android:layout_height="@dimen/bus_p_cur_station_circle_height"
android:background="@drawable/bg_bus_p_middle_station"
android:layout_height="wrap_content"
android:background="@drawable/bg_bus_p_arrived_station"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_p_end_station"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_end_station"/>
<ImageView

View File

@@ -8,14 +8,14 @@
android:layout_width="@dimen/bus_p_station_tag_line_width"
android:layout_height="@dimen/bus_p_station_tag_line_height"
android:background="@color/bus_p_tag_line_color"
android:layout_marginLeft="@dimen/dp_3"
android:layout_marginLeft="@dimen/dp_7"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<ImageView
android:layout_width="@dimen/bus_p_station_tag_line_width"
android:layout_height="@dimen/bus_p_station_tag_line_height"
android:background="@color/bus_p_tag_line_color"
android:layout_marginLeft="@dimen/dp_3"
android:layout_marginLeft="@dimen/dp_7"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<TextView
@@ -24,18 +24,20 @@
android:layout_height="wrap_content"
android:text="--"
android:textSize="@dimen/bus_p_station_txt_size"
android:textStyle="bold"
android:includeFontPadding = "false"
android:textColor="@color/bus_p_current_station_txt_color"
android:layout_marginLeft="@dimen/dp_25"
app:layout_constraintLeft_toRightOf="@+id/bus_p_middle_tag"
app:layout_constraintTop_toTopOf="@+id/bus_p_middle_tag"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_middle_tag"/>
android:layout_marginLeft="@dimen/dp_45"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="@+id/bus_p_middle_tag"
android:layout_width="@dimen/bus_p_cur_station_circle_width"
android:layout_height="@dimen/bus_p_cur_station_circle_height"
android:background="@drawable/bg_bus_p_middle_station"
android:layout_height="wrap_content"
android:background="@drawable/bg_bus_p_arrived_station"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>

View File

@@ -8,7 +8,7 @@
android:layout_width="@dimen/bus_p_station_tag_line_width"
android:layout_height="@dimen/bus_p_station_tag_line_height"
android:background="@color/bus_p_tag_line_color"
android:layout_marginLeft="@dimen/dp_3"
android:layout_marginLeft="@dimen/dp_7"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
@@ -18,9 +18,11 @@
android:layout_height="wrap_content"
android:text="--"
android:textSize="@dimen/bus_p_station_txt_size"
android:textStyle="bold"
android:includeFontPadding = "false"
android:textColor="@color/bus_p_station_txt_color"
android:layout_marginLeft="@dimen/dp_25"
app:layout_constraintLeft_toRightOf="@+id/bus_p_start_circle"
android:layout_marginLeft="@dimen/dp_45"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_p_start_tag"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_start_tag"/>
@@ -36,11 +38,10 @@
<ImageView
android:id="@+id/bus_p_cur_start_station_tag"
android:layout_width="@dimen/bus_p_cur_station_circle_width"
android:layout_height="@dimen/bus_p_cur_station_circle_height"
android:background="@drawable/bg_bus_p_middle_station"
android:layout_height="wrap_content"
android:background="@drawable/bg_bus_p_arrived_station"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_p_start_station"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_start_station"/>
app:layout_constraintTop_toTopOf="@+id/bus_p_start_station"/>
<ImageView
android:id="@+id/bus_p_start_tag"

View File

@@ -4,7 +4,7 @@
<dimen name="bus_p_route_info_margin_right">40px</dimen>
<dimen name="bus_p_route_info_margin_left">40px</dimen>
<dimen name="bus_p_route_info_margin_bottom">40px</dimen>
<dimen name="bus_p_route_info_margin_top">57px</dimen>
<dimen name="bus_p_route_info_margin_top">70px</dimen>
<dimen name="bus_p_route_line_info_height">224px</dimen>
<dimen name="bus_p_route_line_map_view_height">510px</dimen>
<dimen name="bus_p_route_line_dividing_view_height">1px</dimen>
@@ -36,8 +36,8 @@
<dimen name="bus_p_station_circle_width_height">20px</dimen>
<dimen name="bus_p_station_tag_width_height">50px</dimen>
<dimen name="bus_p_station_tag_radius_size">25px</dimen>
<dimen name="bus_p_cur_station_circle_width">12px</dimen>
<dimen name="bus_p_cur_station_circle_height">34px</dimen>
<dimen name="bus_p_cur_station_circle_width">20px</dimen>
<dimen name="bus_p_cur_station_circle_height">50px</dimen>
<dimen name="bus_p_mid_station_circle_cor">6px</dimen>
<dimen name="bus_p_station_txt_size">36px</dimen>
<dimen name="bus_p_station_tag_txt_size">28px</dimen>

View File

@@ -24,4 +24,5 @@
<color name="bus_p_panel_cur_station_txt_color">#0043FF</color>
<color name="bus_p_panel_cur_station_tips_color">#2D3E5F</color>
<color name="bus_p_panel_cur_station_panel_color">#E6E9EFFC</color>
<color name="bus_p_route_view_left_edge_shadow">#33394C63</color>
</resources>

View File

@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="bus_p_route_info_panel_width">560px</dimen>
<dimen name="bus_p_auto_icon_margin_top">40px</dimen>
<dimen name="bus_p_route_info_margin_right">40px</dimen>
<dimen name="bus_p_route_info_margin_left">40px</dimen>
<dimen name="bus_p_route_info_margin_bottom">40px</dimen>
<dimen name="bus_p_route_info_margin_top">57px</dimen>
<dimen name="bus_p_route_info_margin_top">70px</dimen>
<dimen name="bus_p_route_line_info_height">224px</dimen>
<dimen name="bus_p_route_line_map_view_height">510px</dimen>
<dimen name="bus_p_route_line_dividing_view_height">1px</dimen>
@@ -36,8 +37,8 @@
<dimen name="bus_p_station_circle_width_height">20px</dimen>
<dimen name="bus_p_station_tag_width_height">50px</dimen>
<dimen name="bus_p_station_tag_radius_size">25px</dimen>
<dimen name="bus_p_cur_station_circle_width">12px</dimen>
<dimen name="bus_p_cur_station_circle_height">34px</dimen>
<dimen name="bus_p_cur_station_circle_width">20px</dimen>
<dimen name="bus_p_cur_station_circle_height">50px</dimen>
<dimen name="bus_p_mid_station_circle_cor">6px</dimen>
<dimen name="bus_p_station_txt_size">36px</dimen>
<dimen name="bus_p_station_tag_txt_size">28px</dimen>