[shuttle]
[变更文件夹]
This commit is contained in:
yangyakun
2023-08-23 15:37:11 +08:00
parent b6c4777ad4
commit 0b17fd5ca3
430 changed files with 6 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
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

@@ -0,0 +1,38 @@
package com.mogo.och.bus.passenger.constant
import com.mogo.commons.debug.DebugConfig
/**
* Created on 2021/12/6
*/
class BusPassengerConst {
companion object {
// OCH arouter 路由path
const val PATH = "/passenger/api"
// 轮询line
const val LOOP_LINE_2S = 2 * 1000L
const val LOOP_LINE_1S = 1 * 1000L
const val LOOP_DELAY = 100L
// 无状态
const val STATION_STATUS_IDLE = 0
// 已过站(历史站)
const val STATION_STATUS_LEAVING = 1
// 到站(当前站)
const val STATION_STATUS_STOPPED = 2
// 未到站(未到站)
const val STATION_STATUS_ARRIVING = 3
//bus平均速度 bus的平均里程25km/h
const val BUS_AVERAGE_SPEED = 25
//接驳/B2平均速度 bus的平均里程10km/h
const val SHUTTLE_AVERAGE_SPEED = 10
// 订单总里程
const val BUS_SP_KEY_ORDER_SUM_DIS = "BUS_SP_KEY_ORDER_SUM_DIS"
const val QUERY_BUS_P_STATION_DELAY = 3 * 1000L
}
}

View File

@@ -0,0 +1,61 @@
package com.mogo.och.bus.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 BusPassengerMapAssetStyleUtil {
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;
}
}

View File

@@ -0,0 +1,13 @@
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)
}
}