This commit is contained in:
lixiaopeng
2021-06-24 15:18:12 +08:00
parent 2fb900ef06
commit 8a3ee2fa0f
2 changed files with 12 additions and 1 deletions

View File

@@ -101,6 +101,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
getActivity().runOnUiThread( () -> {
if ( stationList == null ) {
// 获取小巴数据失败
Logger.e("liyz", " stationList == null ");
return;
}
@@ -163,7 +164,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
} else if ( isArriveAtStation ) {
showSlidePanle( "滑动出发" );
}
Logger.d("liyz", "renderCurrentStationStatus -----> ");
mCurrentStationName.setText( currentStationName );
mNextStationName.setText( nextStationName );
mStartStationFlag.setVisibility( startStationFlagVisibility );

View File

@@ -3,6 +3,7 @@ package com.mogo.och.bus.presenter;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
@@ -94,6 +95,8 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
@Override
public void onCreate( @NonNull LifecycleOwner owner ) {
super.onCreate( owner );
Log.d(TAG, "onCreate ------> ");
Log.d("liyz", "onCreate ------> ");
queryOperationStatus();
queryBusRoutes();
}
@@ -103,6 +106,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
*/
public void queryBusRoutes() {
Logger.d( TAG, "查询小巴路线");
Logger.d( "liyz", "查询小巴路线------->");
double lat = 40.1974932972;
double lon = 116.7354579447;
@@ -118,13 +122,16 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
@Override
public void onSuccess( OchBusRoutesResponse o ) {
super.onSuccess( o );
Logger.d( "liyz", "-----1-------- o =" + o);
if ( o == null
|| o.getResult() == null
|| o.getResult().getSite() == null
|| o.getResult().getSite().isEmpty() ) {
Logger.e( "liyz", "-----2-------- ");
return;
}
Logger.d( TAG, "获取到小巴路线数据: " + o );
Logger.d( "liyz", "获取到小巴路线数据: " + o );
renderBusStationsStatus( o.getResult().getSite() );
}
@@ -132,6 +139,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
public void onError( Throwable e ) {
super.onError( e );
Logger.e( TAG, e, "获取小巴路线图失败" );
Logger.d( "liyz", "获取小巴路线图失败 ");
// 重复请求小巴路线,直至成功
queryBusStationDelay();
}
@@ -140,6 +148,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
public void onError( String message, int code ) {
super.onError( message, code );
Logger.e( TAG, "获取小巴路线失败 code: " + code + " msg: " + message );
Logger.e( "liyz", "获取小巴路线失败 code: " + code + " msg: " + message );
// 重复请求小巴路线,直至成功
queryBusStationDelay();
}
@@ -153,6 +162,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
*/
private void renderBusStationsStatus( List< OchBusStation > site ) {
Logger.d( TAG, "渲染站点信息");
Logger.e( "liyz", "渲染站点信息");
int lastStopStation = getNextStopStation();