[6.4.0]
[temp]
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
@@ -15,9 +16,10 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +51,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.kotlinstdlib
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
|
||||
package com.mogo.och.bus;
|
||||
|
||||
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.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.fragment.ShuttleFragment;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* 网约车小巴业务实现入口
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = OchCommonConst.SHUTTLE_DRIVER)
|
||||
public class BusProvider implements IMoGoFunctionProvider {
|
||||
|
||||
private static final String TAG = "BusProvider";
|
||||
|
||||
private ShuttleFragment busFragment;
|
||||
private int containerId;
|
||||
private FragmentActivity activity;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
FragmentManager supportFragmentManager = activity.getSupportFragmentManager();
|
||||
if (busFragment == null) {
|
||||
CallerLogger.d(TAG, "准备add fragment======");
|
||||
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(ShuttleFragment.TAG);
|
||||
if (fragmentByTag instanceof ShuttleFragment) {
|
||||
busFragment = (ShuttleFragment) fragmentByTag;
|
||||
} else {
|
||||
busFragment = new ShuttleFragment();
|
||||
}
|
||||
if(!busFragment.isAdded()) {
|
||||
supportFragmentManager.beginTransaction().add(containerId, busFragment, ShuttleFragment.TAG).commitAllowingStateLoss();
|
||||
}
|
||||
return;
|
||||
}
|
||||
CallerLogger.d(TAG, "准备show fragment");
|
||||
supportFragmentManager.beginTransaction().show(busFragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
private void hideFragment() {
|
||||
if (busFragment != null) {
|
||||
CallerLogger.d(TAG, "准备hide fragment");
|
||||
activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFunctionName() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
|
||||
this.containerId = integer;
|
||||
this.activity = fragmentActivity;
|
||||
showFragment();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
if (activity == null) return;
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.mogo.och.bus
|
||||
|
||||
import android.content.Context
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
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.fragment.ShuttleFragment
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.provider.CommonService
|
||||
|
||||
/**
|
||||
* 网约车小巴业务实现入口
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = OchCommonConst.SHUTTLE_DRIVER)
|
||||
class BusProvider : CommonService {
|
||||
private var busFragment: ShuttleFragment? = null
|
||||
override fun init(context: Context) {
|
||||
d(SceneConstant.M_TAXI + TAG, "init")
|
||||
busFragment = ShuttleFragment()
|
||||
}
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return busFragment!!
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BusProvider"
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,10 @@ import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.step
|
||||
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.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.provider.CommonService
|
||||
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
|
||||
import com.mogo.och.common.module.wigets.media.MediaPlayerActivity
|
||||
import com.mogo.och.shuttle.passenger.model.TicketModel
|
||||
@@ -25,80 +27,25 @@ import com.mogo.och.shuttle.passenger.ui.PM2BaseFragment
|
||||
* Created on 2022/3/29
|
||||
*/
|
||||
@Route(path = OchCommonConst.SHUTTLE_PASSENGER)
|
||||
class MogoOCHShuttlePassenger : IMoGoFunctionProvider {
|
||||
private var mActivity: FragmentActivity? = null
|
||||
private var mContainerId = 0
|
||||
private var mPM2Fragment: Fragment? = null
|
||||
|
||||
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||
mActivity = activity
|
||||
mContainerId = containerId!!
|
||||
showFragment()
|
||||
if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
mActivity?.let {
|
||||
MultiDisplayUtils.startActWithSecond(it, MediaPlayerActivity::class.java)
|
||||
}
|
||||
}
|
||||
TicketModel.load()
|
||||
return null
|
||||
}
|
||||
|
||||
override val functionName: String
|
||||
get() = "och-bus-passenger-m2"
|
||||
|
||||
override fun onDestroy() {
|
||||
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
|
||||
mActivity?.finish()
|
||||
}
|
||||
class MogoOCHShuttlePassenger : CommonService {
|
||||
private lateinit var mPM2Fragment: Fragment
|
||||
|
||||
override fun init(context: Context) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private fun stepIntoVrMode() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "进入vr模式")
|
||||
stepInDayMode() //白天模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private fun showFragment() {
|
||||
val supportFragmentManager: FragmentManager? = mActivity?.supportFragmentManager
|
||||
if (mPM2Fragment == null) {
|
||||
|
||||
d(SceneConstant.M_TAXI_P + TAG, "准备add fragment======")
|
||||
|
||||
val fragmentByTag: Fragment? = supportFragmentManager?.findFragmentByTag(PM2BaseFragment.TAG)
|
||||
|
||||
mPM2Fragment = if (fragmentByTag is Fragment){
|
||||
fragmentByTag
|
||||
}else{
|
||||
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
|
||||
PM2BaseFragment()
|
||||
}else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
BusPassengerRouteFragment()
|
||||
}else{
|
||||
BusPassengerRouteFragment()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!mPM2Fragment?.isAdded!!){
|
||||
supportFragmentManager?.beginTransaction()
|
||||
?.add(mContainerId, mPM2Fragment!!, PM2BaseFragment.TAG)?.commitAllowingStateLoss()
|
||||
}
|
||||
return
|
||||
TicketModel.load()
|
||||
mPM2Fragment = if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
|
||||
PM2BaseFragment()
|
||||
}else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
BusPassengerRouteFragment()
|
||||
}else{
|
||||
BusPassengerRouteFragment()
|
||||
}
|
||||
d(SceneConstant.M_TAXI_P + TAG, "准备show fragment")
|
||||
supportFragmentManager?.beginTransaction()?.show(mPM2Fragment!!)
|
||||
?.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
private fun hideFragment() {
|
||||
if (mPM2Fragment != null) {
|
||||
mActivity?.supportFragmentManager?.beginTransaction()?.hide(mPM2Fragment!!)
|
||||
?.commitAllowingStateLoss()
|
||||
override fun getFragment(): Fragment {
|
||||
if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
MultiDisplayUtils.startActWithSecond(ActivityUtils.getTopActivity(), MediaPlayerActivity::class.java)
|
||||
}
|
||||
return mPM2Fragment
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user