dev_arch_opt_3.0]全局预览放入业务类中
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package com.mogo.och.taxi.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.mogo.commons.mvp.BaseFragment
|
||||
import com.mogo.eagle.core.function.overview.view.OverMapView
|
||||
|
||||
class OverviewFragment : BaseFragment() {
|
||||
|
||||
private var overmapview:OverMapView?=null
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
if (overmapview == null) {
|
||||
overmapview = OverMapView(requireContext())
|
||||
} else {
|
||||
val viewGroup = overmapview?.parent as ViewGroup
|
||||
viewGroup.removeView(overmapview)
|
||||
}
|
||||
overmapview?.onCreateView(savedInstanceState)
|
||||
return overmapview!!
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
overmapview?.onResume()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
overmapview?.onPause()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
overmapview?.onDestroy()
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return TAG
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
}
|
||||
|
||||
companion object{
|
||||
private const val TAG = "OverviewFragment"
|
||||
@JvmStatic
|
||||
fun newInstance(): OverviewFragment {
|
||||
val args = Bundle()
|
||||
val fragment = OverviewFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,8 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private WeakReference<TaxiPassengerCheckView> mArrivedCheckView;
|
||||
private WeakReference<TaxiPassengerStartAutopilotView> mStartAutopilotView;
|
||||
protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null;
|
||||
|
||||
protected OverviewFragment overviewFragment = null;
|
||||
//消息盒子
|
||||
private PassengerMsgBoxButtonView viewPassengerMsgBoxButton;
|
||||
private PassengerMsgBoxBubbleView viewPassengerMsgBoxBubble;
|
||||
@@ -149,6 +151,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}
|
||||
//OverlayLeftViewUtils.INSTANCE.dismissOverlayView();
|
||||
});
|
||||
findViewById(R.id.iv_temp).setOnClickListener(view -> {
|
||||
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(),0,true,-1,true);
|
||||
//showOrHideArrivedEndLayout(true, "北京北京北京", "1527481606997577728");
|
||||
//showOrHidePressengerCheckPager(true, "开始站点开", "开始站点开始站点开始", "2", "京A888888", "18811539480");
|
||||
//OCHFloatWindowManager.getInstance().ShowFloatWindow(getContext());
|
||||
});
|
||||
}
|
||||
|
||||
private void initArrivedView() {
|
||||
@@ -258,10 +266,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void changeOverview(UIStatus uiStatus) {
|
||||
if (uiStatus.status == UIStatus.LIVE) {
|
||||
CallerHmiManager.INSTANCE.hideSmallFragment();
|
||||
// CallerHmiManager.INSTANCE.hideSmallFragment();
|
||||
showOrHideOverMapViewFragment(false);
|
||||
showOrHideServingOrderFragment(true, false);
|
||||
} else if (uiStatus.status == UIStatus.OVERVIEW) {
|
||||
CallerHmiManager.INSTANCE.showSmallFragment();
|
||||
// CallerHmiManager.INSTANCE.showSmallFragment();
|
||||
showOrHideOverMapViewFragment(true);
|
||||
showOrHideServingOrderFragment(false, false);
|
||||
}
|
||||
}
|
||||
@@ -281,7 +291,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (isShow) {
|
||||
if (ochServingOrderFragment == null) {
|
||||
ochServingOrderFragment = new TaxiPassengerServingOrderFragment().newInstance();
|
||||
ochServingOrderFragment = TaxiPassengerServingOrderFragment.newInstance();
|
||||
}
|
||||
if (showOrHideLefeMenu) {
|
||||
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(), 0, true, -1, true);
|
||||
@@ -316,6 +326,39 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示或隐藏全局概览
|
||||
*
|
||||
* @param isShow
|
||||
*/
|
||||
public void showOrHideOverMapViewFragment(boolean isShow) {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (isShow) {
|
||||
if (overviewFragment == null) {
|
||||
overviewFragment = OverviewFragment.newInstance();
|
||||
}
|
||||
if (overviewFragment.isHidden()) {
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
|
||||
.show(overviewFragment).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
if (overviewFragment.isAdded()) {
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
|
||||
.show(overviewFragment).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
transaction
|
||||
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
|
||||
.add(R.id.fl_container_overview, overviewFragment)
|
||||
.show(overviewFragment).commitAllowingStateLoss();
|
||||
} else {
|
||||
if (overviewFragment != null) {
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
|
||||
.hide(overviewFragment).commitAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示或者隐藏乘客可点击自动驾驶页面
|
||||
* 乘客验证成功,页面显示,按钮置于不可点击
|
||||
|
||||
@@ -3,15 +3,14 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_72">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||
android:id="@+id/steering_wheel"
|
||||
android:layout_width="@dimen/dp_630"
|
||||
android:layout_height="@dimen/dp_630"
|
||||
android:layout_marginLeft="-59dp"
|
||||
android:layout_marginTop="-40dp"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -21,7 +20,7 @@
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/taxi_p_un_auto_nor"
|
||||
android:visibility="gone"
|
||||
@@ -96,6 +95,7 @@
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
android:text="模拟 不可自动驾驶"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
@@ -154,7 +154,7 @@
|
||||
android:id="@+id/module_mogo_och_navi_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:layout_marginTop="@dimen/dp_192"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -163,10 +163,15 @@
|
||||
android:id="@+id/traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/taxi_p_traffic_light_layout_margin_top"
|
||||
android:layout_marginTop="@dimen/dp_95"
|
||||
android:layout_marginRight="@dimen/taxi_p_traffic_light_layout_margin_right"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_container_overview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -20,10 +20,10 @@
|
||||
tools:replace="android:label">
|
||||
<meta-data
|
||||
android:name="design_width_in_dp"
|
||||
android:value="5120"/>
|
||||
android:value="2560"/>
|
||||
<meta-data
|
||||
android:name="design_height_in_dp"
|
||||
android:value="3200"/>
|
||||
android:value="1600"/>
|
||||
|
||||
<!-- <provider-->
|
||||
<!-- android:name="com.rousetime.android_startup.provider.StartupProvider"-->
|
||||
|
||||
Reference in New Issue
Block a user