diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 771c1f74d7..740794bd48 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -89,6 +89,7 @@ diff --git a/OCH/mogo-och-bus/build.gradle b/OCH/mogo-och-bus/build.gradle index 05bf3ff391..2e4e685dd9 100644 --- a/OCH/mogo-och-bus/build.gradle +++ b/OCH/mogo-och-bus/build.gradle @@ -39,15 +39,21 @@ dependencies { implementation rootProject.ext.dependencies.androidxappcompat implementation rootProject.ext.dependencies.arouter annotationProcessor rootProject.ext.dependencies.aroutercompiler + implementation rootProject.ext.dependencies.androidxconstraintlayout + + implementation rootProject.ext.dependencies.rxjava + implementation rootProject.ext.dependencies.rxandroid if (Boolean.valueOf(RELEASE)) { implementation rootProject.ext.dependencies.mogooch implementation rootProject.ext.dependencies.mogoutils implementation rootProject.ext.dependencies.mogocommons + implementation rootProject.ext.dependencies.modulecommon } else { implementation project(":OCH:mogo-och") implementation project(":foudations:mogo-utils") implementation project(":foudations:mogo-commons") + implementation project(":modules:mogo-module-common") } } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java new file mode 100644 index 0000000000..e8c49b8e8b --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java @@ -0,0 +1,93 @@ +package com.mogo.och.bus; + +import android.content.Context; + +import androidx.fragment.app.FragmentActivity; + +import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.module.common.MogoApisHandler; +import com.mogo.och.IMogoOCH; +import com.mogo.och.OCHConstants; +import com.mogo.och.bus.bean.OchBusStation; +import com.mogo.och.bus.fragment.OchBusFragment; +import com.mogo.service.connection.IMogoOnMessageListener; +import com.mogo.service.statusmanager.IMogoStatusChangedListener; +import com.mogo.service.statusmanager.StatusDescriptor; +import com.mogo.utils.logger.Logger; + +import java.util.List; + +/** + * 网约车小巴业务实现入口 + * + * @author tongchenfei + */ +@Route(path = OCHConstants.PATH) +public class OchBusProvider implements IMogoOCH { + private static final String TAG = "OchBusProvider"; + private OchBusFragment busFragment; + private int containerId; + private FragmentActivity activity; + + @Override + public void init(FragmentActivity activity, int containerId) { + this.containerId = containerId; + this.activity = activity; + } + + @Override + public void init(Context context) { + MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus", StatusDescriptor.VR_MODE, statusChangedListener); + MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus", StatusDescriptor.TOP_VIEW, statusChangedListener); + MogoApisHandler.getInstance().getApis().getSocketManagerApi(context).registerOnMessageListener(401017,messageListener); + } + + private void showFragment() { + if (busFragment == null) { + Logger.d(TAG,"准备add fragment======"); + busFragment = new OchBusFragment(); + activity.getSupportFragmentManager().beginTransaction().add(containerId, busFragment).commit(); + return; + } + Logger.d(TAG,"准备show fragment"); + activity.getSupportFragmentManager().beginTransaction().show(busFragment).commit(); + } + + private void hideFragment() { + if (busFragment != null) { + Logger.d(TAG,"准备hide fragment"); + activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commit(); + } + + } + + private final IMogoStatusChangedListener statusChangedListener = (descriptor, isTrue) -> { + if (descriptor == StatusDescriptor.VR_MODE) { + // 进入vr模式默认显示网约车小巴fragment + if (isTrue) { + showFragment(); + } else { + hideFragment(); + } + } else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() && descriptor == StatusDescriptor.TOP_VIEW) { + // topView进行展示时推出网约车界面,但是不隐藏整个fragment + if (busFragment != null && isTrue) { + busFragment.hideOchBus(); + } + } + }; + + private final IMogoOnMessageListener> messageListener = new IMogoOnMessageListener>() { + @Override + public Class> target() { + return null; + } + + @Override + public void onMsgReceived(List obj) { + // 刷新列表 + busFragment.getPresenter().getStationListFromSocket(obj); + } + }; + +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusLeaveStationRequest.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusLeaveStationRequest.java new file mode 100644 index 0000000000..d9e470ecf6 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusLeaveStationRequest.java @@ -0,0 +1,24 @@ +package com.mogo.och.bus.bean; + +/** + * 公交驶离车站,同步服务端请求参数封装 + * + * @author tongchenfei + */ +public class OchBusLeaveStationRequest { + private final String sn; + private final int siteId; + + public OchBusLeaveStationRequest(String sn, int siteId) { + this.sn = sn; + this.siteId = siteId; + } + + public String getSn() { + return sn; + } + + public int getSiteId() { + return siteId; + } +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesRequest.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesRequest.java new file mode 100644 index 0000000000..5de543ba60 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesRequest.java @@ -0,0 +1,42 @@ +package com.mogo.och.bus.bean; + +/** + * 网约车小巴路线请求参数封装 + * + * @author tongchenfei + */ +public class OchBusRoutesRequest { + double lat; + double lon; + String sn; + + public OchBusRoutesRequest(String sn, double lat, double lon) { + this.lat = lat; + this.lon = lon; + this.sn = sn; + } + + public double getLat() { + return lat; + } + + public void setLat(double lat) { + this.lat = lat; + } + + public double getLon() { + return lon; + } + + public void setLon(double lon) { + this.lon = lon; + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesResponse.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesResponse.java new file mode 100644 index 0000000000..86083944b6 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesResponse.java @@ -0,0 +1,27 @@ +package com.mogo.och.bus.bean; + +import com.mogo.commons.data.BaseData; + +/** + * 网约车小巴路线接口请求响应结果 + * + * @author tongchenfei + */ +public class OchBusRoutesResponse extends BaseData { + private OchBusRoutesResult result; + + public OchBusRoutesResult getResult() { + return result; + } + + public void setResult(OchBusRoutesResult result) { + this.result = result; + } + + @Override + public String toString() { + return "OchBusRoutesResponse{" + + "result=" + result + + '}'; + } +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesResult.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesResult.java new file mode 100644 index 0000000000..d9042bcc16 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusRoutesResult.java @@ -0,0 +1,27 @@ +package com.mogo.och.bus.bean; + +import java.util.List; + +/** + * 网约车小巴路线接口返回接口数据封装 + * + * @author tongchenfei + */ +public class OchBusRoutesResult { + private List site; + + public List getSite() { + return site; + } + + public void setSite(List site) { + this.site = site; + } + + @Override + public String toString() { + return "OchBusRoutesResult{" + + "site=" + site + + '}'; + } +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusStation.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusStation.java new file mode 100644 index 0000000000..93ad0ffc05 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/OchBusStation.java @@ -0,0 +1,146 @@ +package com.mogo.och.bus.bean; + +/** + * 单个网约车小巴车站信息 + * + * @author tongchenfei + */ +public class OchBusStation { + private int lineId; + private int siteId; + private String siteName; + private String cityCode; + private String areaCode; + private String areaName; + private double lat; + private double lon; + private String siteDesc; + private int siteState; + private int isCurrentSite; + private int siteColor; + private String peoples; + + + public int getLineId() { + return lineId; + } + + public void setLineId(int lineId) { + this.lineId = lineId; + } + + public int getSiteId() { + return siteId; + } + + public void setSiteId(int siteId) { + this.siteId = siteId; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getCityCode() { + return cityCode; + } + + public void setCityCode(String cityCode) { + this.cityCode = cityCode; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public double getLat() { + return lat; + } + + public void setLat(double lat) { + this.lat = lat; + } + + public double getLon() { + return lon; + } + + public void setLon(double lon) { + this.lon = lon; + } + + public String getSiteDesc() { + return siteDesc; + } + + public void setSiteDesc(String siteDesc) { + this.siteDesc = siteDesc; + } + + public int getSiteState() { + return siteState; + } + + public void setSiteState(int siteState) { + this.siteState = siteState; + } + + public int getIsCurrentSite() { + return isCurrentSite; + } + + public void setIsCurrentSite(int isCurrentSite) { + this.isCurrentSite = isCurrentSite; + } + + public int getSiteColor() { + return siteColor; + } + + public void setSiteColor(int siteColor) { + this.siteColor = siteColor; + } + + public String getPeoples() { + return peoples; + } + + public void setPeoples(String peoples) { + this.peoples = peoples; + } + + @Override + public String toString() { + return "OchBusStation{" + + "lineId=" + lineId + + ", siteId=" + siteId + + ", siteName='" + siteName + '\'' + + ", cityCode='" + cityCode + '\'' + + ", areaCode='" + areaCode + '\'' + + ", areaName='" + areaName + '\'' + + ", lat=" + lat + + ", lon=" + lon + + ", siteDesc='" + siteDesc + '\'' + + ", siteState=" + siteState + + ", isCurrentSite=" + isCurrentSite + + ", siteColor=" + siteColor + + ", peoples='" + peoples + '\'' + + '}'; + } +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java new file mode 100644 index 0000000000..7df72a776f --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java @@ -0,0 +1,129 @@ +package com.mogo.och.bus.fragment; + +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.Group; + +import com.mogo.commons.mvp.MvpFragment; +import com.mogo.module.common.MogoApisHandler; +import com.mogo.module.common.view.OnPreventFastClickListener; +import com.mogo.och.bus.R; +import com.mogo.och.bus.bean.OchBusStation; +import com.mogo.och.bus.presenter.OchBusPresenter; +import com.mogo.utils.logger.Logger; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 网约车小巴界面 + * + * @author tongchenfei + */ +public class OchBusFragment extends MvpFragment { + private static final String TAG = "OchBusFragment"; + private Group groupOchBus; + private final List stationList = new ArrayList<>(); + private Button btnExecute; + private TextView tvNotice; + + @Override + protected int getLayoutId() { + return R.layout.fragment_och_bus; + } + + @Override + protected void initViews() { + groupOchBus = findViewById(R.id.groupOchBus); + findViewById(R.id.btnEnterOchBus).setOnClickListener(new OnPreventFastClickListener() { + @Override + public void onClickImpl(View v) { + showOchBus(); + } + }); + btnExecute = findViewById(R.id.btnExecute); + btnExecute.setOnClickListener(new OnPreventFastClickListener() { + @Override + public void onClickImpl(View v) { + mPresenter.autoDriveToNextStation(); + } + }); + tvNotice = findViewById(R.id.vBusRoute); + } + + @NonNull + @Override + protected OchBusPresenter createPresenter() { + return new OchBusPresenter(this); + } + + public void showOchBus() { + MogoApisHandler.getInstance().getApis().getTopViewManager().removeAllViewInVrMode(); + groupOchBus.setVisibility(View.VISIBLE); + + } + + @Override + public void onResume() { + super.onResume(); + queryStationListIfNecessary(); + } + + @Override + public void onHiddenChanged(boolean hidden) { + super.onHiddenChanged(hidden); + Logger.d(TAG, "onHiddenChanged: " + hidden); + if (!hidden) { + // 判断是否需要请求接口 + queryStationListIfNecessary(); + } + } + + public void refreshBusStations(List busStationList) { + if (getActivity() == null) { + return; + } + getActivity().runOnUiThread(() -> { + if (busStationList == null) { + // todo 获取小巴数据失败 + } else { + // todo 渲染小巴路线数据 + stationList.clear(); + stationList.addAll(busStationList); + for (int i = 0; i < stationList.size(); i++) { + OchBusStation station = stationList.get(i); + if (station.getIsCurrentSite() == OchBusPresenter.STATION_STATUS_LEAVING) { + tvNotice.setText("正在从 " + i + "站驶向" + (i + 1) + "站"); + btnExecute.setVisibility(View.GONE); + break; + } else if (station.getIsCurrentSite() == OchBusPresenter.STATION_STATUS_STOPED) { + tvNotice.setText("车辆正停在" + i + "站"); + btnExecute.setVisibility(View.VISIBLE); + if (i == stationList.size() - 1) { + btnExecute.setText("单程结束"); + }else if(i == 0){ + btnExecute.setText("准备出发"); + }else{ + btnExecute.setText("乘客已上车,准备出发"); + } + break; + } + } + } + }); + } + + public void hideOchBus() { + groupOchBus.setVisibility(View.GONE); + } + + private void queryStationListIfNecessary() { + if (stationList == null || stationList.isEmpty()) { + mPresenter.queryBusRoutes(); + } + } +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/IOchBusApiService.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/IOchBusApiService.java new file mode 100644 index 0000000000..4924a6bde8 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/IOchBusApiService.java @@ -0,0 +1,41 @@ +package com.mogo.och.bus.net; + +import com.mogo.commons.data.BaseData; +import com.mogo.och.bus.bean.OchBusRoutesResponse; + +import io.reactivex.Observable; +import okhttp3.RequestBody; +import retrofit2.http.Body; +import retrofit2.http.Headers; +import retrofit2.http.POST; + +/** + * 小巴车相关接口 + * + * @author tongchenfei + */ +public interface IOchBusApiService { + + /** + * 根据车机坐标获取所在区域全部站点信息 + *

+ * wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072 + * + * @param requestBody 请求参数 + * @return 接口返回数据 + */ + @Headers({"Content-Type:application/json;charset=UTF-8"}) + @POST("/yycp-onlinecar-hailing/onlineCarHailing/site/querySiteByCoordinate/v1") + Observable querySiteByCoordinate(@Body RequestBody requestBody); + + + /** + * 公交车驶离车站时,通知服务端 + * @param requestBody 请求参数 {"sn":"","siteId":"车站id"} + * @return 无返回值 + */ + @Headers({"Content-Type:application/json;charset=UTF-8"}) + @POST("/yycp-onlinecar-hailing/onlineCarHailing/site/siteCrashCheck/v1") + Observable leaveStation(@Body RequestBody requestBody); + +} diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java new file mode 100644 index 0000000000..e39bf77784 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java @@ -0,0 +1,188 @@ +package com.mogo.och.bus.presenter; + +import com.mogo.commons.data.BaseData; +import com.mogo.commons.mvp.Presenter; +import com.mogo.commons.network.SubscribeImpl; +import com.mogo.commons.network.Utils; +import com.mogo.map.location.MogoLocation; +import com.mogo.module.common.MogoApisHandler; +import com.mogo.module.common.constants.HostConst; +import com.mogo.och.bus.bean.OchBusLeaveStationRequest; +import com.mogo.och.bus.bean.OchBusRoutesRequest; +import com.mogo.och.bus.bean.OchBusRoutesResponse; +import com.mogo.och.bus.bean.OchBusStation; +import com.mogo.och.bus.fragment.OchBusFragment; +import com.mogo.och.bus.net.IOchBusApiService; +import com.mogo.service.adas.IMogoAdasOCHCallback; +import com.mogo.service.adas.RemoteControlAutoPilotParameters; +import com.mogo.service.adas.entity.AdasOCHData; +import com.mogo.utils.logger.Logger; +import com.mogo.utils.network.RequestOptions; +import com.mogo.utils.network.utils.GsonUtil; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; +import okhttp3.MediaType; +import okhttp3.RequestBody; + +/** + * 网约车小巴 + * + * @author tongchenfei + */ +public class OchBusPresenter extends Presenter implements IMogoAdasOCHCallback { + private static final String TAG = "OchBusPresenter"; + private static final int VEHICAL_TYPE = 10; + + public static final int STATION_STATUS_IDLE = 0; + public static final int STATION_STATUS_STOPED = 1; + public static final int STATION_STATUS_LEAVING = 2; + public static final int STATION_STATUS_ARRIVING = 3; + + public OchBusPresenter(OchBusFragment view) { + super(view); + MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasOCHCallback(this); + } + + private final List stationList = new ArrayList<>(); + + private int currentStationIndex = 0; + + public void queryBusRoutes() { + double lat = 0; + double lon = 0; + MogoLocation lastLocation = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(getContext()).getLastKnowLocation(); + if (lastLocation != null) { + lat = lastLocation.getLatitude(); + lon = lastLocation.getLongitude(); + } + OchBusRoutesRequest request = new OchBusRoutesRequest(Utils.getSn(),lat, lon); + RequestBody requestBody = RequestBody.create(MediaType.get("application/json"), GsonUtil.jsonFromObject(request)); + MogoApisHandler.getInstance().getApis().getNetworkApi() + .create(IOchBusApiService.class, HostConst.OCH_DOMAIN) + .querySiteByCoordinate(requestBody) + .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) { + + @Override + public void onSuccess(OchBusRoutesResponse o) { + super.onSuccess(o); + Logger.d(TAG, "获取到小巴路线数据: " + o); + if (mView != null && o.getResult() != null && o.getResult().getSite() != null) { + stationList.clear(); + stationList.addAll(o.getResult().getSite()); + refreshCurrentStation(); + mView.refreshBusStations(stationList); + } + } + + @Override + public void onError(Throwable e) { + super.onError(e); + Logger.e(TAG, e, "获取小巴路线图失败"); + if (mView != null) { + mView.refreshBusStations(null); + } + } + + @Override + public void onError(String message, int code) { + super.onError(message, code); + Logger.e(TAG, "获取小巴路线失败 code: " + code + " msg: " + message); + if (mView != null) { + mView.refreshBusStations(null); + } + } + }); + } + + public void getStationListFromSocket(List stations) { + // 接收长连接消息好像没啥用 +// stationList.clear(); +// stationList.addAll(stations); +// refreshCurrentStation(); +// if (mView != null) { +// mView.refreshBusStationsInUiThread(stationList); +// } + } + + public void autoDriveToNextStation() { + if (currentStationIndex >= stationList.size() - 1) { + // 当前站是最后一站,结束当前行程 + travelOver(); + return; + } + OchBusStation currentStation = stationList.get(currentStationIndex); + OchBusStation nextStation = stationList.get(currentStationIndex + 1); + currentStation.setIsCurrentSite(STATION_STATUS_LEAVING); + nextStation.setIsCurrentSite(STATION_STATUS_ARRIVING); + RemoteControlAutoPilotParameters parameters = new RemoteControlAutoPilotParameters(); + parameters.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(currentStation.getLat(), currentStation.getLon()); + parameters.endLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(nextStation.getLat(), nextStation.getLon()); + parameters.vehicleType = VEHICAL_TYPE; + MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData(parameters); + + RequestBody request = RequestBody.create(MediaType.get("application/json"), GsonUtil.jsonFromObject(new OchBusLeaveStationRequest(Utils.getSn(), currentStation.getSiteId()))); + MogoApisHandler.getInstance().getApis().getNetworkApi() + .create(IOchBusApiService.class, HostConst.OCH_DOMAIN) + .leaveStation(request).subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) { + @Override + public void onError(String message, int code) { + super.onError(message, code); + Logger.d(TAG, "leave station error: " + message); + } + + @Override + public void onError(Throwable e) { + super.onError(e); + Logger.e(TAG,e,"leave station exception"); + } + }); + + + if (mView != null) { + mView.refreshBusStations(stationList); + } + } + + private void refreshCurrentStation() { + currentStationIndex = 0; + for (OchBusStation station : stationList) { + // 如果数据表发生更新,获取当前所在车站 + if (station.getIsCurrentSite() == STATION_STATUS_STOPED || station.getIsCurrentSite() == STATION_STATUS_LEAVING) { + // 处于停靠或驶离时,是当前车站 + break; + } + currentStationIndex++; + } + } + + @Override + public void onArriveAt(AdasOCHData data) { + // 当前站改为IDLE,下一站改为STATION_STATUS_STOPED,currentStationIndex增加1 + stationList.get(currentStationIndex++).setIsCurrentSite(STATION_STATUS_IDLE); + stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_STOPED); + if (mView != null) { + mView.refreshBusStations(stationList); + } + } + + private void travelOver(){ + if (currentStationIndex >= stationList.size()) { + Logger.e(TAG, "index out of station list"); + return; + } + // 始发站改为Stoped,其他站改为Idle + stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_IDLE); + currentStationIndex = 0; + stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_STOPED); + if (mView != null) { + mView.refreshBusStations(stationList); + } + } +} diff --git a/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml b/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml new file mode 100644 index 0000000000..7bc5f71ee0 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml @@ -0,0 +1,42 @@ + + + +