[m1]
[1.0.0] [状态栏通过Arout获取]
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application>
|
||||
|
||||
<!-- <!–保活用–>
|
||||
<service
|
||||
android:name="com.zhidao.boot.persistent.lib.PersistentAliveService"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.zhidao.boot.persistent.lib.action" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<activity
|
||||
android:name="com.zhidao.boot.persistent.lib.PersistentAliveActivity"
|
||||
android:resizeableActivity="false"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
-->
|
||||
<activity
|
||||
android:name=".ui.M1HomeActivity"
|
||||
android:clearTaskOnLaunch="false"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:enabled="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:resizeableActivity="false"
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="landscape"
|
||||
android:stateNotNeeded="true"
|
||||
android:theme="@style/Main"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<!--调试用,暂时开启LAUNCHER这个属性-->
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.LAUNCHER_APP" />
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<data
|
||||
android:host="launcher"
|
||||
android:path="/main/switch2"
|
||||
android:scheme="mogo" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.mogo.och.bus.passenger.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.och.bus.passenger.view.statusbar.StatusBarView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-06
|
||||
* <p>
|
||||
* 根据优先级控制显示 window view.
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
|
||||
public class StatusViewManager implements IStatusViewLayout {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getStatusView(Context context) {
|
||||
return new StatusBarView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import com.mogo.och.bus.passenger.view.statusbar.StatusBarView
|
||||
|
||||
class M1HomeActivity : MainLauncherActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
statusBar = StatusBarView(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiFloatViewManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager.initStageTwo
|
||||
@@ -97,7 +98,8 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
decorView.clipToPadding = false
|
||||
var statusBarView = decorView.findViewWithTag<View>("status_bar")
|
||||
if (statusBarView == null) {
|
||||
statusBarView = statusBar
|
||||
val statusBar = CallerHmiFloatViewManager.getView(this)
|
||||
statusBarView = statusBar?:StatusBarView(this)
|
||||
statusBarView.setTag("status_bar")
|
||||
}
|
||||
val statusBarLP = FrameLayout.LayoutParams(
|
||||
@@ -109,19 +111,6 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
decorView.addView(statusBarView, statusBarLP)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改statusBar重新赋值
|
||||
* @return StatusBarView
|
||||
*/
|
||||
protected var statusBar: View?=null
|
||||
get() {
|
||||
return if (field == null) {
|
||||
StatusBarView(this)
|
||||
}else{
|
||||
field
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
calculateStartTime()
|
||||
|
||||
@@ -35,6 +35,12 @@ public class MogoServicePaths {
|
||||
@Deprecated
|
||||
public static final String PATH_FLOAT_VIEW_MANAGER = "/floatview/api";
|
||||
|
||||
/**
|
||||
* Status View
|
||||
*/
|
||||
@Keep
|
||||
public static final String PATH_STATUS_VIEW_MANAGER = "/statusview/api";
|
||||
|
||||
/**
|
||||
* v2x 模块
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.eagle.core.function.api.hmi.view
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
/**
|
||||
* 设置状态栏View
|
||||
*/
|
||||
interface IStatusViewLayout : IProvider{
|
||||
|
||||
/**
|
||||
* 提供状态栏View
|
||||
*/
|
||||
fun getStatusView(context: Context):View
|
||||
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.mogo.eagle.core.function.call.hmi
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_FLOAT_VIEW_MANAGER
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_STATUS_VIEW_MANAGER
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLayoutSet
|
||||
|
||||
/**
|
||||
@@ -14,6 +17,9 @@ object CallerHmiFloatViewManager {
|
||||
private val floatViewProviderApi
|
||||
get() = ARouter.getInstance().build(PATH_FLOAT_VIEW_MANAGER)
|
||||
.navigation() as? IViewLayoutSet
|
||||
private val statusViewProviderApi
|
||||
get() = ARouter.getInstance().build(PATH_STATUS_VIEW_MANAGER)
|
||||
.navigation() as? IStatusViewLayout
|
||||
|
||||
fun addView(view: View, params: FrameLayout.LayoutParams, movable: Boolean) {
|
||||
floatViewProviderApi?.addView(view, params, movable)
|
||||
@@ -22,4 +28,8 @@ object CallerHmiFloatViewManager {
|
||||
fun removeView(view: View) {
|
||||
floatViewProviderApi?.removeView(view)
|
||||
}
|
||||
|
||||
fun getView(context:Context):View?{
|
||||
return statusViewProviderApi?.getStatusView(context)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user