diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 740794bd48..771c1f74d7 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -89,7 +89,6 @@ diff --git a/OCH/mogo-och-taxi/build.gradle b/OCH/mogo-och-taxi/build.gradle index dad79886c1..8a55d2b6af 100644 --- a/OCH/mogo-och-taxi/build.gradle +++ b/OCH/mogo-och-taxi/build.gradle @@ -40,6 +40,7 @@ dependencies { implementation rootProject.ext.dependencies.arouter annotationProcessor rootProject.ext.dependencies.aroutercompiler implementation rootProject.ext.dependencies.rxandroid + implementation rootProject.ext.dependencies.androidxconstraintlayout if (Boolean.valueOf(RELEASE)) { implementation rootProject.ext.dependencies.mogooch diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/IMogoOCHTaxiArriveCallback.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/IMogoOCHTaxiArriveCallback.java index 349f4baf89..1832059020 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/IMogoOCHTaxiArriveCallback.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/IMogoOCHTaxiArriveCallback.java @@ -9,6 +9,8 @@ public */ interface IMogoOCHTaxiArriveCallback { + void onTheWay2StartStation(); + /** * 到达起始站 */ diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiFragment.java index 341119683a..231b02e613 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiFragment.java @@ -2,6 +2,7 @@ package com.mogo.och.taxi.ui; import android.os.Bundle; import android.view.View; +import android.widget.TextView; import androidx.annotation.NonNull; @@ -38,6 +39,11 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i return fragment; } + private TextView mOrderStatus; + private TextView mStartStationName; + private TextView mEndStationName; + private TextView mDistance; + @Override public int getStationPanelViewId() { return R.layout.module_och_taxi_panel; @@ -46,6 +52,11 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i @Override protected void initViews() { super.initViews(); + mOrderStatus = findViewById( R.id.module_och_taxi_order_status ); + mStartStationName = findViewById( R.id.module_och_taxi_order_start_station ); + mEndStationName = findViewById( R.id.module_och_taxi_order_end_station ); + mDistance = findViewById( R.id.module_och_taxi_order_distance ); + if ( MogoApisHandler.getInstance() .getApis() .getStatusManagerApi() @@ -90,22 +101,29 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i } private void initOrderStatus() { + if ( MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() ) { + mStartStationName.setText( MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().startStation ); + mEndStationName.setText( MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().endStation ); + mDistance.setText( MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().travelDistance + " km" ); + } if ( MogoOCHTaxiModel.getInstance().isArriveAtEndStation() ) { Logger.d( TAG, "已经达到终点" ); slidePanelView.setVisibility( View.VISIBLE ); slidePanelView.setText( getString( R.string.module_och_taxi_arrive_at_end_station ) ); - return; - } - if ( MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() ) { + mOrderStatus.setText( "已到达乘客下车地点" ); + } else if ( MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() ) { Logger.d( TAG, "已经去往终点" ); slidePanelView.setVisibility( View.GONE ); - return; - } - if ( MogoOCHTaxiModel.getInstance().isArriveAtStartStation() ) { + mOrderStatus.setText( "去往下车地点" ); + } else if ( MogoOCHTaxiModel.getInstance().isArriveAtStartStation() ) { Logger.d( TAG, "已经达到起点" ); slidePanelView.setVisibility( View.VISIBLE ); slidePanelView.setText( getString( R.string.module_och_taxi_arrive_at_start_station ) ); - return; + mOrderStatus.setText( "已到达上车地点,等待乘客上车" ); + } else if ( MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() ) { + Logger.d( TAG, "去往上车站点" ); + slidePanelView.setVisibility( View.GONE ); + mOrderStatus.setText( "收到新订单,正在前往上车地点" ); } } @@ -115,6 +133,12 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i initOrderStatus(); } + @Override + public void onTheWay2StartStation() { + Logger.d( TAG, "去往上车站点" ); + initOrderStatus(); + } + @Override public void onArriveAtEndStation() { Logger.d( TAG, "通知达到终点" ); diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiUiController.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiUiController.java index c29568768c..6b696fef07 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiUiController.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiUiController.java @@ -94,6 +94,11 @@ class OCHTaxiUiController implements IMogoOCHTaxiArriveCallback { this.mOCHTaxiArriveCallback = OCHTaxiArriveCallback; } + @Override + public void onTheWay2StartStation() { + + } + @Override public void onArriveAtStartStation() { runOnUIThread( () -> { diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_blue_dot.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_blue_dot.png new file mode 100644 index 0000000000..e1fd463963 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_blue_dot.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_dot_line.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_dot_line.png new file mode 100644 index 0000000000..186001352c Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_dot_line.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_green_dot.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_green_dot.png new file mode 100644 index 0000000000..a676a789c3 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/module_och_taxi_green_dot.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable/module_och_taxi_panel_bkg.xml b/OCH/mogo-och-taxi/src/main/res/drawable/module_och_taxi_panel_bkg.xml new file mode 100644 index 0000000000..d6aa33cbcd --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/res/drawable/module_och_taxi_panel_bkg.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/res/drawable/module_och_taxi_panel_distance_bkg.xml b/OCH/mogo-och-taxi/src/main/res/drawable/module_och_taxi_panel_distance_bkg.xml new file mode 100644 index 0000000000..998e8eeaaf --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/res/drawable/module_och_taxi_panel_distance_bkg.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/res/layout/module_och_taxi_panel.xml b/OCH/mogo-och-taxi/src/main/res/layout/module_och_taxi_panel.xml index 30ea93e8e1..20eacb3fbd 100644 --- a/OCH/mogo-och-taxi/src/main/res/layout/module_och_taxi_panel.xml +++ b/OCH/mogo-och-taxi/src/main/res/layout/module_och_taxi_panel.xml @@ -1,27 +1,147 @@ + android:layout_marginLeft="30px" + android:layout_marginTop="24px" + android:text="已到达上车站点,等待乘客上车" + android:textColor="@color/module_och_order_status_textColor" + android:textSize="24px" + android:textStyle="bold" /> -