[dev_arch_opt_3.0]
[Change] [ 1、增加副屏幕启动页面的工具及说明书 ] Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -24,3 +24,4 @@
|
||||
- mogo-core-res:程序中涉及到的图片及布局资源,同一管理,并通过设置不同的目录指定是那个模块的资源,这里只存放公共资源,图片,布局,动画等
|
||||
|
||||
- mogo-core-utils:基于成熟的工具类开源框架下沉的,这里可以增添针对我们业务上的一些工具类
|
||||
- MultiDisplayUtils :多屏幕管理工具
|
||||
|
||||
16
core/README_MULT_DISPLAY.md
Normal file
16
core/README_MULT_DISPLAY.md
Normal file
@@ -0,0 +1,16 @@
|
||||
## 多屏幕场景
|
||||
|
||||
```java
|
||||
// 在第二个屏幕启动页面
|
||||
MultiDisplayUtils.INSTANCE.startActWithSecond(
|
||||
context,
|
||||
VideoAdAtc.class);
|
||||
```
|
||||
|
||||
```java
|
||||
// 在指定屏幕启动页面
|
||||
MultiDisplayUtils.INSTANCE.startActWithProcess(
|
||||
1,
|
||||
context,
|
||||
VideoAdAtc.class);
|
||||
```
|
||||
@@ -45,7 +45,7 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 针对作为Launcher的情况,做个性化操作
|
||||
* 针对作为Launcher的情况,做个性化操作 TODO 测试用的,可删除
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.widget.TextureVideoView
|
||||
|
||||
/**
|
||||
* 视频广告
|
||||
* 视频广告 TODO 测试用的,可删除
|
||||
*/
|
||||
class VideoAdAtc : AppCompatActivity() {
|
||||
|
||||
|
||||
@@ -27,14 +27,14 @@ object MultiDisplayUtils {
|
||||
fun getMultiDisplay(context: Context): Array<out Display> {
|
||||
// 多次创建副屏 则副屏的id都是增加的,所以不一定是1,这里还是获取一下
|
||||
val displayManager =
|
||||
context.getSystemService(AppCompatActivity.DISPLAY_SERVICE) as DisplayManager
|
||||
context.getSystemService(AppCompatActivity.DISPLAY_SERVICE) as DisplayManager
|
||||
return displayManager.displays
|
||||
}
|
||||
|
||||
/**
|
||||
* 在指定ID的屏幕打开Activity,当前应用的,当前进程
|
||||
* @param context
|
||||
* @param launchDisplayId 指定屏幕ID
|
||||
* @param activity 要在第二个屏幕启动的页面
|
||||
*/
|
||||
fun startActWithSecond(context: Context, activity: Class<*>) {
|
||||
val launchDisplayId: Int
|
||||
@@ -60,6 +60,7 @@ object MultiDisplayUtils {
|
||||
* 在指定ID的屏幕打开Activity,当前应用的,当前进程
|
||||
* @param context
|
||||
* @param launchDisplayId 指定屏幕ID
|
||||
* @param activity 要在副屏幕启动的页面
|
||||
*/
|
||||
fun startActWithProcess(context: Context, launchDisplayId: Int, activity: Class<*>) {
|
||||
// 要加上Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
|
||||
Reference in New Issue
Block a user