[290 bus司机端] UI调整

This commit is contained in:
wangmingjun
2022-07-15 20:04:40 +08:00
parent b14997591f
commit 747a61330f
24 changed files with 80 additions and 88 deletions

View File

@@ -9,5 +9,5 @@ import java.util.List;
* @date: 2021/10/22
*/
public interface IRefreshBusStationsCallback {
void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
void refreshBusStations(String lineName,List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
}

View File

@@ -46,6 +46,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
private TextView mCurrentTag;
private TextView mNextTag;
private TextView mSwitchLine; //切换路线
private TextView mLineName;
private int mCurrentStation = 0;
private View mBus;
@@ -67,6 +68,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
mNextStationName = findViewById(R.id.module_och_bus_order_end_station);
mNextTag = findViewById(R.id.module_och_bus_next_station_anchor);
mSwitchLine = findViewById(R.id.switch_line_btn);
mLineName = findViewById(R.id.module_och_bus_line_name);
if (DebugConfig.isDebug()) {
mBus.setOnClickListener(view -> {
@@ -126,7 +128,8 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
* @param nextStation 下个站点
* @param isArrived 是否都站
*/
public void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived) {
public void refreshBusStations(String lineName,List<BusStationBean> stationList
, int currentStation, int nextStation, boolean isArrived) {
mCurrentStation = currentStation;
if (getActivity() == null) {
return;
@@ -138,14 +141,14 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}
// 渲染小巴路线数据
renderCurrentStationStatus(stationList, currentStation, nextStation, isArrived);
renderCurrentStationStatus(lineName,stationList, currentStation, nextStation, isArrived);
});
}
/**
* 重新刷新站点信息 isArrived 是否到站
*/
private void renderCurrentStationStatus(List<BusStationBean> stationList, int currentStation
private void renderCurrentStationStatus(String lineName,List<BusStationBean> stationList, int currentStation
, int nextStation, boolean isArrived) {
CallerLogger.INSTANCE.d(M_BUS + "MapMaker ", "currentStation=" + currentStation + ",nextStation=" + nextStation + "isArrived=" + isArrived);
String currentStationName = null;
@@ -155,6 +158,8 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
boolean isArriveAtStation = false;
boolean isArriveAtStartStation = false;
mLineName.setText(lineName);
// 获取当前站点的名称
currentStationName = stationList.get(currentStation).getName();

View File

@@ -572,7 +572,7 @@ public class BusOrderModel {
if (site != null && site.size() > 0){
backgroundCurrentStationIndex ++;
if (refreshBusStationsCallback != null){
refreshBusStationsCallback.refreshBusStations(stationList, backgroundCurrentStationIndex
refreshBusStationsCallback.refreshBusStations(busRoutesResult.getName(),stationList, backgroundCurrentStationIndex
, getNextStopStation(),true);
}
}
@@ -756,7 +756,7 @@ public class BusOrderModel {
// refreshBusStationsCallback.refreshBusStations(stationList
// , currentStationIndex, getNextStopStation(),true);
// }
refreshBusStationsCallback.refreshBusStations(stationList
refreshBusStationsCallback.refreshBusStations(result.getName(),stationList
, backgroundCurrentStationIndex, getNextStopStation(),true);
}
if ( currentStation.isLeaving() && slidePannelHideCallback != null) {

View File

@@ -120,14 +120,15 @@ public class BusPresenter extends Presenter<BusFragment>
}
@Override
public void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived) {
public void refreshBusStations(String lineName,List<BusStationBean> stationList
, int currentStation, int nextStation, boolean isArrived) {
mStationList.clear();
mStationList.addAll(stationList);
mCurrentStation = currentStation;
// functionDemoModeChange();
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
if (mView != null) {
runOnUIThread(() -> mView.refreshBusStations(
runOnUIThread(() -> mView.refreshBusStations(lineName,
stationList, currentStation, nextStation, isArrived));
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,46 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#293159" android:startColor="#293159" />
</shape>
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
</item>
<!-- <item android:state_pressed="false">-->
<!-- <shape android:shape="rectangle">-->
<!-- <corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />-->
<!-- <gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />-->
<!-- </shape>-->
<!-- </item>-->
<item android:state_selected="true">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#2B6EFF" android:startColor="#2B6EFF" />
</shape>
<item android:state_selected="true" android:drawable="@drawable/start_success">
</item>
<item android:state_selected="false">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
</shape>
<item android:state_selected="false" android:drawable="@drawable/start_failure">
</item>
<item android:state_focused="true">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#293159" android:startColor="#293159" />
</shape>
<item android:state_focused="true" android:drawable="@drawable/press_start_status">
</item>
<item android:state_focused="false">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
</shape>
<item android:state_focused="false" android:drawable="@drawable/start_failure">
</item>
<item>
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
</shape>
<item android:drawable="@drawable/start_failure">
</item>
</selector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:angle="180" android:endColor="#000B4B" android:startColor="#001C83" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:angle="180" android:endColor="#0027FF" android:startColor="#4267FF" />
</shape>
</item>
</selector>

View File

@@ -5,7 +5,7 @@
<corners android:bottomLeftRadius="40px"
android:bottomRightRadius="40px"/>
<gradient android:angle="180" android:endColor="#20AAFF" android:startColor="#004DFF" />
<gradient android:angle="180" android:endColor="#004DFF" android:startColor="#20AAFF" />
</shape>
</item>
</selector>

View File

@@ -29,9 +29,7 @@
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
android:layout_marginTop="@dimen/bus_ext_arcView_top"
android:background="@drawable/bus_autopilot_status_bg"
app:layout_constraintLeft_toLeftOf="parent"
android:gravity="center"
@@ -39,21 +37,22 @@
<ImageView
android:id="@+id/bus_autopilot_btn_iv"
android:layout_width="56px"
android:layout_height="56px"
android:layout_width="73px"
android:layout_height="73px"
android:layout_centerVertical="true"
android:src="@drawable/bus_ic_autopilot" />
<TextView
android:id="@+id/bus_autopolot_btn_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="自动驾驶"
android:layout_centerVertical="true"
android:layout_marginLeft="28px"
android:layout_toRightOf="@+id/bus_autopilot_btn_iv"
android:text="自动驾驶"
android:textColor="@color/bus_autopilot_text_color_normal"
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
android:layout_centerVertical="true"
android:textStyle="bold"/>
android:textStyle="bold" />
</RelativeLayout>
@@ -61,10 +60,7 @@
android:id="@+id/module_mogo_och_station_panel_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/module_mogo_och_autopilot_order_m_t"
android:elevation="@dimen/bus_dp_10"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@+id/module_mogo_och_autopilot_status"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
tools:visibility="visible" />

View File

@@ -4,37 +4,37 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/module_och_bus_order_status_stationInfo"
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
android:layout_height="@dimen/module_mogo_och_autopilot_order_bg_height"
android:layout_height="wrap_content"
android:background="@drawable/bus_line_panel_bg"
android:paddingBottom="@dimen/module_och_bus_order_status_stationInfo_paddingBottom"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/module_och_bus_line_name"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_68"
android:layout_marginRight="@dimen/dp_196"
android:layout_marginTop="@dimen/dp_64"
android:ellipsize="end"
android:maxLines="1"
android:text="--"
android:textColor="#FFF"
android:textSize="38px"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/module_och_bus_tag"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/module_och_bus_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_109"
android:layout_height="@dimen/dp_42"
android:layout_gravity="right"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_60"
android:background="@drawable/bus_panel_anchor_bkg"
android:paddingLeft="@dimen/module_mogo_och_autopilot_order_tag_p_r"
android:paddingTop="2px"
android:paddingRight="@dimen/module_mogo_och_autopilot_order_tag_p_r"
android:paddingBottom="2px"
android:gravity="center"
android:text="小巴车"
android:textColor="#FFF"
android:textSize="@dimen/module_mogo_och_autopilot_order_tag_height"
@@ -46,21 +46,21 @@
<View
android:id="@+id/line1"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_2"
android:layout_marginLeft="@dimen/dp_16"
android:layout_height="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginRight="@dimen/dp_15"
android:background="@color/bus_arrived_dash_color"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:background="@drawable/bus_line_dividing_line1_selector"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_tag" />
<View
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_2"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_15"
android:background="@color/bus_arriving_start_dash_color"
android:layout_height="@dimen/dp_4"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:background="@drawable/bus_line_dividing_line2_selector"
app:layout_constraintLeft_toLeftOf="@+id/line1"
app:layout_constraintRight_toRightOf="@+id/line1"
app:layout_constraintTop_toBottomOf="@+id/line1" />
@@ -70,7 +70,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14px"
android:layout_marginTop="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_24"
android:text="当前站点:"
android:textColor="#CAD6FF"
android:textSize="@dimen/module_och_bus_order_start_station_anchor_textSize"
@@ -157,12 +157,15 @@
android:id="@+id/switch_line_btn"
android:layout_width="@dimen/bus_switch_line_btn_width_1"
android:layout_height="@dimen/bus_switch_line_btn_height_1"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_30"
android:background="@drawable/bus_switch_line_btn"
android:gravity="center"
android:text="@string/bus_switch_line_btn"
android:textColor="@android:color/white"
android:textSize="@dimen/module_mogo_och_bus_station_notice_text_size"
android:visibility="visible"
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_order_end_station"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />

View File

@@ -14,7 +14,7 @@
<dimen name="module_mogo_och_bus_current_station_name_text_size">32px</dimen>
<dimen name="module_mogo_och_bus_current_station_notice_text_size">20px</dimen>
<dimen name="module_mogo_och_bus_station_name_text_size">40px</dimen>
<dimen name="module_mogo_och_bus_station_notice_text_size">32px</dimen>
<dimen name="module_mogo_och_bus_station_notice_text_size">42px</dimen>
<dimen name="module_mogo_och_bus_station_name_margin_left">15px</dimen>
@@ -57,7 +57,7 @@
<dimen name="module_mogo_och_autopilot_order_tag_height">28px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_m_t">20px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_m_r">20px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_p_r">16px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_p_r">64px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_p_l">16px</dimen>
<dimen name="module_mogo_och_margin_left">40px</dimen>
@@ -77,8 +77,8 @@
<dimen name="module_mogo_och_slide_panel_textSize">70px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_corner">24px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_width">460px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_height">140px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_width">616px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_height">180px</dimen>
<dimen name="module_mogo_och_operation_status_bg_width">112px</dimen>
<dimen name="module_mogo_och_operation_status_bg_height">112px</dimen>
@@ -90,7 +90,7 @@
<dimen name="module_mogo_och_autopilot_order_bg_height">754px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_size">36px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_size">40px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_padding_top">13px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_drawable_padding">12px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_m_l">350px</dimen>

View File

@@ -14,7 +14,7 @@
<dimen name="module_mogo_och_bus_current_station_name_text_size">32px</dimen>
<dimen name="module_mogo_och_bus_current_station_notice_text_size">20px</dimen>
<dimen name="module_mogo_och_bus_station_name_text_size">40px</dimen>
<dimen name="module_mogo_och_bus_station_notice_text_size">32px</dimen>
<dimen name="module_mogo_och_bus_station_notice_text_size">42px</dimen>
<dimen name="module_mogo_och_bus_station_name_margin_left">15px</dimen>
@@ -57,7 +57,7 @@
<dimen name="module_mogo_och_autopilot_order_tag_height">25.6px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_m_t">20px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_m_r">20px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_p_r">16px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_p_r">64px</dimen>
<dimen name="module_mogo_och_autopilot_order_tag_p_l">16px</dimen>
<dimen name="module_mogo_och_margin_left">40px</dimen>
@@ -77,8 +77,8 @@
<dimen name="module_mogo_och_slide_panel_textSize">70px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_corner">24px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_width">460px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_height">140px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_width">616px</dimen>
<dimen name="module_mogo_och_autopilot_status_bg_height">180px</dimen>
<dimen name="module_mogo_och_operation_status_bg_width">112px</dimen>
<dimen name="module_mogo_och_operation_status_bg_height">112px</dimen>
@@ -90,7 +90,7 @@
<dimen name="module_mogo_och_autopilot_order_bg_height">754px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_size">36px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_size">40px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_padding_top">13px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_drawable_padding">12px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_m_l">350px</dimen>