Merge branch 'dev_robotaxi-d_231205_6.2.6' into dev_robotaxi-d_231218_6.2.6

# Conflicts:
#	OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java
This commit is contained in:
yangyakun
2023-12-18 11:28:25 +08:00
1189 changed files with 7194 additions and 1825 deletions

View File

@@ -58,8 +58,8 @@ dependencies {
implementation rootProject.ext.dependencies.androidxrecyclerview
compileOnly rootProject.ext.dependencies.recyclerviewadapterhelper
implementation project(":OCH:mogo-och-common-module")
implementation project(":OCH:mogo-och-data")
implementation project(":OCH:common:common")
implementation project(":OCH:common:data")
compileOnly project(":libraries:mogo-map")
}

View File

@@ -44,6 +44,21 @@ android {
}
}
sourceSets {
main {
res.srcDirs = [
'src/main/res',
'src/main/res/m2',
'src/main/res/jinlv',
]
java.srcDirs = [
'src/main/java',
'src/main/java/m2',
'src/main/java/jinlv',
]
}
}
flavorDimensions "vehicle"
productFlavors {
// 车型:金旅星辰、开沃 小巴业务
@@ -71,7 +86,7 @@ dependencies {
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.amapnavi3dmap
implementation project(":OCH:mogo-och-common-module")
implementation project(":OCH:common:common")
compileOnly project(":libraries:mogo-map")
implementation project(':core:mogo-core-res')

View File

@@ -1,107 +0,0 @@
package com.mogo.och.bus.passenger;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import android.content.Context;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
import com.mogo.och.common.module.wigets.video.VideoPlayerActivity;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* 网约车-Bus-乘客端
*
* Created on 2022/3/29
*/
@Route(path = BusPassengerConst.PATH)
public class MogoOCHBusPassenger implements IMogoOCH {
private static final String TAG = MogoOCHBusPassenger.class.getSimpleName();
private FragmentActivity mActivity;
private int mContainerId;
private BusPassengerRouteFragment mPassengerFragment;
@Override
public void createCoverage(FragmentActivity activity, int containerId) {
}
@Nullable
@Override
public Fragment createCoverage(@Nullable FragmentActivity activity, @Nullable Integer containerId) {
this.mActivity = activity;
this.mContainerId = containerId;
showFragment();
if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
MultiDisplayUtils.INSTANCE.startActWithSecond(activity, VideoPlayerActivity.class);
}
return null;
}
@NotNull
@Override
public String getFunctionName() {
return null;
}
@Override
public void onDestroy() {
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
if (mActivity == null) return;
mActivity.finish();
}
@Override
public void init(Context context) {
}
/**
* 进入鹰眼模式,设置手势缩放地图失效
*/
private void stepIntoVrMode() {
CallerLogger.d( M_TAXI_P + TAG, "进入vr模式" );
CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑
}
private void showFragment() {
FragmentManager supportFragmentManager = mActivity.getSupportFragmentManager();
if(mPassengerFragment == null){
CallerLogger.d(M_TAXI_P + TAG, "准备add fragment======");
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusPassengerRouteFragment.TAG);
if (fragmentByTag instanceof BusPassengerRouteFragment){
mPassengerFragment = (BusPassengerRouteFragment)fragmentByTag;
}else {
mPassengerFragment = new BusPassengerRouteFragment();
}
if (!mPassengerFragment.isAdded()){
supportFragmentManager.beginTransaction().add(mContainerId, mPassengerFragment
,BusPassengerRouteFragment.TAG).commitAllowingStateLoss();
}
return;
}
CallerLogger.d(M_TAXI_P + TAG, "准备show fragment");
supportFragmentManager.beginTransaction().show(mPassengerFragment).commitAllowingStateLoss();
}
private void hideFragment(){
if (mPassengerFragment != null){
mActivity.getSupportFragmentManager().beginTransaction().hide(mPassengerFragment).commitAllowingStateLoss();
}
}
}

View File

