Skip to content

Commit ad39a9a

Browse files
author
lucas
committed
Notification 踩坑,视联网模式关闭同时也隐藏视联网模式桌面
1 parent e7b3563 commit ad39a9a

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

VideoOS/LuaViewSDK/src/cn/com/venvy/lua/maper/VenvyNotificationMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Varargs invoke(int code, U target, Varargs varargs) {
5151
public LuaValue registerNotification(U target, Varargs args) {
5252
if (args.narg() > 0) {
5353
final String tag = LuaUtil.getString(args, 2);
54-
final LuaFunction callback = args.optfunction(2, null);
54+
final LuaFunction callback = args.optfunction(3, null);
5555
if (TextUtils.isEmpty(tag)) {
5656
return LuaValue.NIL;
5757
}

VideoOS/LuaViewSDK/src/cn/com/venvy/lua/ud/VenvyUDNotificationCallback.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public VenvyUDNotificationCallback(VenvyLVNotificationCallback view, Globals glo
3434
public VenvyUDNotificationCallback registerNotification(LuaValue callbacks, String tag) {
3535
if (callbacks != null) {
3636
registerNotificationCallback = callbacks;
37+
ObservableManager.getDefaultObserable().addObserver(tag, this);
3738
}
3839
return this;
3940
}

VideoOS/venvy_pub/src/main/java/cn/com/videopls/pub/VideoPlusView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ public void launchH5VisionProgram(String url) {
222222

223223
public void launchDesktopProgram(String targetName){
224224
if(programViewDesktop != null && !TextUtils.isEmpty(targetName)) {
225+
programViewDesktop.setVisibility(VISIBLE);
225226
Uri uri = Uri.parse("LuaView://desktopLuaView?template=" + targetName + "&id=" + targetName.substring(0, targetName.lastIndexOf(".")));
226227
programViewDesktop.navigation(uri, new HashMap<String, String>(), null);
227228
}
@@ -263,5 +264,12 @@ public void stopService(ServiceType serviceType) {
263264
if (programViewA != null) {
264265
programViewA.stopService(serviceType);
265266
}
267+
268+
if(serviceType == ServiceType.ServiceTypeVideoMode){
269+
// 如果是关闭视联网模式,则隐藏视联网桌面
270+
if(programViewDesktop != null){
271+
programViewDesktop.setVisibility(GONE);
272+
}
273+
}
266274
}
267275
}

0 commit comments

Comments
 (0)