在StatusManager设置TopView的显示状态监听
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -18,8 +18,10 @@ import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.navi.TopView;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
@@ -301,6 +303,8 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
Logger.d(TAG, "生硬的删掉了之前的view: " + viewCaches.size());
|
||||
topContainer.removeAllViews();
|
||||
// 同时设置一下隐藏状态
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, false);
|
||||
|
||||
// 如果高度变化,生硬的变化一下高度
|
||||
Logger.d(TAG, "container.height: " + topContainer.getHeight());
|
||||
@@ -427,6 +431,8 @@ public class TopViewAnimHelper {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -506,6 +512,7 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
Logger.d(TAG, "hide top setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,12 @@ import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
*/
|
||||
public interface IMogoStatusManager extends IProvider {
|
||||
|
||||
/**
|
||||
* TopView是否在展示
|
||||
* @return
|
||||
*/
|
||||
boolean isTopViewShow();
|
||||
|
||||
/**
|
||||
* 小智语音 UI 是否在展示
|
||||
*
|
||||
@@ -110,6 +116,13 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
boolean isMainPageLaunched();
|
||||
|
||||
/**
|
||||
* 设置topView展示状态
|
||||
* @param tag 业务类型
|
||||
* @param show true - 显示 false - 隐藏
|
||||
*/
|
||||
void setTopViewShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置小智语音UI状态
|
||||
*
|
||||
|
||||
@@ -78,5 +78,9 @@ public enum StatusDescriptor {
|
||||
/**
|
||||
* 是否已经进入过主页
|
||||
*/
|
||||
MAIN_PAGE_CREATED;
|
||||
MAIN_PAGE_CREATED,
|
||||
/**
|
||||
* topView展示状态
|
||||
*/
|
||||
TOP_VIEW
|
||||
}
|
||||
|
||||
@@ -122,11 +122,21 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
return get_bool_val( StatusDescriptor.MAIN_PAGE_CREATED );
|
||||
}
|
||||
|
||||
private boolean get_bool_val( StatusDescriptor descriptor ) {
|
||||
@Override
|
||||
public boolean isTopViewShow() {
|
||||
return get_bool_val(StatusDescriptor.TOP_VIEW);
|
||||
}
|
||||
|
||||
private boolean get_bool_val(StatusDescriptor descriptor ) {
|
||||
Boolean val = mStatus.get( descriptor );
|
||||
return val == null ? false : val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTopViewShow(String tag, boolean show) {
|
||||
doSetStatus(tag, StatusDescriptor.TOP_VIEW, show);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVoiceUIShow( String tag, boolean show ) {
|
||||
doSetStatus( tag, StatusDescriptor.VOICE_UI, show );
|
||||
|
||||
Reference in New Issue
Block a user