@@ -1,16 +0,0 @@
package com.mogo.och.bus.passenger.ui.widget
import android.content.Context
import android.util.AttributeSet
import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
/**
* @author: wangmingjun
* @date: 2023/2/13
*/
class BusPTurnLightView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : TurnLightViewStatus(context, attrs) {
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/bus_p_end_station_circle_borner_color" />
<corners android:radius="@dimen/bus_p_station_circle_radius_size" />
</shape>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/bus_p_start_station_circle_borner_color" />
<corners android:radius="@dimen/bus_p_station_circle_radius_size" />
</shape>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/bus_p_traffic_light_bg_color"/>
<corners android:radius="@dimen/bus_p_route_traffic_light_view_corner"/>
<stroke android:color="@color/bus_p_traffic_light_bg_stroke"
android:width="@dimen/bus_p_traffic_light_bg_stroke_width"/>
</shape>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:visible="true"
android:oneshot="false">
<item android:drawable="@drawable/speak_arrived_icon_0" android:duration="300"/>
<item android:drawable="@drawable/speak_arrived_icon_1" android:duration="300"/>
<item android:drawable="@drawable/speak_arrived_icon_2" android:duration="300"/>
</animation-list>

View File

@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="bus_p_speed_txt_color">#5D7199</color>
<color name="bus_p_traffic_light_bg_color">#CCE9EFFC</color>
<color name="bus_p_traffic_light_bg_stroke">#C7D2E1</color>
<color name="bus_p_driver_number_plate_color">#2D3E5F</color>
<color name="bus_p_line_name_color">#203555</color>
<color name="bus_p_line_operation_time_color">#2D3E5F</color>
<color name="bus_p_no_data_color">#596A8A</color>
<color name="bus_p_station_circle_color">#D8E5F8</color>
<color name="bus_p_start_station_circle_borner_color">#FFB327</color>
<color name="bus_p_station_txt_color">#2D3E5F</color>
<color name="bus_p_current_station_txt_color">#0043FF</color>
<color name="bus_p_middle_station_circle_color2">#276AFE</color>
<color name="bus_p_middle_station_circle_color1">#0043FF</color>
<color name="bus_p_end_station_circle_borner_color">#276AFE</color>
<color name="bus_p_start_tag_bg_color1">#FFC125</color>
<color name="bus_p_start_tag_bg_color2">#FF8131</color>
<color name="bus_p_end_tag_bg_color1">#31BFF2</color>
<color name="bus_p_end_tag_bg_color2">#3257E9</color>
<color name="bus_p_end_tag_txt_color">#FFFFFF</color>
<color name="bus_p_tag_line_color">#CDDBF6</color>
<color name="bus_p_panel_cur_txt_color">#2D3E5F</color>
<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>
<color name="bus_p_traffic_txt_color">#2D3E5F</color>
<color name="bus_p_panel_edge_shadow">#33394C63</color>
<color name="bus_p_speed_color_start">#43CEFE</color>
<color name="bus_p_speed_color_end">#1466FB</color>
<color name="bus_p_clock_17417B">#17417B</color>
<color name="bus_p_clock_6617417B">#6617417B</color>
<color name="bus_p_clock_A9B6CA">#A9B6CA</color>
<color name="bus_p_clock_1F82FB">#1F82FB</color>
<color name="bus_p_clock_992D3E5F">#992D3E5F</color>
</resources>

View File

@@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="bus_p_route_info_panel_width">750dp</dimen>
<dimen name="bus_p_route_bg_width">804dp</dimen>
<dimen name="bus_p_auto_icon_margin_top">40dp</dimen>
<dimen name="bus_p_route_info_margin_right">40dp</dimen>
<dimen name="bus_p_route_info_margin_left">48dp</dimen>
<dimen name="bus_p_route_info_margin_bottom">40dp</dimen>
<dimen name="bus_p_route_info_margin_top">110dp</dimen>
<dimen name="bus_p_route_line_info_height">224dp</dimen>
<dimen name="bus_p_route_line_map_view_height">422dp</dimen>
<dimen name="bus_p_route_line_dividing_view_height">3dp</dimen>
<dimen name="bus_p_route_traffic_light_view_width">158dp</dimen>
<dimen name="bus_p_route_traffic_light_view_height">90dp</dimen>
<dimen name="bus_p_route_traffic_light_view_corner">45dp</dimen>
<dimen name="bus_p_traffic_light_bg_width">158dp</dimen>
<dimen name="bus_p_traffic_light_bg_height">90dp</dimen>
<dimen name="bus_p_traffic_light_time_size">45dp</dimen>
<dimen name="bus_p_traffic_light_time_view_width">90dp</dimen>
<dimen name="bus_p_traffic_light_icon_size">90dp</dimen>
<dimen name="bus_p_traffic_light_bg_stroke_width">3dp</dimen>
<dimen name="bus_p_route_dividing_line2_margin_top">224dp</dimen>
<dimen name="bus_p_driver_number_plate_margin_top">50dp</dimen>
<dimen name="bus_p_driver_number_plate_margin_bottom">50dp</dimen>
<dimen name="bus_p_driver_number_plate_size">34dp</dimen>
<dimen name="bus_p_line_operation_time_margin_top">130dp</dimen>
<dimen name="bus_p_line_operation_time_size">38dp</dimen>
<dimen name="bus_p_no_data_size">38dp</dimen>
<dimen name="bus_p_speed_txt_size">90dp</dimen>
<dimen name="bus_p_speed_unit_txt_size">27dp</dimen>
<dimen name="bus_p_station_circle_borner_size">4dp</dimen>
<dimen name="bus_p_station_circle_radius_size">10dp</dimen>
<dimen name="bus_p_station_circle_width_height">20dp</dimen>
<dimen name="bus_p_station_tag_width_height">60dp</dimen>
<dimen name="bus_p_station_tag_radius_size">30dp</dimen>
<dimen name="bus_p_cur_station_circle_width">20dp</dimen>
<dimen name="bus_p_cur_station_circle_height">50dp</dimen>
<dimen name="bus_p_mid_station_circle_cor">6dp</dimen>
<dimen name="bus_p_station_txt_size">38dp</dimen>
<dimen name="bus_p_station_tag_txt_size">36dp</dimen>
<dimen name="bus_p_station_item_height">80dp</dimen>
<dimen name="bus_p_station_item_middle_height">100dp</dimen>
<dimen name="bus_p_station_tag_line_height">80dp</dimen>
<dimen name="bus_p_station_tag_line_height1">60dp</dimen>
<dimen name="bus_p_station_tag_line_width">6dp</dimen>
<dimen name="bus_p_curent_station_panel_width">685dp</dimen>
<dimen name="bus_p_curent_station_panel_height">309dp</dimen>
<dimen name="bus_p_curent_station_panel_margin">50dp</dimen>
<dimen name="bus_p_curent_station_panel_margin_left">10dp</dimen>
<dimen name="bus_p_curent_station_txt_size">44dp</dimen>
<dimen name="bus_p_curent_station_txt_size1">55dp</dimen>
<dimen name="bus_p_curent_station_tip_size1">40dp</dimen>
<dimen name="bus_p_live_station_panel_width">495dp</dimen>
<dimen name="bus_p_live_station_panel_height">309dp</dimen>
<dimen name="bus_p_curent_station_txt_width">584dp</dimen>
<dimen name="bus_p_station_txt_width">550dp</dimen>
</resources>

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="bus_p_speed_unit_txt">KM/H</string>
<string name="bus_p_no_out">您已收车</string>
<string name="bus_p_no_task">暂无班次</string>
<string name="bus_p_no_line">暂无线路</string>
<string name="bus_p_start_station_txt_tag"></string>
<string name="bus_p_end_station_txt_tag"></string>
<string name="bus_p_cur_station_title">已到站:</string>
<string name="bus_p_cur_next_station_title">前方到站:</string>
<!-- <string name="bus_p_cur_station_title_init">始发站:</string>-->
<string name="bus_p_cur_station_arrived_tip">请按秩序下车</string>
<!-- <string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐蘑菇车联自动驾驶车。</string>-->
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mogo.och.bus.passenger">
package="com.mogo.och.shuttle.passenger">
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application>

File diff suppressed because one or more lines are too long

View File

@@ -1,16 +0,0 @@
package com.mogo.och.bus.passenger.ui.widget
import android.content.Context
import android.util.AttributeSet
import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
/**
* @author: wangmingjun
* @date: 2023/2/13
*/
class M2TurnLightView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : TurnLightViewStatus(context, attrs) {
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:visible="true"
android:oneshot="false">
<item android:drawable="@drawable/m2_arrived_an_0" android:duration="300"/>
<item android:drawable="@drawable/m2_arrived_an_1" android:duration="300"/>
<item android:drawable="@drawable/m2_arrived_an_2" android:duration="300"/>
</animation-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="m2_p_white_color">#FFFFFF</color>
<color name="m2_p_speed_tv_color">#0B1E38</color>
<color name="m2_button_auto_tv_color">#2D3E5F</color>
<!-- <color name="m2_button_un_auto_bg_color">#B3C0D4ED</color>-->
<color name="m2_button_un_auto_bg_color">#BBDAFB</color>
<color name="m2_line_name_tv_color">#0B1E38</color>
<color name="m2_line_during_tv_color">#5D7199</color>
<color name="m2_current_time_tv_color">#0B1E38</color>
<color name="m2_no_line_tv_color">#6B7EA6</color>
<color name="m2_light_tv_color">#2D3E5F</color>
<color name="m2_pnc_bg_color">#A5D8FF</color>
<color name="m2_power_tv_color">#1B2546</color>
<color name="m2_next_tv_color">#23355D</color>
<color name="m2_text_time_tv_color">#374E7F</color>
<color name="bus_traffic_light_red_color_up">#FFFFA28B</color>
<color name="bus_traffic_light_red_color_down">#FFDA1100</color>
<color name="bus_traffic_light_green_color_up">#FF60FFD3</color>
<color name="bus_traffic_light_green_color_down">#FF006D43</color>
<color name="bus_traffic_light_yellow_color_up">#FFFFE198</color>
<color name="bus_traffic_light_yellow_color_down">#FFFF9B00</color>
<color name="bus_arrived_btn_un_clickable_color">#59FFFFFF</color>
<color name="bus_dashed_line_color">#8895B7</color>
<color name="shuttle_color_c8efff">#C8EFFF</color>
<color name="shuttle_color_203555">#203555</color>
<color name="shuttle_color_99afc9e7">#99AFC9E7</color>
<color name="shuttle_color_6617417B">#6617417B</color>
<color name="shuttle_color_17417B">#17417B</color>
<color name="shuttle_color_2d3e5f">#2D3E5F</color>
<color name="shuttle_color_34A61F">#34A61F</color>
<color name="shuttle_color_aeedb8">#AEEDB8</color>
<color name="shuttle_color_43cefe">#43CEFE</color>
<color name="shuttle_color_1466fb">#1466FB</color>
<color name="shuttle_color_7094ad">#7094AD</color>
</resources>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="m2_p_light_width">60dp</dimen>
<dimen name="m2_p_light_height">40dp</dimen>
</resources>

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="m2_p_speed_unit_txt">KM/H</string>
<string name="bus_p_no_out">您已收车</string>
<string name="m2_p_no_line">暂无路线</string>
<string name="bus_p_start_station_txt_tag"></string>
<string name="bus_p_end_station_txt_tag"></string>
<string name="bus_p_cur_station_title">到达站:</string>
<string name="bus_p_cur_next_station_title">下一站:</string>
<string name="bus_p_cur_station_title_init">始发站:</string>
<string name="bus_p_cur_station_arrived_tip">请携带好随身物品下车。</string>
<string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐蘑菇车联自动驾驶车。</string>
<string name="m2_over_map_style_path">m2_map_style.data</string>
<string name="m2_over_map_style_extra_path">m2_map_style_extra.data</string>
<string name="m2_p_auto_tv">AUTO</string>
<string name="m2_p_station_title_tv">下一站:</string>
<string name="m2_p_station_title_arrived_tv">已到站</string>
<string name="m2_p_empty_tv">暂无站点</string>
<string name="m2_p_empty_remain_km_minute">—公里 | —分钟</string>
<string name="shuttle_p_next_station_title">前方到站</string>
<string name="m2_p_empty_remain_km">—公里</string>
<string name="m2_p_empty_remain_minute">—分钟</string>
<string name="m2_p_arrived_station_title">请按秩序下车</string>
<string name="m2_p_not_select_line_content">暂无路线</string>
</resources>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mogo.och.bus.passenger">
package="com.mogo.och.shuttle.passenger">
</manifest>

View File

@@ -1,22 +0,0 @@
package com.mogo.och.bus.passenger;
import androidx.annotation.IdRes;
import androidx.fragment.app.FragmentActivity;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
/**
* 网约车抽象接口
*
* Created on 2022/3/29
*/
interface IMogoOCH extends IMoGoFunctionProvider {
/**
* 初始化网约车容器
*
* @param activity
* @param containerId 容器ID
*/
void createCoverage(FragmentActivity activity, @IdRes int containerId);
}

View File

@@ -1,13 +0,0 @@
package com.mogo.och.bus.passenger.utils
import android.content.res.Resources
/**
* @author: wangmingjun
* @date: 2022/1/21
*/
object DimenUtil{
fun dp2px(value:Float):Float{
return (0.5f + value * Resources.getSystem().displayMetrics.density)
}
}

View File

@@ -1,19 +1,21 @@
package com.mogo.och.bus.passenger
package com.mogo.och.shuttle.passenger
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.commons.module.status.IMogoStatusChangedListener
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.commons.module.status.StatusDescriptor
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.stepInDayMode
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.bus.passenger.constant.BusPassengerConst
import com.mogo.och.bus.passenger.ui.PM2BaseFragment
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
import com.mogo.och.common.module.wigets.video.VideoPlayerActivity
import com.mogo.och.shuttle.passenger.ui.BusPassengerRouteFragment
import com.mogo.och.shuttle.passenger.ui.PM2BaseFragment
/**
* 网约车-Bus-乘客端
@@ -21,20 +23,20 @@ import com.mogo.och.bus.passenger.ui.PM2BaseFragment
* Created on 2022/3/29
*/
@Route(path = BusPassengerConst.PATH)
class MogoOCHBusPassenger : IMogoOCH, IMogoStatusChangedListener {
class MogoOCHShuttlePassenger : IMoGoFunctionProvider {
private var mActivity: FragmentActivity? = null
private var mContainerId = 0
private var mPM2Fragment: PM2BaseFragment? = null
override fun createCoverage(activity: FragmentActivity, containerId: Int) {}
private var mPM2Fragment: Fragment? = null
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
mActivity = activity
mContainerId = containerId!!
// if (MogoStatusManager.getInstance().isScreenCoverDismiss){
showFragment()
// }else{
// MogoStatusManager.getInstance()
// .registerStatusChangedListener("ochM2Passenger", StatusDescriptor.SCREEN_COVER, this)
// }
showFragment()
if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
mActivity?.let {
MultiDisplayUtils.startActWithSecond(it, VideoPlayerActivity::class.java)
}
}
return null
}
@@ -63,12 +65,19 @@ class MogoOCHBusPassenger : IMogoOCH, IMogoStatusChangedListener {
d(SceneConstant.M_TAXI_P + TAG, "准备add fragment======")
var fragmentByTag: Fragment? = supportFragmentManager?.findFragmentByTag(PM2BaseFragment.TAG)
val fragmentByTag: Fragment? = supportFragmentManager?.findFragmentByTag(PM2BaseFragment.TAG)
mPM2Fragment = if (fragmentByTag is PM2BaseFragment){
mPM2Fragment = if (fragmentByTag is Fragment){
fragmentByTag
}else{
PM2BaseFragment()
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
PM2BaseFragment()
}else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
BusPassengerRouteFragment()
}else{
BusPassengerRouteFragment()
}
}
if (!mPM2Fragment?.isAdded!!){
@@ -90,16 +99,7 @@ class MogoOCHBusPassenger : IMogoOCH, IMogoStatusChangedListener {
}
companion object {
private val TAG = MogoOCHBusPassenger::class.java.simpleName
private val TAG = MogoOCHShuttlePassenger::class.java.simpleName
}
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
if (descriptor == StatusDescriptor.SCREEN_COVER){
if (isTrue){
showFragment()
}else{
hideFragment()
}
}
}
}

View File

@@ -1,6 +1,4 @@
package com.mogo.och.bus.passenger.constant
import com.mogo.commons.debug.DebugConfig
package com.mogo.och.shuttle.passenger.constant
/**
* Created on 2021/12/6

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.utils;
package com.mogo.och.shuttle.passenger.utils;
import android.content.Context;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.adapter;
package com.mogo.och.shuttle.passenger.adapter;
import android.content.Context;
import android.text.TextUtils;
@@ -11,16 +11,16 @@ import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.shuttle.passenger.R;
import com.mogo.och.common.module.utils.BlinkAnimationUtil;
import com.mogo.och.common.module.wigets.MarqueeTextView;
import com.mogo.och.data.bean.BusStationBean;
import java.util.List;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_ARRIVING;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_LEAVING;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
import static com.mogo.och.shuttle.passenger.constant.BusPassengerConst.STATION_STATUS_ARRIVING;
import static com.mogo.och.shuttle.passenger.constant.BusPassengerConst.STATION_STATUS_LEAVING;
import static com.mogo.och.shuttle.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
/**
* @author: wangmingjun
@@ -39,7 +39,7 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.bus_p_stations_common_item,parent,false);
View view = LayoutInflater.from(mContext).inflate(R.layout.shuttle_p_jl_stations_common_item,parent,false);
StationViewHolder viewHolder = new StationViewHolder(view);
return viewHolder;
}
@@ -54,16 +54,16 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
viewHolder.curArrowBg.setVisibility(View.GONE);
viewHolder.curArrowBottomBg.setVisibility(View.VISIBLE);
Log.d("onBindViewHolder" , "position0 = "+position);
viewHolder.stationCircle.setImageResource(R.drawable.bg_bus_p_start_tag_bg);
viewHolder.stationCircle.setImageResource(R.drawable.shuttle_p_jl_bg_start_tag_bg);
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//到达未离开
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_17417B));
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.shuttle_p_jl_clock_17417B));
BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.MARQUEE);
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_1F82FB));
}else {
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_992D3E5F));
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.shuttle_p_jl_clock_992D3E5F));
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_A9B6CA));
}
}else{
viewHolder.curArrowBg.setVisibility(View.VISIBLE);
@@ -71,29 +71,29 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
BusStationBean preStation = mStations.get(position -1);
if (station.getDrivingStatus() == STATION_STATUS_LEAVING ||
(station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving())){ //过站
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_992D3E5F));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.shuttle_p_jl_clock_992D3E5F));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_A9B6CA));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_A9B6CA));
viewHolder.stationCircle.setImageResource(R.drawable.shuttle_p_jl_point_gray);
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
Log.d("onBindViewHolder" , "position 1 = "+position);
} else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//刚到站未离开的
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_17417B));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_arrive_line_green);
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.shuttle_p_jl_clock_17417B));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_A9B6CA));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_1F82FB));
viewHolder.stationCircle.setImageResource(R.drawable.shuttle_p_jl_arrive_line_green);
if (position == mStations.size() - 1){
viewHolder.stationCircle.setImageResource(R.drawable.bg_bus_p_end_tag_bg);
viewHolder.stationCircle.setImageResource(R.drawable.shuttle_p_jl_bg_end_tag_bg);
viewHolder.curArrowBottomBg.setVisibility(View.GONE);
}
Log.d("onBindViewHolder" , "position2 = "+position);
BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.MARQUEE);
}else if (station.getDrivingStatus() == STATION_STATUS_ARRIVING && preStation.isLeaving()){//即将到站
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_panel_cur_station_tips_color));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_arrive_line_blue);
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.shuttle_p_jl_panel_cur_station_tips_color));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_A9B6CA));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_1F82FB));
viewHolder.stationCircle.setImageResource(R.drawable.shuttle_p_jl_arrive_line_blue);
Log.d("onBindViewHolder" , "position3 = "+position);
if (position == mStations.size() - 1){
@@ -103,14 +103,14 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
}else if (station.getDrivingStatus() == STATION_STATUS_ARRIVING &&
(preStation.getDrivingStatus() == STATION_STATUS_ARRIVING
|| preStation.getDrivingStatus() == STATION_STATUS_STOPPED)){ //未到站的并且前面也是未到站或者刚到站的
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_panel_cur_station_tips_color));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_blue);
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.shuttle_p_jl_panel_cur_station_tips_color));
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_1F82FB));
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.shuttle_p_jl_clock_1F82FB));
viewHolder.stationCircle.setImageResource(R.drawable.shuttle_p_jl_point_blue);
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
if (position == mStations.size() - 1){
viewHolder.stationCircle.setImageResource(R.drawable.bg_bus_p_end_tag_bg);
viewHolder.stationCircle.setImageResource(R.drawable.shuttle_p_jl_bg_end_tag_bg);
viewHolder.curArrowBottomBg.setVisibility(View.GONE);
}
Log.d("onBindViewHolder" , "position4 = "+position);

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import com.mogo.eagle.core.data.BaseData;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.och.data.bean.BusRoutesResult;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import java.util.List;
import java.util.Objects;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import java.util.Objects;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.callback;
package com.mogo.och.shuttle.passenger.callback;
import com.mogo.eagle.core.data.map.MogoLocation;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.callback;
package com.mogo.och.shuttle.passenger.callback;
import com.mogo.och.data.bean.BusStationBean;

View File

@@ -1,8 +1,8 @@
package com.mogo.och.bus.passenger.model;
package com.mogo.och.shuttle.passenger.model;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.QUERY_BUS_P_STATION_DELAY;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
import static com.mogo.och.shuttle.passenger.constant.BusPassengerConst.QUERY_BUS_P_STATION_DELAY;
import static com.mogo.och.shuttle.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
import android.content.Context;
import android.content.Intent;
@@ -21,16 +21,15 @@ import com.mogo.commons.module.intent.IntentManager;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse;
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse;
import com.mogo.och.shuttle.passenger.R;
import com.mogo.och.shuttle.passenger.bean.BusPassengerOperationStatusResponse;
import com.mogo.och.shuttle.passenger.bean.BusPassengerRoutesResponse;
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg;
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg;
import com.mogo.och.common.module.bean.dpmsg.DPMsgType;
@@ -54,14 +53,14 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.och.bus.passenger.callback.IBusPassegerDriverStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerADASStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerAutopilotPlanningCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerRouteLineInfoCallback;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager;
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
import com.mogo.och.shuttle.passenger.callback.IBusPassegerDriverStatusCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerADASStatusCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerAutopilotPlanningCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerControllerStatusCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerRouteLineInfoCallback;
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst;
import com.mogo.och.shuttle.passenger.network.BusPassengerModelLoopManager;
import com.mogo.och.shuttle.passenger.network.BusPassengerServiceManager;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;

View File

@@ -1,7 +1,7 @@
package com.mogo.och.bus.passenger.network;
package com.mogo.och.shuttle.passenger.network;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.och.bus.passenger.model.BusPassengerModel;
import com.mogo.och.shuttle.passenger.model.BusPassengerModel;
import java.util.concurrent.TimeUnit;
@@ -12,8 +12,8 @@ import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.LOOP_DELAY;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.LOOP_LINE_2S;
import static com.mogo.och.shuttle.passenger.constant.BusPassengerConst.LOOP_DELAY;
import static com.mogo.och.shuttle.passenger.constant.BusPassengerConst.LOOP_LINE_2S;
/**
* Created on 2021/11/22

View File

@@ -1,13 +1,12 @@
package com.mogo.och.bus.passenger.network
package com.mogo.och.shuttle.passenger.network
import android.content.Context
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getServerToken
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse
import com.mogo.och.shuttle.passenger.bean.BusPassengerRoutesResponse
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.och.bus.passenger.bean.BusPassengerQueryLineRequest
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse
import com.mogo.och.shuttle.passenger.bean.BusPassengerQueryLineRequest
import com.mogo.och.shuttle.passenger.bean.BusPassengerOperationStatusResponse
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
@@ -21,7 +20,8 @@ object BusPassengerServiceManager {
private var driverSnCache = ""
private var mShuttleBusPassengerServiceApi =
MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(ShettlePassengerServiceApi::class.java)
MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(
ShettlePassengerServiceApi::class.java)
/**
* 获取Bus司机端的sn

View File

@@ -1,8 +1,8 @@
package com.mogo.och.bus.passenger.network;
package com.mogo.och.shuttle.passenger.network;
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse;
import com.mogo.och.bus.passenger.bean.BusPassengerQueryLineRequest;
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse;
import com.mogo.och.shuttle.passenger.bean.BusPassengerOperationStatusResponse;
import com.mogo.och.shuttle.passenger.bean.BusPassengerQueryLineRequest;
import com.mogo.och.shuttle.passenger.bean.BusPassengerRoutesResponse;
import io.reactivex.Observable;
import retrofit2.http.Body;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.presenter;
package com.mogo.och.shuttle.passenger.presenter;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
@@ -13,13 +13,13 @@ import com.mogo.eagle.core.data.map.MogoLocation;
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.callback.IBusPassegerDriverStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerADASStatusCallback;
import com.mogo.och.bus.passenger.callback.IBusPassengerAutopilotPlanningCallback;
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.BusPassengerRouteFragment;
import com.mogo.och.shuttle.passenger.callback.IBusPassegerDriverStatusCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerADASStatusCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerAutopilotPlanningCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerControllerStatusCallback;
import com.mogo.och.shuttle.passenger.callback.IBusPassengerRouteLineInfoCallback;
import com.mogo.och.shuttle.passenger.model.BusPassengerModel;
import com.mogo.och.shuttle.passenger.ui.BusPassengerRouteFragment;
import com.mogo.och.data.bean.BusStationBean;
import java.util.List;

View File

@@ -1,9 +1,9 @@
package com.mogo.och.bus.passenger.provider;
package com.mogo.och.shuttle.passenger.provider;
import android.content.Context;
import android.view.View;
import com.mogo.och.bus.passenger.ui.BusPStatusBarView;
import com.mogo.och.shuttle.passenger.ui.BusPStatusBarView;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui
package com.mogo.och.shuttle.passenger.ui
import android.content.Context
import android.util.AttributeSet
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.jinlvvan.p_bus_view_blue_tooth.view.*
import com.mogo.och.shuttle.passenger.R
import kotlinx.android.synthetic.main.shuttle_p_jl_view_blue_tooth.view.blueView
/**
* 魔戒蓝牙控件
@@ -20,15 +20,15 @@ class BusPBlueToothView @JvmOverloads constructor(
) : BlueToothView(context, attrs, defStyleAttr),IMoGoDevaToolsListener {
init {
LayoutInflater.from(context).inflate(R.layout.p_bus_view_blue_tooth, this, true)
LayoutInflater.from(context).inflate(R.layout.shuttle_p_jl_view_blue_tooth, this, true)
}
override fun mofangStatus(status: Boolean) {
ThreadUtils.runOnUiThread {
if (status) {
blueView.setImageResource(R.drawable.bus_p_blue_tooth_close)
blueView.setImageResource(R.drawable.shuttle_p_jl_blue_tooth_close)
} else {
blueView.setImageResource(R.drawable.bus_p_blue_tooth_open)
blueView.setImageResource(R.drawable.shuttle_p_jl_blue_tooth_open)
}
}
}

View File

@@ -1,23 +1,18 @@
package com.mogo.och.bus.passenger.ui
package com.mogo.och.shuttle.passenger.ui
import android.annotation.*
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import chassis.ChassisStatesOuterClass
import com.mogo.eagle.core.function.api.autopilot.IMoGoBatteryManagementSystemListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.shuttle.passenger.R
import kotlinx.coroutines.*
import me.jessyan.autosize.utils.AutoSizeUtils
@@ -34,8 +29,8 @@ class BusPStatusBarView @JvmOverloads constructor(
}
init {
LayoutInflater.from(context).inflate(R.layout.p_bus_view_status_bar, this, true)
setBackgroundResource(R.drawable.bg_status_bar)
LayoutInflater.from(context).inflate(R.layout.shuttle_p_jl_view_status_bar, this, true)
setBackgroundResource(R.drawable.shuttle_p_jl_bg_status_bar)
isClickable = true
isFocusable = true
}

View File

@@ -1,35 +1,18 @@
package com.mogo.och.bus.passenger.ui;
package com.mogo.och.shuttle.passenger.ui;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.widget.ContentLoadingProgressBar;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.multidisplay.TelematicConstant;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
import com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView;
import com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView;
import com.mogo.eagle.core.function.view.MapBizView;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.wigets.OCHBorderShadowLayout;
import com.mogo.eagle.core.utilcode.util.DeviceUtils;
import com.mogo.och.shuttle.passenger.R;
/**
* Created on 2022/3/31
@@ -45,7 +28,7 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
@Override
protected int getLayoutId() {
return R.layout.bus_p_base_fragment;
return R.layout.shuttle_p_jl_base_fragment;
}
@Override

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui;
package com.mogo.och.shuttle.passenger.ui;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
@@ -18,12 +18,12 @@ import com.elegant.utils.UiThreadHandler;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.adapter.BusPassengerLineStationsAdapter;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
import com.mogo.och.bus.passenger.ui.layoutmanager.CenterLayoutManager;
import com.mogo.och.bus.passenger.ui.mapdirectionview.BusPassengerMapDirectionView;
import com.mogo.och.shuttle.passenger.R;
import com.mogo.och.shuttle.passenger.adapter.BusPassengerLineStationsAdapter;
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst;
import com.mogo.och.shuttle.passenger.presenter.BaseBusPassengerPresenter;
import com.mogo.och.shuttle.passenger.ui.layoutmanager.CenterLayoutManager;
import com.mogo.och.shuttle.passenger.ui.mapdirectionview.BusPassengerMapDirectionView;
import com.mogo.och.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.wigets.MarqueeTextView;
import com.mogo.och.common.module.wigets.OCHGradientTextView;
@@ -66,7 +66,7 @@ public class BusPassengerRouteFragment extends
@Override
public int getStationPanelViewId() {
return R.layout.bus_p_route_fragment;
return R.layout.shuttle_p_jl_route_fragment;
}
@NonNull
@@ -81,8 +81,8 @@ public class BusPassengerRouteFragment extends
mSpeedTv = findViewById(R.id.bus_p_speed_tv);
mSpeedTv.setVertrial(true);
mSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.bus_p_speed_color_start),
getResources().getColor(R.color.bus_p_speed_color_end)});
mSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.shuttle_p_jl_speed_color_start),
getResources().getColor(R.color.shuttle_p_jl_speed_color_end)});
mNoLineInfoView =findViewById(R.id.bus_p_no_order_data_view);
emptyTv = findViewById(R.id.no_order_data_tv);
@@ -165,10 +165,10 @@ public class BusPassengerRouteFragment extends
public void changeOperationStatus(boolean status) {
if (!status) {
emptyTv.setText(getString(R.string.bus_p_no_out));
emptyTv.setText(getString(R.string.shuttle_p_jl_no_out));
mNoLineInfoView.setVisibility(View.VISIBLE);
mRouteInfoView.setVisibility(View.GONE);
mLineName.setText(getContext().getString(R.string.bus_p_no_line));
mLineName.setText(getContext().getString(R.string.shuttle_p_jl_no_line));
updateArrivedStation(null,0,true);
clearMapView();
clearMapMarkers();
@@ -179,12 +179,12 @@ public class BusPassengerRouteFragment extends
if (mNoLineInfoView.getVisibility() == View.GONE){
mNoLineInfoView.setVisibility(View.VISIBLE);
mRouteInfoView.setVisibility(View.GONE);
mLineName.setText(getContext().getString(R.string.bus_p_no_line));
mLineName.setText(getContext().getString(R.string.shuttle_p_jl_no_line));
updateArrivedStation(null,0,true);
clearMapView();
clearMapMarkers();
}
emptyTv.setText(getString(R.string.bus_p_no_task));
emptyTv.setText(getString(R.string.shuttle_p_jl_no_task));
}
public void hideNoTaskView(){
@@ -281,27 +281,27 @@ public class BusPassengerRouteFragment extends
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
if (null == station){
mCurrentArriveStation.setText("----");
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
}else {
mCurrentArriveStation.setText(station);
if (currentIndex == 0){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
return;
}
if (isArrived){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.shuttle_p_jl_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_arrived_bg);
handleArrivedSpeakIconDrawable();
}else {
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_next_station_title));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_un_arrived_bg);
mCurrentArriveStationTitle.setText(getResources().getString(R.string.shuttle_p_jl_cur_next_station_title));
mCurrentArriveTip.setBackgroundResource(R.drawable.shuttle_p_jl_cur_station_un_arrived_bg);
handleArrivingSpeakIconDrawable();
}
}
@@ -351,9 +351,9 @@ public class BusPassengerRouteFragment extends
public void AutopilotStatusChanged(int status) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
mAutopilotIv.setImageResource(R.drawable.auto_open);
mAutopilotIv.setImageResource(R.drawable.shuttle_p_jl_auto_open);
} else {
mAutopilotIv.setImageResource(R.drawable.auto_close);
mAutopilotIv.setImageResource(R.drawable.shuttle_p_jl_auto_close);
}
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui
package com.mogo.och.shuttle.passenger.ui
import android.content.Context
import android.util.AttributeSet
@@ -9,8 +9,10 @@ import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.jinlvvan.bus_p_traffic_light_view.view.*
import com.mogo.och.shuttle.passenger.R
import kotlinx.android.synthetic.main.shuttle_p_jl_traffic_light_view.view.bus_p_traffic_light_bg
import kotlinx.android.synthetic.main.shuttle_p_jl_traffic_light_view.view.bus_p_traffic_light_iv
import kotlinx.android.synthetic.main.shuttle_p_jl_traffic_light_view.view.bus_p_traffic_light_time_tv
/**
* bus乘客端红绿灯view
@@ -34,7 +36,7 @@ class BusPassengerTrafficLightView @JvmOverloads constructor(
}
private fun init(context: Context?) {
LayoutInflater.from(context).inflate(R.layout.bus_p_traffic_light_view, this, true)
LayoutInflater.from(context).inflate(R.layout.shuttle_p_jl_traffic_light_view, this, true)
}
override fun onAttachedToWindow() {
@@ -134,15 +136,15 @@ class BusPassengerTrafficLightView @JvmOverloads constructor(
UiThreadHandler.post {
when (lightId) {
TrafficLightEnum.RED -> {
bus_p_traffic_light_iv.setBackgroundResource(R.drawable.bus_p_light_red_nor)
bus_p_traffic_light_iv.setBackgroundResource(R.drawable.shuttle_p_jl_light_red_nor)
this@BusPassengerTrafficLightView.visibility = VISIBLE
}
TrafficLightEnum.YELLOW -> {
bus_p_traffic_light_iv.setBackgroundResource(R.drawable.bus_p_light_yellow_nor)
bus_p_traffic_light_iv.setBackgroundResource(R.drawable.shuttle_p_jl_light_yellow_nor)
this@BusPassengerTrafficLightView.visibility = VISIBLE
}
TrafficLightEnum.GREEN -> {
bus_p_traffic_light_iv.setBackgroundResource(R.drawable.bus_p_light_green_nor)
bus_p_traffic_light_iv.setBackgroundResource(R.drawable.shuttle_p_jl_light_green_nor)
this@BusPassengerTrafficLightView.visibility = VISIBLE
}
else -> this@BusPassengerTrafficLightView.visibility = GONE
@@ -156,7 +158,7 @@ class BusPassengerTrafficLightView @JvmOverloads constructor(
val layoutParams = layoutParams
if (layoutParams is MarginLayoutParams) {
val lp = layoutParams
lp.width = resources.getDimension(R.dimen.bus_p_traffic_light_icon_size).toInt()
lp.width = resources.getDimension(R.dimen.shuttle_p_jl_traffic_light_icon_size).toInt()
setLayoutParams(lp)
bus_p_traffic_light_time_tv.visibility = GONE
bus_p_traffic_light_bg.layoutParams.width =
@@ -169,11 +171,11 @@ class BusPassengerTrafficLightView @JvmOverloads constructor(
val layoutParams = layoutParams
if (layoutParams is MarginLayoutParams) {
val lp = layoutParams
lp.width = resources.getDimension(R.dimen.bus_p_route_traffic_light_view_width).toInt()
lp.width = resources.getDimension(R.dimen.shuttle_p_jl_route_traffic_light_view_width).toInt()
setLayoutParams(lp)
bus_p_traffic_light_time_tv.visibility = VISIBLE
bus_p_traffic_light_bg.layoutParams.width =
resources.getDimension(R.dimen.bus_p_traffic_light_bg_width).toInt()
resources.getDimension(R.dimen.shuttle_p_jl_traffic_light_bg_width).toInt()
}
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.layoutmanager;
package com.mogo.och.shuttle.passenger.ui.layoutmanager;
import android.content.Context;
import android.util.AttributeSet;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.mapdirectionview
package com.mogo.och.shuttle.passenger.ui.mapdirectionview
import android.content.Context
import android.os.Bundle
@@ -27,9 +27,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.ui.IBusPassengerMapDirectionView
import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.ui.IBusPassengerMapDirectionView
import com.mogo.och.shuttle.passenger.utils.BusPassengerMapAssetStyleUtil
/**
* 乘客屏小地图
@@ -72,7 +72,7 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
private fun initView(context: Context) {
d(SceneConstant.M_BUS_P + TAG, "initView")
val smpView = LayoutInflater.from(context).inflate(R.layout.bus_p_map_view, this)
val smpView = LayoutInflater.from(context).inflate(R.layout.shuttle_p_jl_map_view, this)
mAMapNaviView = smpView.findViewById<View>(R.id.bus_p_line_amap_view) as TextureMapView
initAMapView()
@@ -96,11 +96,11 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
// 设置 锚点 图标
mCarMarker = mAMap.addMarker(
MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_car))
MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.shuttle_p_jl_map_car))
.anchor(0.5f, 0.5f)
)
mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_arrived)
mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_un_arrive)
mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.shuttle_p_jl_map_arrow_arrived)
mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.shuttle_p_jl_map_arrow_un_arrive)
// 加载自定义样式
val customMapStyleOptions = CustomMapStyleOptions()
@@ -312,11 +312,11 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
val size = mLineStationsList.size
val mStartMarker = mAMap.addMarker(
MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_start_point))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.shuttle_p_jl_map_start_point))
)
val mEndMarker = mAMap.addMarker(
MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_end_point))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.shuttle_p_jl_map_end_point))
)
mStartMarker.position = mLineStationsList[0]
mLineMarkers.add(0, mStartMarker)
@@ -324,14 +324,14 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
if (currentIndex <= i && i < size - 1 && i > 0) { //未到达
val unArrivedMarker = mAMap.addMarker(
MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_unarrived_point))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.shuttle_p_jl_map_unarrived_point))
)
unArrivedMarker.position = mLineStationsList[i]
mLineMarkers.add(i, unArrivedMarker)
} else if (i in 1 until currentIndex) {
val arrivedMarker = mAMap.addMarker(
MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrived_point))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.shuttle_p_jl_map_arrived_point))
)
arrivedMarker.position = mLineStationsList[i]
mLineMarkers.add(i, arrivedMarker)

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.mapdirectionview
package com.mogo.och.shuttle.passenger.ui.mapdirectionview
import androidx.lifecycle.ViewModel
import com.amap.api.maps.model.LatLng
@@ -11,14 +11,14 @@ class MapDirectionViewModel: ViewModel(), ITrajectoryListener {
private val TAG = MapDirectionViewModel::class.java.simpleName
private var viewCallback:ItineraryViewCallback?=null
private var viewCallback: ItineraryViewCallback?=null
init {
TrajectoryAndDistanceManager.addTrajectoryListener(TAG,this)
}
fun setDistanceCallback(viewCallback:ItineraryViewCallback){
fun setDistanceCallback(viewCallback: ItineraryViewCallback){
this.viewCallback = viewCallback
}

View File

@@ -0,0 +1,199 @@
package com.mogo.och.shuttle.passenger.ui.widget
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.view.animation.AlphaAnimation
import android.view.animation.Animation
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTurnLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.common.module.manager.lightmanager.TurnLightManager
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.left_nor_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.left_select_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.right_nor_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.right_select_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.turn_light_layout
/**
* @author: wangmingjun
* @date: 2023/2/13
*/
class BusPTurnLightView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr),
IMoGoTurnLightListener, TurnLightManager.TurnLightListener {
companion object {
private const val TAG = "TurnLightViewStatus"
}
private var isLeftLight: Boolean = false
private var isRightLight: Boolean = false
private var isDisappear: Boolean = false
init {
LayoutInflater.from(context)
.inflate(R.layout.shuttle_p_jl_turn_light_status, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerTurnLightListenerManager.addListener(TAG,this)
TurnLightManager.addTurnLightStatusChangeListener(TAG,this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerChassisLamplightListenerManager.removeListener(TAG)
CallerTurnLightListenerManager.removeListener(TAG)
}
override fun hideTurnLightView() {
ThreadUtils.runOnUiThread{
if (!isDisappear) {
isDisappear = true
isLeftLight = false
isRightLight = false
animationDisappear()
}
}
}
override fun statusChange(newStatus: TurnLightManager.TurnLightStatus) {
ThreadUtils.runOnUiThread {
setTurnLight(newStatus)
}
}
/**
* 转向灯动画
*/
private fun setTurnLight(directionLight: TurnLightManager.TurnLightStatus) {
if (!isAttachedToWindow) {
return
}
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
when (directionLight) {
TurnLightManager.TurnLightStatus.TURN_LIGHT_LEFT -> { //左转向
if (!isLeftLight) {
isLeftLight = true
isRightLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.VISIBLE
right_select_image.visibility = View.GONE
right_select_image.clearAnimation()
setAnimation(left_select_image)
}
}
TurnLightManager.TurnLightStatus.TURN_LIGHT_RIGHT -> { //右转向
if (!isRightLight) {
isRightLight = true
isLeftLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.GONE
right_select_image.visibility = View.VISIBLE
left_select_image.clearAnimation()
setAnimation(right_select_image)
}
}
TurnLightManager.TurnLightStatus.TURN_LIGHT_NONE -> { //消失
if (!isDisappear) {
isDisappear = true
isLeftLight = false
isRightLight = false
animationDisappear()
}
}
}
}
//显示背景
private fun showNormalAnimation() {
val appearAnimation = AlphaAnimation(0f, 1.0f)
appearAnimation.duration = 300
val appearAnimationImage = AlphaAnimation(0f, 1.0f)
appearAnimation.duration = 500
turn_light_layout.startAnimation(appearAnimation)
left_nor_image.startAnimation(appearAnimationImage)
right_nor_image.startAnimation(appearAnimationImage)
turn_light_layout.visibility = View.VISIBLE
left_nor_image.visibility = View.VISIBLE
right_nor_image.visibility = View.VISIBLE
}
//消失动画,当转向等数据为空时候
private fun animationDisappear() {
left_select_image.visibility = View.GONE
right_select_image.visibility = View.GONE
left_select_image.clearAnimation()
right_select_image.clearAnimation()
left_nor_image.clearAnimation()
right_nor_image.clearAnimation()
turn_light_layout.clearAnimation()
val disappearAnimationLeft = AlphaAnimation(1.0f, 0f)
disappearAnimationLeft.duration = 300
val disappearAnimationBg = AlphaAnimation(1.0f, 0f)
disappearAnimationBg.duration = 500
left_nor_image.startAnimation(disappearAnimationLeft)
right_nor_image.startAnimation(disappearAnimationLeft)
turn_light_layout.startAnimation(disappearAnimationBg)
disappearAnimationLeft.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationRepeat(p0: Animation?) {
}
override fun onAnimationStart(p0: Animation?) {
}
override fun onAnimationEnd(p0: Animation?) {
left_nor_image.visibility = View.GONE
right_nor_image.visibility = View.GONE
}
})
disappearAnimationBg.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationRepeat(p0: Animation?) {
}
override fun onAnimationStart(p0: Animation?) {
}
override fun onAnimationEnd(p0: Animation?) {
turn_light_layout.visibility = View.GONE
}
})
}
//实现图片闪烁效果
private fun setAnimation(imageView: ImageView) {
val animationSet = AnimatorSet()
val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f)
val valueAnimatorDisappear = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
valueAnimator.duration = 1000
valueAnimatorDisappear.duration = 800
valueAnimator.repeatCount = -1
valueAnimatorDisappear.repeatCount = -1
animationSet.playTogether(valueAnimatorDisappear, valueAnimator)
animationSet.start()
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import com.mogo.eagle.core.data.BaseData;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.och.data.bean.BusRoutesResult;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import java.util.List;
import java.util.Objects;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.bean;
package com.mogo.och.shuttle.passenger.bean;
import java.util.Objects;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.callback
package com.mogo.och.shuttle.passenger.callback
/**
* @author: wangmingjun

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.callback
package com.mogo.och.shuttle.passenger.callback
/**
* @author: wangmingjun

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.callback
package com.mogo.och.shuttle.passenger.callback
import com.mogo.och.data.bean.BusStationBean

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.constant
package com.mogo.och.shuttle.passenger.constant
/**
* Created on 2021/12/6

View File

@@ -1,7 +1,7 @@
package com.mogo.och.bus.passenger.model
package com.mogo.och.shuttle.passenger.model
import android.content.Context
import com.mogo.och.bus.passenger.callback.ADASCallback
import com.mogo.och.shuttle.passenger.callback.ADASCallback
import com.mogo.och.data.bean.BusStationBean
/**

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.model
package com.mogo.och.shuttle.passenger.model
import android.content.Context
import android.media.AudioAttributes
@@ -12,7 +12,6 @@ import com.mogo.commons.module.intent.IMogoIntentListener
import com.mogo.commons.module.intent.IntentManager
import com.mogo.commons.voice.AIAssist
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
@@ -32,14 +31,14 @@ import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.PM2OperationStatusResponse
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.bus.passenger.callback.DrivingInfoCallback
import com.mogo.och.bus.passenger.constant.BusPassengerConst
import com.mogo.och.bus.passenger.model.PM2ServiceManager.driverAppSn
import com.mogo.och.bus.passenger.network.PM2ModelLoopManager
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
import com.mogo.och.shuttle.passenger.bean.PM2OperationStatusResponse
import com.mogo.och.shuttle.passenger.bean.PM2RoutesResponse
import com.mogo.och.shuttle.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.shuttle.passenger.callback.DrivingInfoCallback
import com.mogo.och.shuttle.passenger.model.PM2ServiceManager.driverAppSn
import com.mogo.och.shuttle.passenger.network.PM2ModelLoopManager
import com.mogo.och.common.module.bean.dpmsg.*
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.biz.constant.OchCommonConst

View File

@@ -1,13 +1,13 @@
package com.mogo.och.bus.passenger.model
package com.mogo.och.shuttle.passenger.model
import android.content.Context
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getServerToken
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.passenger.bean.PM2OperationStatusResponse
import com.mogo.och.bus.passenger.bean.PM2QueryLineRequest
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
import com.mogo.och.bus.passenger.network.PM2ServiceApi
import com.mogo.och.shuttle.passenger.bean.PM2OperationStatusResponse
import com.mogo.och.shuttle.passenger.bean.PM2QueryLineRequest
import com.mogo.och.shuttle.passenger.bean.PM2RoutesResponse
import com.mogo.och.shuttle.passenger.network.PM2ServiceApi
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl

View File

@@ -1,9 +1,9 @@
package com.mogo.och.bus.passenger.network
package com.mogo.och.shuttle.passenger.network
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.bus.passenger.constant.BusPassengerConst
import com.mogo.och.bus.passenger.model.PM2DrivingModel
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
import com.mogo.och.shuttle.passenger.model.PM2DrivingModel
import io.reactivex.Observable
import io.reactivex.ObservableOnSubscribe
import io.reactivex.android.schedulers.AndroidSchedulers

View File

@@ -1,8 +1,8 @@
package com.mogo.och.bus.passenger.network;
package com.mogo.och.shuttle.passenger.network;
import com.mogo.och.bus.passenger.bean.PM2OperationStatusResponse;
import com.mogo.och.bus.passenger.bean.PM2QueryLineRequest;
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse;
import com.mogo.och.shuttle.passenger.bean.PM2OperationStatusResponse;
import com.mogo.och.shuttle.passenger.bean.PM2QueryLineRequest;
import com.mogo.och.shuttle.passenger.bean.PM2RoutesResponse;
import io.reactivex.Observable;
import retrofit2.http.Body;

View File

@@ -1,11 +1,11 @@
package com.mogo.och.bus.passenger.presenter
package com.mogo.och.shuttle.passenger.presenter
import androidx.lifecycle.LifecycleOwner
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.callback.ADASCallback
import com.mogo.och.bus.passenger.constant.M2Const.Companion.M2_MAP_STATION_MAKER
import com.mogo.och.bus.passenger.model.PM2ADASModel
import com.mogo.och.bus.passenger.ui.PM2HPMapFragment
import com.mogo.och.shuttle.passenger.callback.ADASCallback
import com.mogo.och.shuttle.passenger.constant.M2Const.Companion.M2_MAP_STATION_MAKER
import com.mogo.och.shuttle.passenger.model.PM2ADASModel
import com.mogo.och.shuttle.passenger.ui.PM2HPMapFragment
class PM2ADASPresenter(view: PM2HPMapFragment?) :
Presenter<PM2HPMapFragment?>(view), ADASCallback {

View File

@@ -1,14 +1,14 @@
package com.mogo.och.bus.passenger.presenter
package com.mogo.och.shuttle.passenger.presenter
import androidx.lifecycle.LifecycleOwner
import com.amap.api.maps.model.LatLng
import com.mogo.commons.mvp.Presenter
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.bus.passenger.callback.DrivingInfoCallback
import com.mogo.och.bus.passenger.model.PM2ADASModel
import com.mogo.och.bus.passenger.model.PM2DrivingModel
import com.mogo.och.bus.passenger.ui.PM2DrivingInfoFragment
import com.mogo.och.shuttle.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.shuttle.passenger.callback.DrivingInfoCallback
import com.mogo.och.shuttle.passenger.model.PM2ADASModel
import com.mogo.och.shuttle.passenger.model.PM2DrivingModel
import com.mogo.och.shuttle.passenger.ui.PM2DrivingInfoFragment
import com.mogo.och.data.bean.BusStationBean
class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :

View File

@@ -1,7 +1,7 @@
package com.mogo.och.bus.passenger.presenter
package com.mogo.och.shuttle.passenger.presenter
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.ui.PM2BaseFragment
import com.mogo.och.shuttle.passenger.ui.PM2BaseFragment
class PM2Presenter(view: PM2BaseFragment?) :
Presenter<PM2BaseFragment?>(view)

View File

@@ -1,7 +1,7 @@
package com.mogo.och.bus.passenger.presenter
package com.mogo.och.shuttle.passenger.presenter
import com.mogo.commons.mvp.Presenter
import com.mogo.och.bus.passenger.ui.video.PM2VideoFragment
import com.mogo.och.shuttle.passenger.ui.video.PM2VideoFragment
class PM2VideoPresenter(view: PM2VideoFragment?) :
Presenter<PM2VideoFragment?>(view)

View File

@@ -1,9 +1,9 @@
package com.mogo.och.bus.passenger.provider;
package com.mogo.och.shuttle.passenger.provider;
import android.content.Context;
import android.view.View;
import com.mogo.och.bus.passenger.ui.widget.M2StatusBarView;
import com.mogo.och.shuttle.passenger.ui.widget.M2StatusBarView;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;

View File

@@ -1,11 +1,9 @@
package com.mogo.och.bus.passenger.ui
package com.mogo.och.shuttle.passenger.ui
import android.provider.Settings
import android.view.Surface
import com.mogo.commons.mvp.MvpFragment
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.PM2Presenter
import com.mogo.och.bus.passenger.ui.video.PM2VideoFragment
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.presenter.PM2Presenter
import com.mogo.och.shuttle.passenger.ui.video.PM2VideoFragment
/**
* @author: wangmingjun
@@ -19,7 +17,7 @@ class PM2BaseFragment :
private var videoFragment : PM2VideoFragment? = null
override fun getLayoutId(): Int {
return R.layout.p_m2_fragment
return R.layout.shuttle_p_m2_fragment
}
override fun getTagName(): String {

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui
package com.mogo.och.shuttle.passenger.ui
import android.graphics.BitmapFactory
import android.graphics.drawable.AnimationDrawable
@@ -11,12 +11,26 @@ import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.function.view.SiteMarkerBean
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.presenter.PM2DrivingPresenter
import com.mogo.och.common.module.utils.DateTimeUtil.*
import com.mogo.och.common.module.utils.NumberFormatUtil
import com.mogo.och.data.bean.BusStationBean
import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.*
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.auto_tv
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.clg_distance_left_time
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.group_not_select_line
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.group_stationinfo
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.iv_animal_list
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.line_during_tv
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.line_name_tv
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.overMapView
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.speed_tv
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.station_name_tv
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.tv_arrived_notice
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.tv_distance
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.tv_left_time
import kotlinx.android.synthetic.main.shuttle_p_m2_driving_info_fragment.tv_next_station_title
import me.jessyan.autosize.utils.AutoSizeUtils
import kotlin.math.ceil
import kotlin.math.roundToInt
@@ -28,10 +42,10 @@ import kotlin.math.roundToInt
class PM2DrivingInfoFragment :
MvpFragment<PM2DrivingInfoFragment?, PM2DrivingPresenter?>() {
val stationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_staton_icon)
val stationPassIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_staton_arrived_icon)
val startStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_start_icon)
val endStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_end_icon)
val stationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.shuttle_p_m2_map_staton_icon)
val stationPassIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.shuttle_p_m2_map_staton_arrived_icon)
val startStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.shuttle_p_m2_map_start_icon)
val endStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.shuttle_p_m2_map_end_icon)
/**
* 改变自动驾驶状态
@@ -39,7 +53,7 @@ class PM2DrivingInfoFragment :
* @param status 2 - running 1 - enable 2 - disable
*/
override fun getLayoutId(): Int {
return R.layout.p_m2_driving_info_fragment
return R.layout.shuttle_p_m2_driving_info_fragment
}
override fun getTagName(): String {
@@ -52,12 +66,12 @@ class PM2DrivingInfoFragment :
true
}
line_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
station_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
line_name_tv.setTextColor(resources.getColor(R.color.shuttle_p_m2_line_name_tv_color))
station_name_tv.setTextColor(resources.getColor(R.color.shuttle_p_m2_line_name_tv_color))
speed_tv.setVertrial(true)
val intArrayOf = intArrayOf(
requireContext().resources.getColor(R.color.shuttle_color_43cefe),
requireContext().resources.getColor(R.color.shuttle_color_1466fb)
requireContext().resources.getColor(R.color.shuttle_p_m2_color_43cefe),
requireContext().resources.getColor(R.color.shuttle_p_m2_color_1466fb)
)
speed_tv.setmColorList(intArrayOf)
@@ -150,7 +164,7 @@ class PM2DrivingInfoFragment :
}
private fun updateNoOrderUI() {
line_name_tv.text = resources.getString(R.string.m2_p_not_select_line_content)
line_name_tv.text = resources.getString(R.string.shuttle_p_m2_not_select_line_content)
updateNoStationView()
overMapView?.let {
it.clearSiteMarkers()
@@ -164,10 +178,10 @@ class PM2DrivingInfoFragment :
}
}
private fun updateNoStationView(){
station_name_tv.setTextColor(resources.getColor(R.color.m2_next_tv_color))
station_name_tv.text = resources.getString(R.string.m2_p_empty_tv)
tv_distance.text = resources.getString(R.string.m2_p_empty_remain_km)
tv_left_time.text = resources.getString(R.string.m2_p_empty_remain_minute)
station_name_tv.setTextColor(resources.getColor(R.color.shuttle_p_m2_next_tv_color))
station_name_tv.text = resources.getString(R.string.shuttle_p_m2_empty_tv)
tv_distance.text = resources.getString(R.string.shuttle_p_m2_empty_remain_km)
tv_left_time.text = resources.getString(R.string.shuttle_p_m2_empty_remain_minute)
noLineShow()
}
@@ -177,11 +191,11 @@ class PM2DrivingInfoFragment :
fun updateAutoStatus(isAutoPilot: Boolean) {
if (isAutoPilot){
context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.m2_p_white_color)) }
context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.auto_button_bg) }
context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.shuttle_p_m2_white_color)) }
context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.shuttle_p_m2_auto_button_bg) }
}else{
context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.shuttle_color_7094ad)) }
context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.bg_p_m2_auto) }
context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.shuttle_p_m2_color_7094ad)) }
context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.shuttle_p_m2_bg_p_m2_auto) }
}
}
@@ -212,16 +226,16 @@ class PM2DrivingInfoFragment :
fun updateStationsInfo(stations: MutableList<BusStationBean>, i: Int, isArrived: Boolean){
if (stations.size == 0) return
if (0<= i && i<stations.size){
station_name_tv.setTextColor(resources.getColor(R.color.m2_next_tv_color))
station_name_tv.setTextColor(resources.getColor(R.color.shuttle_p_m2_next_tv_color))
station_name_tv.text = stations[i].name
}
if (isArrived){//到站
tv_distance.text = resources.getString(R.string.m2_p_empty_remain_km)
tv_left_time.text = resources.getString(R.string.m2_p_empty_remain_minute)
tv_next_station_title.text = resources.getString(R.string.m2_p_station_title_arrived_tv)
tv_distance.text = resources.getString(R.string.shuttle_p_m2_empty_remain_km)
tv_left_time.text = resources.getString(R.string.shuttle_p_m2_empty_remain_minute)
tv_next_station_title.text = resources.getString(R.string.shuttle_p_m2_station_title_arrived_tv)
haveLineAndArrivedStation()
}else{ //前往目的地中
tv_next_station_title.text = resources.getString(R.string.shuttle_p_next_station_title)
tv_next_station_title.text = resources.getString(R.string.shuttle_p_m2_next_station_title)
haveLineAndArriveingStation()
}
}

