优化基础布局
This commit is contained in:
@@ -11,7 +11,10 @@ import androidx.fragment.app.Fragment;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.view.SlidePanelView;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
@@ -47,6 +50,20 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
|
||||
|
||||
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
|
||||
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
|
||||
|
||||
checkCallView(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isCallViewShow());
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("Och", StatusDescriptor.CALL_VIEW, callViewListener);
|
||||
}
|
||||
|
||||
private void checkCallView(boolean isShown){
|
||||
if (flStationPanelContainer == null) {
|
||||
return;
|
||||
}
|
||||
if (isShown) {
|
||||
flStationPanelContainer.setTranslationY(131f);
|
||||
}else{
|
||||
flStationPanelContainer.setTranslationY(0f);
|
||||
}
|
||||
}
|
||||
|
||||
public void showSlidePanle(String text) {
|
||||
@@ -79,6 +96,18 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
|
||||
return null;
|
||||
}
|
||||
|
||||
private final IMogoStatusChangedListener callViewListener = (descriptor, isTrue) -> {
|
||||
if (descriptor == StatusDescriptor.CALL_VIEW) {
|
||||
checkCallView(isTrue);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().unregisterStatusChangedListener("Och", StatusDescriptor.CALL_VIEW, callViewListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点面板view,在{@link #initViews()}时候添加到container中
|
||||
* @return 站点面板view
|
||||
|
||||
Reference in New Issue
Block a user