Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
# Conflicts: # core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt # core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml
This commit is contained in:
@@ -39,10 +39,11 @@ object MultiDisplayUtils {
|
||||
// 获取除了内置屏幕(主屏幕)的其它屏幕
|
||||
val displays = mDisplayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION)
|
||||
// 初始化新的集合进行接收排序后的屏幕信息
|
||||
val displaysList = arrayOfNulls<Display>(displays.size)
|
||||
var displaysList = arrayOfNulls<Display>(displays.size)
|
||||
|
||||
// 判断副屏个数
|
||||
if (displays.isNotEmpty()) {
|
||||
displaysList = arrayOfNulls(displays.size)
|
||||
// 循环出来副屏幕进行重新排序
|
||||
for (i in displays.indices) {
|
||||
// 这里如果需要固定某个屏幕, 使用 if( display.toString().indexOf("port=1")!=-1) ) 而不是使用 display[i]
|
||||
@@ -62,6 +63,18 @@ object MultiDisplayUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 处理EB5副屏幕
|
||||
else {
|
||||
if (mDisplayManager.displays.isNotEmpty()) {
|
||||
displaysList = arrayOfNulls(1)
|
||||
// EB5目前副屏幕ID为固定4096
|
||||
for (i in mDisplayManager.displays.indices) {
|
||||
if (mDisplayManager.displays[i].displayId == 4096) {
|
||||
displaysList[0] = mDisplayManager.displays[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return displaysList
|
||||
}
|
||||
|
||||
@@ -83,11 +96,9 @@ object MultiDisplayUtils {
|
||||
* @param activity 要在第二个屏幕启动的页面
|
||||
*/
|
||||
fun startActWithSecond(context: Context, activity: Class<*>) {
|
||||
val launchDisplayId: Int
|
||||
if (isSupportMultiDisplay(context)) {
|
||||
if (getOtherDisplay().size > 1 && getOtherDisplay()[0] != null) {
|
||||
launchDisplayId = getOtherDisplay()[0]!!.displayId
|
||||
|
||||
if (getOtherDisplay().isNotEmpty() && getOtherDisplay()[0] != null) {
|
||||
val launchDisplayId = getOtherDisplay()[0]!!.displayId
|
||||
// 要加上Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
val options = ActivityOptions.makeBasic()
|
||||
options.launchDisplayId = launchDisplayId
|
||||
|
||||
Reference in New Issue
Block a user