View File

@@ -1,18 +1,18 @@
package com.mogo.och.bus.passenger.ui
package com.mogo.och.shuttle.passenger.ui
import android.os.Bundle
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverlayManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.map.overlay.core.Level
import com.mogo.map.overlay.point.Point
import com.mogo.map.MapDataWrapper
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.constant.M2Const.Companion.TYPE_MARKER_M2_LINE
import com.mogo.och.bus.passenger.presenter.PM2ADASPresenter
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.constant.M2Const.Companion.TYPE_MARKER_M2_LINE
import com.mogo.och.shuttle.passenger.presenter.PM2ADASPresenter
import com.mogo.och.common.module.utils.OCHThreadPoolManager
import kotlinx.android.synthetic.m2.p_m2_hpmap_fragment.*
import kotlinx.android.synthetic.main.shuttle_p_m2_hpmap_fragment.mapBizView
import java.util.*
/**
@@ -27,7 +27,7 @@ class PM2HPMapFragment :
* @param status 2 - running 1 - enable 2 - disable
*/
override fun getLayoutId(): Int {
return R.layout.p_m2_hpmap_fragment
return R.layout.shuttle_p_m2_hpmap_fragment
}
override fun getTagName(): String {

View File

@@ -1,14 +1,14 @@
package com.mogo.och.bus.passenger.ui.video
package com.mogo.och.shuttle.passenger.ui.video
import com.google.gson.reflect.TypeToken
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.presenter.PM2VideoPresenter
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.presenter.PM2VideoPresenter
import com.mogo.och.common.module.wigets.video.AdsDatas
import com.mogo.och.common.module.wigets.video.RotationItem
import kotlinx.android.synthetic.m2.p_m2_video_fragment.*
import kotlinx.android.synthetic.main.shuttle_p_m2_video_fragment.imageVideoRotationView
/**
* @author: wangmingjun
@@ -20,7 +20,7 @@ class PM2VideoFragment :
private var arrayListOf = mutableListOf<RotationItem>()
override fun getLayoutId(): Int {
return R.layout.p_m2_video_fragment
return R.layout.shuttle_p_m2_video_fragment
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.widget
package com.mogo.och.shuttle.passenger.ui.widget
import android.content.Context
import android.util.AttributeSet
@@ -6,8 +6,8 @@ import android.view.LayoutInflater
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.m2.p_m2_view_blue_tooth.view.*
import com.mogo.och.shuttle.passenger.R
import kotlinx.android.synthetic.main.shuttle_p_m2_view_blue_tooth.view.blueView
/**
* 魔戒蓝牙控件
@@ -20,15 +20,15 @@ class M2BlueToothView @JvmOverloads constructor(
) : BlueToothView(context, attrs, defStyleAttr),IMoGoDevaToolsListener {
init {
LayoutInflater.from(context).inflate(R.layout.p_m2_view_blue_tooth, this, true)
LayoutInflater.from(context).inflate(R.layout.shuttle_p_m2_view_blue_tooth, this, true)
}
override fun mofangStatus(status: Boolean) {
ThreadUtils.runOnUiThread {
if (status) {
blueView.setImageResource(R.drawable.m2_blue_tooth_close)
blueView.setImageResource(R.drawable.shuttle_p_m2_blue_tooth_close)
} else {
blueView.setImageResource(R.drawable.m2_blue_tooth_open)
blueView.setImageResource(R.drawable.shuttle_p_m2_blue_tooth_open)
}
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.widget
package com.mogo.och.shuttle.passenger.ui.widget
import android.content.Context
import android.util.AttributeSet
@@ -9,8 +9,10 @@ import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.m2.m2_p_traffic_light_view.view.*
import com.mogo.och.shuttle.passenger.R
import kotlinx.android.synthetic.main.shuttle_p_m2_traffic_light_view.view.m2_p_traffic_light_bg
import kotlinx.android.synthetic.main.shuttle_p_m2_traffic_light_view.view.m2_p_traffic_light_iv
import kotlinx.android.synthetic.main.shuttle_p_m2_traffic_light_view.view.m2_p_traffic_light_time_tv
/**
* bus乘客端红绿灯view
@@ -34,7 +36,7 @@ class M2PTrafficLightView @JvmOverloads constructor(
}
private fun init(context: Context?) {
LayoutInflater.from(context).inflate(R.layout.m2_p_traffic_light_view, this, true)
LayoutInflater.from(context).inflate(R.layout.shuttle_p_m2_traffic_light_view, this, true)
}
override fun onAttachedToWindow() {
@@ -134,15 +136,15 @@ class M2PTrafficLightView @JvmOverloads constructor(
UiThreadHandler.post {
when (lightId) {
TrafficLightEnum.RED -> {
m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_red_nor)
m2_p_traffic_light_iv.setBackgroundResource(R.drawable.shuttle_p_m2_light_red_nor)
this@M2PTrafficLightView.visibility = VISIBLE
}
TrafficLightEnum.YELLOW -> {
m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_yellow_nor)
m2_p_traffic_light_iv.setBackgroundResource(R.drawable.shuttle_p_m2_light_yellow_nor)
this@M2PTrafficLightView.visibility = VISIBLE
}
TrafficLightEnum.GREEN -> {
m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_green_nor)
m2_p_traffic_light_iv.setBackgroundResource(R.drawable.shuttle_p_m2_light_green_nor)
this@M2PTrafficLightView.visibility = VISIBLE
}
else -> this@M2PTrafficLightView.visibility = GONE
@@ -169,11 +171,11 @@ class M2PTrafficLightView @JvmOverloads constructor(
val layoutParams = layoutParams
if (layoutParams is MarginLayoutParams) {
val lp = layoutParams
lp.width = resources.getDimension(R.dimen.m2_p_light_width).toInt()
lp.width = resources.getDimension(R.dimen.dp_60).toInt()
setLayoutParams(lp)
m2_p_traffic_light_time_tv.visibility = VISIBLE
m2_p_traffic_light_bg.layoutParams.width =
resources.getDimension(R.dimen.m2_p_light_width).toInt()
resources.getDimension(R.dimen.dp_60).toInt()
}
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.widget
package com.mogo.och.shuttle.passenger.ui.widget
import android.annotation.*
import android.content.Context
@@ -17,8 +17,9 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.m2.p_m2_view_status_bar.view.*
import com.mogo.och.shuttle.passenger.R
import kotlinx.android.synthetic.main.shuttle_p_m2_view_status_bar.view.progress
import kotlinx.android.synthetic.main.shuttle_p_m2_view_status_bar.view.tv_power_cos
import kotlinx.coroutines.*
import me.jessyan.autosize.utils.AutoSizeUtils
@@ -39,7 +40,7 @@ class M2StatusBarView @JvmOverloads constructor(
private var oldBmsSoc: Float = -1.0f
init {
LayoutInflater.from(context).inflate(R.layout.p_m2_view_status_bar, this, true)
LayoutInflater.from(context).inflate(R.layout.shuttle_p_m2_view_status_bar, this, true)
setBackgroundColor(Color.parseColor("#80FFFFFF"))
isClickable = true
isFocusable = true

View File

@@ -0,0 +1,199 @@
package com.mogo.och.shuttle.passenger.ui.widget
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.view.animation.AlphaAnimation
import android.view.animation.Animation
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTurnLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.common.module.manager.lightmanager.TurnLightManager
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.left_nor_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.left_select_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.right_nor_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.right_select_image
import kotlinx.android.synthetic.main.shuttle_p_jl_turn_light_status.view.turn_light_layout
/**
* @author: wangmingjun
* @date: 2023/2/13
*/
class M2TurnLightView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr),
IMoGoTurnLightListener, TurnLightManager.TurnLightListener {
companion object {
private const val TAG = "TurnLightViewStatus"
}
private var isLeftLight: Boolean = false
private var isRightLight: Boolean = false
private var isDisappear: Boolean = false
init {
LayoutInflater.from(context)
.inflate(R.layout.shuttle_p_m2_turn_light_status, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerTurnLightListenerManager.addListener(TAG,this)
TurnLightManager.addTurnLightStatusChangeListener(TAG,this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerChassisLamplightListenerManager.removeListener(TAG)
CallerTurnLightListenerManager.removeListener(TAG)
}
override fun hideTurnLightView() {
ThreadUtils.runOnUiThread{
if (!isDisappear) {
isDisappear = true
isLeftLight = false
isRightLight = false
animationDisappear()
}
}
}
override fun statusChange(newStatus: TurnLightManager.TurnLightStatus) {
ThreadUtils.runOnUiThread {
setTurnLight(newStatus)
}
}
/**
* 转向灯动画
*/
private fun setTurnLight(directionLight: TurnLightManager.TurnLightStatus) {
if (!isAttachedToWindow) {
return
}
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
when (directionLight) {
TurnLightManager.TurnLightStatus.TURN_LIGHT_LEFT -> { //左转向
if (!isLeftLight) {
isLeftLight = true
isRightLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.VISIBLE
right_select_image.visibility = View.GONE
right_select_image.clearAnimation()
setAnimation(left_select_image)
}
}
TurnLightManager.TurnLightStatus.TURN_LIGHT_RIGHT -> { //右转向
if (!isRightLight) {
isRightLight = true
isLeftLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.GONE
right_select_image.visibility = View.VISIBLE
left_select_image.clearAnimation()
setAnimation(right_select_image)
}
}
TurnLightManager.TurnLightStatus.TURN_LIGHT_NONE -> { //消失
if (!isDisappear) {
isDisappear = true
isLeftLight = false
isRightLight = false
animationDisappear()
}
}
}
}
//显示背景
private fun showNormalAnimation() {
val appearAnimation = AlphaAnimation(0f, 1.0f)
appearAnimation.duration = 300
val appearAnimationImage = AlphaAnimation(0f, 1.0f)
appearAnimation.duration = 500
turn_light_layout.startAnimation(appearAnimation)
left_nor_image.startAnimation(appearAnimationImage)
right_nor_image.startAnimation(appearAnimationImage)
turn_light_layout.visibility = View.VISIBLE
left_nor_image.visibility = View.VISIBLE
right_nor_image.visibility = View.VISIBLE
}
//消失动画,当转向等数据为空时候
private fun animationDisappear() {
left_select_image.visibility = View.GONE
right_select_image.visibility = View.GONE
left_select_image.clearAnimation()
right_select_image.clearAnimation()
left_nor_image.clearAnimation()
right_nor_image.clearAnimation()
turn_light_layout.clearAnimation()
val disappearAnimationLeft = AlphaAnimation(1.0f, 0f)
disappearAnimationLeft.duration = 300
val disappearAnimationBg = AlphaAnimation(1.0f, 0f)
disappearAnimationBg.duration = 500
left_nor_image.startAnimation(disappearAnimationLeft)
right_nor_image.startAnimation(disappearAnimationLeft)
turn_light_layout.startAnimation(disappearAnimationBg)
disappearAnimationLeft.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationRepeat(p0: Animation?) {
}
override fun onAnimationStart(p0: Animation?) {
}
override fun onAnimationEnd(p0: Animation?) {
left_nor_image.visibility = View.GONE
right_nor_image.visibility = View.GONE
}
})
disappearAnimationBg.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationRepeat(p0: Animation?) {
}
override fun onAnimationStart(p0: Animation?) {
}
override fun onAnimationEnd(p0: Animation?) {
turn_light_layout.visibility = View.GONE
}
})
}
//实现图片闪烁效果
private fun setAnimation(imageView: ImageView) {
val animationSet = AnimatorSet()
val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f)
val valueAnimatorDisappear = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
valueAnimator.duration = 1000
valueAnimatorDisappear.duration = 800
valueAnimator.repeatCount = -1
valueAnimatorDisappear.repeatCount = -1
animationSet.playTogether(valueAnimatorDisappear, valueAnimator)
animationSet.start()
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.widget.video
package com.mogo.och.shuttle.passenger.ui.widget.video
import android.content.Context
import android.media.AudioManager

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.widget.video
package com.mogo.och.shuttle.passenger.ui.widget.video
import android.annotation.SuppressLint
import android.content.Context
@@ -7,7 +7,7 @@ import android.widget.ImageView
import android.widget.RelativeLayout
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.mogo.och.bus.passenger.R
import com.mogo.och.shuttle.passenger.R
/**
* @author: wangmingjun
@@ -31,13 +31,13 @@ class AdvanceImageView @JvmOverloads constructor(
@SuppressLint("CheckResult")
fun setImagePath(path: String){
imageView?.setImageResource(R.drawable.m2_p_video_holder)
imageView?.setImageResource(R.drawable.shuttle_p_m2_p_video_holder)
imageView?.let { Glide.with(context).asBitmap().load(path)
.apply(
RequestOptions().useUnlimitedSourceGeneratorsPool(true)
.placeholder(R.drawable.m2_p_video_holder)
.error(R.drawable.m2_p_video_holder)
.fallback(R.drawable.m2_p_video_holder)
.placeholder(R.drawable.shuttle_p_m2_p_video_holder)
.error(R.drawable.shuttle_p_m2_p_video_holder)
.fallback(R.drawable.shuttle_p_m2_p_video_holder)
.centerCrop()
)
.into(it) }

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.widget.video
package com.mogo.och.shuttle.passenger.ui.widget.video
import android.content.Context
import android.view.View

View File

@@ -1,4 +1,4 @@
package com.mogo.och.bus.passenger.ui.widget.video
package com.mogo.och.shuttle.passenger.ui.widget.video
import android.annotation.SuppressLint
import android.content.Context
@@ -12,7 +12,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.FileUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.shuttle.passenger.R
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import java.io.File
@@ -91,7 +91,7 @@ class AdvanceVideoView @JvmOverloads constructor(
Logger.d(ImageAndVideoRotation.TAG, "setVideoPath")
// ThreadUtils.runOnUiThread {
// Logger.d(ImageAndVideoRotation.TAG, "bitmap加载")
cacheImage?.setImageResource(R.drawable.m2_p_video_holder)
cacheImage?.setImageResource(R.drawable.shuttle_p_m2_p_video_holder)
// cacheImage?.let { //暂时去掉加载首帧图,加载视频时,用本地默认图
// Glide.with(context).asBitmap().load(cacheImageUrl)
// .apply(

Some files were not shown because too many files have changed in this diff Show More