Adjust lounge notification
This commit is contained in:
1 parent
b52cd6f01b
commit
37dde57c67
3 files changed
+20
-14
No files matched your search
@@ -367,12 +367,10 @@ class LoungeApi
|
||||
m.loungeServiceNode.devices = devices
|
||||
|
||||
userName = newDevice.user
|
||||
if StringUtils.IsNullOrEmpty(userName)
|
||||
userName = newDevice.name
|
||||
end if
|
||||
deviceName = newDevice.name
|
||||
userAvatarUri = newDevice.userAvatarUri
|
||||
|
||||
LoungeDeviceConnected.ShowNotifcation(m.notificationsNode, userName, userAvatarUri)
|
||||
LoungeDeviceConnected.ShowNotifcation(m.notificationsNode, deviceName, userName, userAvatarUri)
|
||||
end function
|
||||
|
||||
function HandleRemoteDisconnected(commandId as integer, commandType as string, commandArgs as object, messagesToSend as object) as void
|
||||
|
||||
+8
-3
@@ -2,6 +2,7 @@
|
||||
<interface>
|
||||
<field id="thumbnail" type="uri" alias="thumbnailPoster.uri" />
|
||||
<field id="line1" type="string" alias="line1Label.text" />
|
||||
<field id="line2" type="string" alias="line2Label.text" />
|
||||
<field id="show" type="boolean" alwaysNotify="true" onChange="OnShow" />
|
||||
</interface>
|
||||
<children>
|
||||
@@ -20,18 +21,22 @@
|
||||
translation="[10,10]" />
|
||||
|
||||
<LayoutGroup
|
||||
itemSpacings="[10]"
|
||||
translation="[100,10]">
|
||||
itemSpacings="[5,5]"
|
||||
translation="[100,15]">
|
||||
<Label
|
||||
width="230"
|
||||
font="font:SmallestBoldSystemFont"
|
||||
horizAlign="center"
|
||||
text="Device connected">
|
||||
<Font role="font" uri="font:BoldSystemFontFile" size="22" />
|
||||
</Label>
|
||||
<Label
|
||||
id="line1Label"
|
||||
width="230"
|
||||
font="font:SmallestBoldSystemFont"
|
||||
horizAlign="center" />
|
||||
<Label
|
||||
id="line2Label"
|
||||
width="230"
|
||||
font="font:SmallestSystemFont"
|
||||
horizAlign="center" />
|
||||
</LayoutGroup>
|
||||
|
||||
+10
-7
@@ -1,20 +1,23 @@
|
||||
namespace LoungeDeviceConnected
|
||||
const NOTIFICATION_NODE_ID = "DeviceConnectedNotification"
|
||||
|
||||
function ShowNotifcation(notifications as object, name as dynamic, thumbnail as dynamic) as void
|
||||
function ShowNotifcation(notifications as object, deviceName as dynamic, userName as dynamic, userAvatarUri as dynamic) as void
|
||||
notification = notifications.findNode(NOTIFICATION_NODE_ID)
|
||||
if notification = invalid
|
||||
notification = notifications.createChild("DeviceConnectedNotification")
|
||||
notification.id = NOTIFICATION_NODE_ID
|
||||
end if
|
||||
if StringUtils.IsNullOrEmpty(name)
|
||||
name = "Device"
|
||||
|
||||
if StringUtils.IsNullOrEmpty(deviceName)
|
||||
deviceName = "Device"
|
||||
end if
|
||||
notification.line1 = name
|
||||
if StringUtils.IsNullOrEmpty(thumbnail)
|
||||
thumbnail = "pkg:/images/icons/user.png"
|
||||
if StringUtils.IsNullOrEmpty(userAvatarUri)
|
||||
userAvatarUri = "pkg:/images/icons/user.png"
|
||||
end if
|
||||
notification.thumbnail = thumbnail
|
||||
|
||||
notification.line1 = deviceName
|
||||
notification.line2 = userName
|
||||
notification.thumbnail = userAvatarUri
|
||||
notification.show = true
|
||||
end function
|
||||
|
||||
|
||||
Reference in new issue
Block a user