[6.4.0]
[fragment 内存泄漏]
This commit is contained in:
@@ -18,14 +18,20 @@ import com.mogo.och.common.module.biz.provider.CommonServiceImpl
|
||||
class BusDriverProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = BusDriverProvider::class.java.simpleName
|
||||
private lateinit var busFragment: BusFragment
|
||||
private var busFragment: BusFragment?=null
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return busFragment
|
||||
if(busFragment==null){
|
||||
busFragment = BusFragment()
|
||||
}
|
||||
return busFragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
busFragment = null
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d(tag, "准备show fragment")
|
||||
busFragment = BusFragment()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,27 @@ class BusPassengerProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = BusPassengerProvider::class.java.simpleName
|
||||
|
||||
private lateinit var mPM2Fragment: Fragment
|
||||
private var mPM2Fragment: Fragment?=null
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
MultiDisplayUtils.startActWithSecond(ActivityUtils.getTopActivity(), MediaPlayerActivity::class.java)
|
||||
}
|
||||
return mPM2Fragment
|
||||
if(mPM2Fragment==null){
|
||||
mPM2Fragment = if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
PM2BaseFragment()
|
||||
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
BusPassengerRouteFragment()
|
||||
} else {
|
||||
BusPassengerRouteFragment()
|
||||
}
|
||||
}
|
||||
return mPM2Fragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
super.resetFragment()
|
||||
mPM2Fragment = null
|
||||
}
|
||||
|
||||
override fun getStatusBarView(context: Context): View {
|
||||
@@ -53,13 +67,6 @@ class BusPassengerProvider : CommonServiceImpl() {
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d(SceneConstant.M_TAXI_P + tag, "init")
|
||||
mPM2Fragment = if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
PM2BaseFragment()
|
||||
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
BusPassengerRouteFragment()
|
||||
} else {
|
||||
BusPassengerRouteFragment()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,6 +58,7 @@ class M2TurnLightView @JvmOverloads constructor(
|
||||
super.onDetachedFromWindow()
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
CallerTurnLightListenerManager.removeListener(TAG)
|
||||
TurnLightManager.removeTurnLightStatusChangeListener(TAG)
|
||||
}
|
||||
|
||||
override fun hideTurnLightView() {
|
||||
|
||||
@@ -19,15 +19,22 @@ import com.mogo.och.common.module.biz.provider.CommonServiceImpl
|
||||
class CharterDriverProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = CharterDriverProvider::class.java.simpleName
|
||||
private lateinit var fragment: Fragment
|
||||
private var fragment: Fragment?=null
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return fragment
|
||||
CallerLogger.d(SceneConstant.M_TAXI + tag, "getFragment")
|
||||
if(fragment==null){
|
||||
fragment = DriverM1Fragment()
|
||||
}
|
||||
return fragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
fragment = null
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d(SceneConstant.M_TAXI + tag, "init")
|
||||
fragment = DriverM1Fragment()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,10 +21,19 @@ import com.mogo.och.common.module.biz.provider.CommonServiceImpl
|
||||
class CharterPassengerProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = CharterPassengerProvider::class.java.simpleName
|
||||
private lateinit var fragment: MainFragment
|
||||
private var fragment: MainFragment?=null
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return fragment
|
||||
CallerLogger.d(SceneConstant.M_TAXI_P + tag, "getFragment")
|
||||
if(fragment==null){
|
||||
fragment = MainFragment()
|
||||
}
|
||||
return fragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
CallerLogger.d(SceneConstant.M_TAXI_P + tag, "resetFragment")
|
||||
fragment = null
|
||||
}
|
||||
|
||||
override fun getStatusBarView(context: Context): View {
|
||||
@@ -36,7 +45,6 @@ class CharterPassengerProvider : CommonServiceImpl() {
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d(SceneConstant.M_TAXI_P + tag, "init")
|
||||
fragment = MainFragment()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -272,6 +272,7 @@ class MainFragment : MvpFragment<MainFragment?, BusPassengerPresenter?>(), IMogo
|
||||
override fun onDestroyView() {
|
||||
mapBizView.onDestroy()
|
||||
omvOverMap.onDestroy()
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||
super.onDestroyView()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ open class MusicCheckView @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.charter_p_bottom_music, this, true)
|
||||
AuditionManager.addDataChangeListener(TAG,this)
|
||||
try {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.CharterPBottomSelectView)
|
||||
backageViewId = typedArray.getResourceId(R.styleable.CharterPBottomSelectView_charterPBackageViewId, -1)
|
||||
@@ -141,6 +140,7 @@ open class MusicCheckView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
AuditionManager.addDataChangeListener(TAG,this)
|
||||
parent?.let {
|
||||
if (parent is ConstraintLayout) {
|
||||
if (backageViewId > 0) {
|
||||
@@ -153,6 +153,11 @@ open class MusicCheckView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
AuditionManager.removeDataChangeListener(TAG)
|
||||
}
|
||||
|
||||
override fun updateState(oldData: MusicData?, musicData: MusicData) {
|
||||
if(musicData.state== PlayState.Playing){
|
||||
Glide.with(context)
|
||||
|
||||
@@ -37,18 +37,6 @@ class LockAndUnlockView : ConstraintLayout, LockManager.LockStatusCallback {
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.charter_p_devices_lock_unlock, this, true)
|
||||
handler = object : Handler(Looper.myLooper()!!) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
when (msg.what) {
|
||||
2 -> {// 解锁
|
||||
LockManager.setLock(LockManager.LockStatus.UNLOCK)
|
||||
animations?.stop()
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
@@ -63,10 +51,25 @@ class LockAndUnlockView : ConstraintLayout, LockManager.LockStatusCallback {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
handler = object : Handler(Looper.myLooper()!!) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
when (msg.what) {
|
||||
2 -> {// 解锁
|
||||
LockManager.setLock(LockManager.LockStatus.UNLOCK)
|
||||
animations?.stop()
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
handler?.removeCallbacksAndMessages(null)
|
||||
handler = null
|
||||
LockManager.setAutoStatusCallback(TAG, null)
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ class LockViewConstrainLayout : ConstraintLayout {
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
acivScreenLock = null
|
||||
uvOnlyUnlock = null
|
||||
uv_only_unlock = null
|
||||
super.onDetachedFromWindow()
|
||||
LockManager.stopLoop4Lock()
|
||||
}
|
||||
|
||||
@@ -55,6 +55,11 @@ class UnlockView : ConstraintLayout, LockManager.LockStatusCallback {
|
||||
LockManager.setAutoStatusCallback(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
LockManager.setAutoStatusCallback(TAG,null)
|
||||
}
|
||||
|
||||
override fun setVisibility(visibility: Int) {
|
||||
super.setVisibility(visibility)
|
||||
LockManager.setStatusView(visibility)
|
||||
|
||||
@@ -34,6 +34,12 @@ object TurnLightManager : IMoGoChassisLamplightListener {
|
||||
listener.statusChange(turnLightStatus)
|
||||
}
|
||||
|
||||
fun removeTurnLightStatusChangeListener(tag:String){
|
||||
if (lightStatusChange.containsKey(tag)){
|
||||
lightStatusChange.remove(tag)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 转向灯
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import kotlinx.android.synthetic.main.fragment_video_player.imageVideoRotationView
|
||||
|
||||
/**
|
||||
@@ -57,7 +58,7 @@ class MediaPlayerFragment :
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
//imageVideoRotationView.setPause()
|
||||
imageVideoRotationView.setPause()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
@@ -67,6 +68,7 @@ class MediaPlayerFragment :
|
||||
|
||||
override fun onDestroy() {
|
||||
MediaDataSourceManager.unInit(TAG)
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
super.onDestroy()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,9 +59,20 @@ boolean isCurrentFlavors(String flavors){
|
||||
return false
|
||||
}
|
||||
|
||||
boolean isBaiLing() {
|
||||
for (String s : gradle.startParameter.taskNames) {
|
||||
println "----------isPassenger------${s}"
|
||||
if (s.contains("Bailing") | s.contains("bailing")) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
ext {
|
||||
isPassenger = this.&isPassenger
|
||||
isDriver = this.&isDriver
|
||||
isBaiLing = this.&isBaiLing
|
||||
isCurrentFlavors = this.&isCurrentFlavors
|
||||
isCurrentDriver = this.&isCurrentDriver
|
||||
isCurrentPassenger = this.&isCurrentPassenger
|
||||
|
||||
@@ -160,7 +160,7 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
val fragment = getFragment()
|
||||
injectStatusBar()
|
||||
d(TAG, "切换 fragment:${fragment}")
|
||||
|
||||
LoginStatusManager.resetFragment()
|
||||
if (supportFragmentManager != null) {
|
||||
val back = supportFragmentManager.beginTransaction()
|
||||
back.replace(containerId, fragment, fragment.tag)
|
||||
|
||||
@@ -26,17 +26,10 @@ import com.mogo.och.shuttle.passenger.ui.widget.M2StatusBarView
|
||||
class ShuttlePassengerProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = ShuttlePassengerProvider::class.java.simpleName
|
||||
private lateinit var mPM2Fragment: Fragment
|
||||
private var mPM2Fragment: Fragment?=null
|
||||
|
||||
override fun init(context: Context) {
|
||||
TicketModel.load()
|
||||
mPM2Fragment = if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
PM2BaseFragment()
|
||||
}else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
BusPassengerRouteFragment()
|
||||
}else{
|
||||
BusPassengerRouteFragment()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getStatusBarView(context: Context): View {
|
||||
@@ -56,7 +49,21 @@ class ShuttlePassengerProvider : CommonServiceImpl() {
|
||||
if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
MultiDisplayUtils.startActWithSecond(ActivityUtils.getTopActivity(), MediaPlayerActivity::class.java)
|
||||
}
|
||||
return mPM2Fragment
|
||||
if(mPM2Fragment==null){
|
||||
mPM2Fragment = if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
PM2BaseFragment()
|
||||
}else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
BusPassengerRouteFragment()
|
||||
}else{
|
||||
BusPassengerRouteFragment()
|
||||
}
|
||||
}
|
||||
return mPM2Fragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
super.resetFragment()
|
||||
mPM2Fragment = null
|
||||
}
|
||||
|
||||
}
|
||||
@@ -86,20 +86,26 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void onAutopilotEnable() {
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDisable() {
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRunning() {
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,14 +115,16 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (location != null){
|
||||
if (location != null && mView != null){
|
||||
runOnUIThread(() -> mView.onCarLocationChanged(location));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeOperationStatus(boolean changeStatus) {
|
||||
runOnUIThread(() -> mView.changeOperationStatus(changeStatus));
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.changeOperationStatus(changeStatus));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,27 +134,37 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void updateLineInfo(String lineName) {
|
||||
runOnUIThread(() -> mView.updateLineInfo(lineName));
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.updateLineInfo(lineName));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStationsInfo(List<BusStationBean> stations, int currentStationIndex, boolean isArrived) {
|
||||
runOnUIThread(() -> mView.updateStationsInfo(stations,currentStationIndex, isArrived));
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.updateStationsInfo(stations, currentStationIndex, isArrived));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showNoTaskView() {
|
||||
runOnUIThread(() -> mView.showNoTaskView());
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.showNoTaskView());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideNoTaskView() {
|
||||
runOnUIThread(() -> mView.hideNoTaskView());
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.hideNoTaskView());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void routePlanningToNextStationChanged(long meters, long timeInSecond) {
|
||||
runOnUIThread(() -> mView.updateRoutePlanningToNextStation(meters, timeInSecond));
|
||||
if(mView != null) {
|
||||
runOnUIThread(() -> mView.updateRoutePlanningToNextStation(meters, timeInSecond));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,6 +58,7 @@ class BusPTurnLightView @JvmOverloads constructor(
|
||||
super.onDetachedFromWindow()
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
CallerTurnLightListenerManager.removeListener(TAG)
|
||||
TurnLightManager.removeTurnLightStatusChangeListener(TAG)
|
||||
}
|
||||
|
||||
override fun hideTurnLightView() {
|
||||
|
||||
@@ -124,11 +124,9 @@ class PM2DrivingInfoFragment :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
overMapView?.let{
|
||||
it.onDestroy()
|
||||
}
|
||||
override fun onDestroyView() {
|
||||
overMapView?.onDestroy()
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
fun updateSpeed(speed: Int){
|
||||
|
||||
@@ -58,6 +58,7 @@ class M2TurnLightView @JvmOverloads constructor(
|
||||
super.onDetachedFromWindow()
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
CallerTurnLightListenerManager.removeListener(TAG)
|
||||
TurnLightManager.removeTurnLightStatusChangeListener(TAG)
|
||||
}
|
||||
|
||||
override fun hideTurnLightView() {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
android:id="@+id/wifiStateView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
app:wifi_size="@dimen/dp_18"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/status_bar_logo"
|
||||
|
||||
@@ -21,14 +21,22 @@ import com.mogo.och.taxi.ui.TaxiFragment
|
||||
class TaxiDriverProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = TaxiDriverProvider::class.java.simpleName
|
||||
private lateinit var ochTaxiFragment: TaxiFragment
|
||||
private var ochTaxiFragment: TaxiFragment? = null
|
||||
|
||||
override fun init(context: Context) {
|
||||
d(SceneConstant.M_TAXI + tag, "init")
|
||||
ochTaxiFragment = TaxiFragment()
|
||||
|
||||
}
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return ochTaxiFragment
|
||||
if (ochTaxiFragment == null) {
|
||||
ochTaxiFragment = TaxiFragment()
|
||||
}
|
||||
return ochTaxiFragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
super.resetFragment()
|
||||
ochTaxiFragment = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,9 @@ import com.mogo.och.taxi.passenger.ui.statusview.StatusBarView
|
||||
class TaxiPassengerProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = TaxiPassengerProvider::class.java.simpleName
|
||||
private lateinit var ochTaxiPassengerFragment: TaxiPassengerBaseFragment
|
||||
private var ochTaxiPassengerFragment: TaxiPassengerBaseFragment?=null
|
||||
override fun init(context: Context) {
|
||||
d(SceneConstant.M_TAXI_P + tag, "init")
|
||||
ochTaxiPassengerFragment = TaxiPassengerBaseFragment()
|
||||
}
|
||||
|
||||
override fun getStatusBarView(context: Context): View {
|
||||
@@ -37,7 +36,15 @@ class TaxiPassengerProvider : CommonServiceImpl() {
|
||||
}
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return ochTaxiPassengerFragment
|
||||
if(ochTaxiPassengerFragment==null){
|
||||
ochTaxiPassengerFragment = TaxiPassengerBaseFragment()
|
||||
}
|
||||
return ochTaxiPassengerFragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
super.resetFragment()
|
||||
ochTaxiPassengerFragment = null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,14 +21,22 @@ import com.mogo.och.taxi.ui.base.TaxiFragment
|
||||
class TaxiUnmannedDriverProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = TaxiUnmannedDriverProvider::class.java.simpleName
|
||||
private lateinit var ochTaxiFragment: TaxiFragment
|
||||
private var ochTaxiFragment: TaxiFragment?=null
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d(SceneConstant.M_TAXI + tag, "init")
|
||||
ochTaxiFragment = TaxiFragment()
|
||||
}
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return ochTaxiFragment
|
||||
CallerLogger.d(SceneConstant.M_TAXI + tag, "getFragment")
|
||||
if(ochTaxiFragment==null){
|
||||
ochTaxiFragment = TaxiFragment()
|
||||
}
|
||||
return ochTaxiFragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
CallerLogger.d(SceneConstant.M_TAXI + tag, "resetFragment")
|
||||
ochTaxiFragment = null
|
||||
}
|
||||
}
|
||||
@@ -23,10 +23,9 @@ import com.mogo.och.taxi.passenger.ui.statusview.StatusBarView
|
||||
class TaxiUnmannedPassengerProvider : CommonServiceImpl() {
|
||||
|
||||
private val tag = TaxiUnmannedPassengerProvider::class.java.simpleName
|
||||
private lateinit var ochTaxiPassengerFragment: TaxiPassengerBaseFragment
|
||||
private var ochTaxiPassengerFragment: TaxiPassengerBaseFragment? = null
|
||||
override fun init(context: Context) {
|
||||
d(SceneConstant.M_TAXI_P + tag, "init")
|
||||
ochTaxiPassengerFragment = TaxiPassengerBaseFragment()
|
||||
statusBarView = StatusBarView(context)
|
||||
}
|
||||
|
||||
@@ -38,7 +37,15 @@ class TaxiUnmannedPassengerProvider : CommonServiceImpl() {
|
||||
}
|
||||
|
||||
override fun getFragment(): Fragment {
|
||||
return ochTaxiPassengerFragment
|
||||
if(ochTaxiPassengerFragment==null){
|
||||
ochTaxiPassengerFragment = TaxiPassengerBaseFragment()
|
||||
}
|
||||
return ochTaxiPassengerFragment!!
|
||||
}
|
||||
|
||||
override fun resetFragment() {
|
||||
super.resetFragment()
|
||||
ochTaxiPassengerFragment = null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user