[taxi][passenger]
[代码整理] [删除无用code]
This commit is contained in:
@@ -9,11 +9,7 @@ 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.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
|
||||
@@ -21,7 +17,6 @@ import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/1/15
|
||||
@@ -29,7 +24,7 @@ public
|
||||
* 网约车-出租车-乘客端
|
||||
*/
|
||||
@Route(path = TaxiPassengerConst.PATH)
|
||||
class MogoOCHTaxiPassenger implements IMoGoFunctionProvider {
|
||||
public class MogoOCHTaxiPassenger implements IMoGoFunctionProvider {
|
||||
|
||||
private static final String TAG = "MogoOCHTaxiPassenger";
|
||||
private TaxiPassengerBaseFragment ochTaxiPassengerFragment;
|
||||
@@ -41,14 +36,6 @@ class MogoOCHTaxiPassenger implements IMoGoFunctionProvider {
|
||||
CallerLogger.d(M_TAXI_P + TAG, "init");
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.d(M_TAXI_P + TAG, "进入vr模式");
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
FragmentManager supportFragmentManager = mActivity.getSupportFragmentManager();
|
||||
if (ochTaxiPassengerFragment == null) {
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*
|
||||
* 查询订单返回数据结构
|
||||
*/
|
||||
public class TaxiPassengerAllStarWorld extends BaseData {
|
||||
public List<TaxiPassengerStarWorld> data;
|
||||
|
||||
public static class TaxiPassengerStarWorld {
|
||||
public TaxiPassengerStarWorld(String labelInfo) {
|
||||
this.labelInfo = labelInfo;
|
||||
}
|
||||
|
||||
public String labelNo;
|
||||
public String labelInfo;
|
||||
public String star;
|
||||
public String sort;
|
||||
public Boolean isSelect = false;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.bean;
|
||||
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/16
|
||||
*
|
||||
* 上传车机心跳信息请求数据
|
||||
*/
|
||||
public class TaxiPassengerCarHeartbeatReqBean {
|
||||
public String sn;
|
||||
public double lon; //经度
|
||||
public double lat; //纬度
|
||||
public String msgId; //心跳信息唯一标识
|
||||
public int interval; //上报间隔,单位秒,非必传,默认60秒
|
||||
|
||||
public TaxiPassengerCarHeartbeatReqBean(String sn, double lon, double lat) {
|
||||
this.sn = sn;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
this.msgId = UUID.randomUUID().toString();
|
||||
this.interval = (int) (TaxiPassengerConst.LOOP_PERIOD_60S / 1000);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*
|
||||
* 查询订单返回数据结构
|
||||
*/
|
||||
public class TaxiPassengerOrderQueryRemainingResp extends BaseData {
|
||||
public Result data;
|
||||
|
||||
public static class Result {
|
||||
public long distance;
|
||||
public long duration;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.bean;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*/
|
||||
public class TaxiPassengerQueryOrderRouteResp extends BaseData {
|
||||
public List<LatLng> data;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*
|
||||
* 验证手机号后四位同时流转订单状态
|
||||
*/
|
||||
public class TaxiPassengerScoreUpdateOrderReqBean {
|
||||
|
||||
public String orderNo;
|
||||
public int star;
|
||||
public List<TaxiPassengerAllStarWorld.TaxiPassengerStarWorld> evalLabeBasicList;
|
||||
|
||||
public TaxiPassengerScoreUpdateOrderReqBean(String orderNo, int star,List<TaxiPassengerAllStarWorld.TaxiPassengerStarWorld> data) {
|
||||
this.orderNo = orderNo;
|
||||
this.star = star;
|
||||
for (TaxiPassengerAllStarWorld.TaxiPassengerStarWorld datum : data) {
|
||||
datum.isSelect=null;
|
||||
datum.sort = null;
|
||||
datum.star = null;
|
||||
}
|
||||
this.evalLabeBasicList = data;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/12/3
|
||||
*/
|
||||
public interface IOCHTaxiPassengerNaviChangedCallback {
|
||||
// 当前位置距离上车点的距离(米)、预估时间(秒) 、当前路的名称
|
||||
void onCurrentRoadName(String currentRoadName);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
public interface ITaxiPassengerCommonCallback {
|
||||
void onCommonCallback();
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
public interface ITaxiPassengerCommonValueCallback<T> {
|
||||
void onCommonCallback(T t);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/3/10
|
||||
*/
|
||||
public interface ITaxiPassengerMapViewCallback {
|
||||
void onCameraChange(float bearing);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/3/13
|
||||
*/
|
||||
public interface ITaxiPassengerVeloctityCallback {
|
||||
//限速
|
||||
void onLimitingVelocityChange(int limitingVelocity);
|
||||
}
|
||||
@@ -11,17 +11,6 @@ class TaxiPassengerConst {
|
||||
// OCH arouter 路由path
|
||||
const val PATH = "/passenger/api"
|
||||
|
||||
// 上报心跳轮询ms
|
||||
const val LOOP_PERIOD_60S = 60 * 1000L
|
||||
|
||||
// 轮询查询进行中/待服务订单的间隔时间 2秒
|
||||
const val LOOP_PERIOD_2S = 2 * 1000L
|
||||
// 轮询查询新到预约单 1秒
|
||||
const val LOOP_PERIOD_1S = 1 * 1000L
|
||||
const val LOOP_DELAY = 100L
|
||||
|
||||
//实时查询订单剩余时间 和 剩余里程 轮询间隔2s
|
||||
const val LOOP_CALCULATEROUTE_2S = 2 * 1000L
|
||||
|
||||
// 开始服务启动自动驾驶等待时间(埋点上传)
|
||||
const val LOOP_PERIOD_15S = 15 * 1000L
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.event;
|
||||
|
||||
public class FinishActivity {
|
||||
}
|
||||
@@ -32,7 +32,6 @@ import com.mogo.och.taxi.passenger.bean.TaxiPassengerBaseRespBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrdersInServiceQueryRespBean
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerOrderStatusCallback
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonCallback
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum.Companion.valueOf
|
||||
@@ -54,7 +53,6 @@ object TaxiPassengerModel {
|
||||
|
||||
private const val STARTREADYTOAUTOPILOT = "startReadyToAutopilot"
|
||||
private const val MINANDWAITSERVICE = "mInAndWaitService"
|
||||
private const val MQUERYORDERREMAINING = "mQueryOrderRemaining"
|
||||
|
||||
// 获取当前订单
|
||||
@Volatile
|
||||
|
||||
@@ -2,14 +2,11 @@ package com.mogo.och.taxi.passenger.network
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerAllStarWorld
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerBaseRespBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerCheckPhoneUpdateOrderReqBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRemainingResp
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryReqBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrdersInServiceQueryRespBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerStartReqBean
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.Body
|
||||
@@ -51,21 +48,6 @@ internal interface TaxiPassengerServiceApi {
|
||||
@Body data: TaxiPassengerOrderQueryReqBean
|
||||
): Observable<TaxiPassengerOrderQueryRespBean>
|
||||
|
||||
/**
|
||||
* 查询订单剩余里程和时间
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param orderNo
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/autopilot-car-hailing/order/v2/driver/taxi/queryOrderRemaining")
|
||||
fun queryOrderRemaining(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String=SharedPrefsMgr.getInstance().token,
|
||||
@Query("orderNo") orderNo: String
|
||||
): Observable<TaxiPassengerOrderQueryRemainingResp>
|
||||
|
||||
/**
|
||||
* 提交用户输入的手机后4位、并进行状态扭转
|
||||
* @param data
|
||||
@@ -79,42 +61,6 @@ internal interface TaxiPassengerServiceApi {
|
||||
@Body data: TaxiPassengerCheckPhoneUpdateOrderReqBean?
|
||||
): Observable<TaxiPassengerBaseRespBean>
|
||||
|
||||
/**
|
||||
* 对订单进行打分 1-5分 加上文案评论
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/evaluation/info/driver/taxi/submit")
|
||||
fun arrivedAndScore(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String= SharedPrefsMgr.getInstance().token,
|
||||
@Body data: TaxiPassengerScoreUpdateOrderReqBean
|
||||
): Observable<TaxiPassengerBaseRespBean>
|
||||
|
||||
/**
|
||||
* 获取星星对应的文案(所有文案)
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/autopilot-car-hailing/evaluation/label/driver/taxi/list")
|
||||
fun getWorldAllStar(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String=SharedPrefsMgr.getInstance().token,
|
||||
): Observable<TaxiPassengerAllStarWorld>
|
||||
|
||||
/**
|
||||
* 获取星星对应的文案(和星星一一对应)
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/autopilot-car-hailing/evaluation/label/driver/taxi/listByStar")
|
||||
fun getWorldByStar(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String=SharedPrefsMgr.getInstance().token,
|
||||
@Query("star") star: String
|
||||
): Observable<TaxiPassengerAllStarWorld>
|
||||
|
||||
/**
|
||||
* 查询司机是否已确认可开启自动驾驶
|
||||
* @param appId
|
||||
|
||||
@@ -4,11 +4,8 @@ import android.content.Context
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrdersInServiceQueryRespBean
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRemainingResp
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerBaseRespBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerCheckPhoneUpdateOrderReqBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerAllStarWorld
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerStartReqBean
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -73,22 +70,6 @@ object TaxiPassengerServiceManager {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrdersInAndWaitService"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单剩余里程和时间
|
||||
* @param context
|
||||
* @param orderNo
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryOrderRemaining(
|
||||
orderNo: String,
|
||||
callback: OchCommonServiceCallback<TaxiPassengerOrderQueryRemainingResp>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.queryOrderRemaining(orderNo= orderNo)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrderRemaining"))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun checkPhoneAndUpdateOrderStatus(
|
||||
orderNo: String?,
|
||||
@@ -99,23 +80,7 @@ object TaxiPassengerServiceManager {
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "checkPhoneAndUpdateOrderStatus"))
|
||||
}
|
||||
@JvmStatic
|
||||
fun arrivedAndScore(
|
||||
taxiPassengerScoreUpdateOrderReqBean: TaxiPassengerScoreUpdateOrderReqBean,
|
||||
callback: OchCommonServiceCallback<TaxiPassengerBaseRespBean>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.arrivedAndScore(data = taxiPassengerScoreUpdateOrderReqBean)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "checkPhoneAndUpdateOrderStatus"))
|
||||
}
|
||||
@JvmStatic
|
||||
fun getAllScoreWorld(
|
||||
callback: OchCommonServiceCallback<TaxiPassengerAllStarWorld>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.getWorldAllStar()
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "arrivedAndScore"))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun queryPilotStatus(
|
||||
orderNo: String,
|
||||
@@ -137,15 +102,6 @@ object TaxiPassengerServiceManager {
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "startServicePilotDone"))
|
||||
}
|
||||
@JvmStatic
|
||||
fun getWorldByStar(
|
||||
start: String,
|
||||
callback: OchCommonServiceCallback<TaxiPassengerAllStarWorld>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.getWorldByStar(star=start)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "checkPhoneAndUpdateOrderStatus"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过orderId查询订单信息(用于本地已经有orderId时)
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* memory leak fix:
|
||||
* <p>
|
||||
* InputMethodManager#mLastSrvView reference Last Page Activity.
|
||||
*/
|
||||
public class FixMemoryLeak {
|
||||
|
||||
private static Field field;
|
||||
private static boolean hasField = true;
|
||||
|
||||
public static void fixLeak(Context context) {
|
||||
if (!hasField) {
|
||||
return;
|
||||
}
|
||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (imm == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (field == null) {
|
||||
field = imm.getClass().getDeclaredField("mCurRootView");
|
||||
}
|
||||
if (field == null) {
|
||||
hasField = false;
|
||||
}
|
||||
if (field != null) {
|
||||
field.setAccessible(true);
|
||||
field.set(imm, null);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
hasField = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.utils;
|
||||
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/11
|
||||
*/
|
||||
public class OrderUtil {
|
||||
|
||||
// 判断两个list中的订单是否相同:依据orderId
|
||||
public static boolean haveSameOrders(List<TaxiPassengerOrderQueryRespBean.Result> list1,
|
||||
List<TaxiPassengerOrderQueryRespBean.Result> list2) {
|
||||
TaxiPassengerOrderQueryRespBean.Result[] arr1 = list1.toArray(new TaxiPassengerOrderQueryRespBean.Result[]{});
|
||||
TaxiPassengerOrderQueryRespBean.Result[] arr2 = list2.toArray(new TaxiPassengerOrderQueryRespBean.Result[]{});
|
||||
Arrays.sort(arr1);
|
||||
Arrays.sort(arr1);
|
||||
return Arrays.equals(arr1,arr2);
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.utils;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AppOpsManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.location.LocationManager;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.mogo.eagle.core.network.utils.Util;
|
||||
import com.mogo.eagle.core.utilcode.util.Utils;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/12/7
|
||||
*/
|
||||
public class PermissionUtil {
|
||||
|
||||
public static boolean checkPermission(Context context,String... permissons) {
|
||||
|
||||
for (String permisson : permissons) {
|
||||
if ((ContextCompat.checkSelfPermission(context,
|
||||
permisson) != PackageManager.PERMISSION_GRANTED)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isLocServiceEnable(Context context) {
|
||||
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||
boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
|
||||
if (gps || network) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static String processName = "";
|
||||
public static String getCurProcessName() {
|
||||
if(!processName.isEmpty()){
|
||||
return processName;
|
||||
}
|
||||
// 获取此进程的标识符
|
||||
int pid = android.os.Process.myPid();
|
||||
// 获取活动管理器
|
||||
ActivityManager activityManager = (ActivityManager)
|
||||
Utils.getApp().getSystemService(Context.ACTIVITY_SERVICE);
|
||||
// 从应用程序进程列表找到当前进程,是:返回当前进程名
|
||||
for (ActivityManager.RunningAppProcessInfo appProcess :
|
||||
activityManager.getRunningAppProcesses()) {
|
||||
if (appProcess.pid == pid) {
|
||||
|
||||
return appProcess.processName;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.utils;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/18/20 5:37 PM
|
||||
*/
|
||||
public class TaxiPassengerMapAssetStyleUtil {
|
||||
|
||||
public static byte[] getAssetsStyle(Context context,String fileName) {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (is1 != null) {
|
||||
is1.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return buffer1;
|
||||
}
|
||||
|
||||
|
||||
public static byte[] getAssetsExtraStyle(Context context, String fileName) {
|
||||
byte[] buffer1 = null;
|
||||
InputStream is1 = null;
|
||||
try {
|
||||
is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style_extra.data
|
||||
int lenght1 = is1.available();
|
||||
buffer1 = new byte[lenght1];
|
||||
is1.read(buffer1);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (is1 != null) {
|
||||
is1.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return buffer1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.utils.windowdispatch;
|
||||
|
||||
import android.graphics.Region;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
public class OnComputeInternalInsetsListener implements InvocationHandler {
|
||||
|
||||
private Region touchRegion = null;
|
||||
public Object getListener() {
|
||||
Object target = null;
|
||||
try {
|
||||
Class class1 = Class.forName("android.view.ViewTreeObserver$OnComputeInternalInsetsListener");
|
||||
target = Proxy.newProxyInstance(OnComputeInternalInsetsListener.class.getClassLoader(),
|
||||
new Class[]{class1}, this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
public Region getTouchRegion() {
|
||||
return touchRegion;
|
||||
}
|
||||
|
||||
public void setTouchRegion(Region touchRegion) {
|
||||
this.touchRegion = touchRegion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) {
|
||||
try {
|
||||
Field regionField = args[0].getClass()
|
||||
.getDeclaredField("touchableRegion");
|
||||
regionField.setAccessible(true);
|
||||
Field insetField = args[0].getClass()
|
||||
.getDeclaredField("mTouchableInsets");
|
||||
insetField.setAccessible(true);
|
||||
if (touchRegion != null) {
|
||||
Region region = (Region) regionField.get(args[0]);
|
||||
region.set(touchRegion);
|
||||
insetField.set(args[0], InputMethodService.Insets.TOUCHABLE_INSETS_REGION);
|
||||
} else {
|
||||
insetField.set(args[0], InputMethodService.Insets.TOUCHABLE_INSETS_FRAME);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.utils.windowdispatch;
|
||||
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ReflectionUtils {
|
||||
|
||||
private ReflectionUtils() {
|
||||
|
||||
}
|
||||
|
||||
public static void removeOnComputeInternalInsetsListener(ViewTreeObserver viewTree) {
|
||||
if (viewTree == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Class<?> clazz = Class.forName("android.view.ViewTreeObserver");
|
||||
Field field = viewTree.getClass().getDeclaredField("mOnComputeInternalInsetsListeners");
|
||||
field.setAccessible(true);
|
||||
Object listenerList = field.get(viewTree);
|
||||
Method method = listenerList.getClass().getDeclaredMethod("getArray");
|
||||
method.setAccessible(true);
|
||||
ArrayList<Object> list = (ArrayList<Object>) method.invoke(listenerList);
|
||||
Class<?> classes[] = {Class.forName("android.view.ViewTreeObserver$OnComputeInternalInsetsListener")};
|
||||
if (list != null && list.size() > 0) {
|
||||
clazz.getDeclaredMethod("removeOnComputeInternalInsetsListener", classes).invoke(viewTree,
|
||||
list.get(0));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void addOnComputeInternalInsetsListener(ViewTreeObserver viewTree, Object object) {
|
||||
if (viewTree == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Class<?> classes[] = {Class.forName("android.view.ViewTreeObserver$OnComputeInternalInsetsListener")};
|
||||
Class<?> clazz = Class.forName("android.view.ViewTreeObserver");
|
||||
clazz.getDeclaredMethod("addOnComputeInternalInsetsListener", classes).invoke(viewTree,
|
||||
object);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.widget;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.Transformation;
|
||||
|
||||
public class ResizeAnimation extends Animation {
|
||||
|
||||
final int targetHeight;
|
||||
View view;
|
||||
int startHeight;
|
||||
public ResizeAnimation(View view, int targetHeight, int startHeight) {
|
||||
this.view = view;
|
||||
this.targetHeight = targetHeight;
|
||||
this.startHeight = startHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyTransformation(float interpolatedTime, Transformation t) {
|
||||
|
||||
int newHeight = (int) (startHeight + (targetHeight-startHeight) * interpolatedTime);
|
||||
view.getLayoutParams().height = newHeight;
|
||||
|
||||
view.requestLayout();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void initialize(int width, int height, int parentWidth, int parentHeight) {
|
||||
super.initialize(width, height, parentWidth, parentHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean willChangeBounds() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment;
|
||||
@@ -37,14 +36,6 @@ public class MogoOCHTaxiPassenger implements IMoGoFunctionProvider {
|
||||
CallerLogger.d(M_TAXI_P + TAG, "init");
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.d(M_TAXI_P + TAG, "进入vr模式");
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
FragmentManager supportFragmentManager = mActivity.getSupportFragmentManager();
|
||||
if (ochTaxiPassengerFragment == null) {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
public interface ITaxiPassengerCommonCallback {
|
||||
void onCommonCallback();
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger.callback;
|
||||
|
||||
public interface ITaxiPassengerCommonValueCallback<T> {
|
||||
void onCommonCallback(T t);
|
||||
}
|
||||
Reference in New Issue
Block a user