1 parent
deeed05383
commit
e8fd7ee35d
13 files changed
+61
-27
No files matched your search
@@ -1,11 +1,3 @@
|
||||
function Init()
|
||||
m.authorLabel = m.top.FindNode("authorLabel")
|
||||
m.subCountLabel = m.top.FindNode("subCountLabel")
|
||||
m.videoCountLabel = m.top.FindNode("videoCountLabel")
|
||||
m.thumbnail = m.top.FindNode("thumbnail")
|
||||
m.thumbnail.failedBitmapUri = "pkg:/images/thumbnail-missing.jpg"
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
content = m.top.itemContent
|
||||
|
||||
@@ -14,8 +6,8 @@ function OnContentSet() as void
|
||||
end if
|
||||
|
||||
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||
m.authorLabel.text = content._author
|
||||
m.subCountLabel.text = content.subCountText
|
||||
m.videoCountLabel.text = content.videoCountText
|
||||
m.thumbnail.uri = content.thumbnail
|
||||
m.top._author = content._author
|
||||
m.top.subCountText = content.subCountText
|
||||
m.top.videoCountText = content.videoCountText
|
||||
m.top.thumbnail = content.thumbnail
|
||||
end function
|
||||
@@ -1,7 +1,11 @@
|
||||
<component name="ChannelRowCell" extends="Group">
|
||||
<interface>
|
||||
<field id="itemContent" type="node" onChange="OnContentSet" />
|
||||
<field id="type" type="string" value="channel" />
|
||||
<field id="_author" type="string" alias="authorLabel.text" />
|
||||
<field id="subCountText" type="string" alias="subCountLabel.text" />
|
||||
<field id="videoCountText" type="string" alias="videoCountLabel.text" />
|
||||
<field id="thumbnail" type="uri" alias="thumbnail.uri" />
|
||||
<field id="itemContent" type="node" onChange="OnContentSet" />
|
||||
</interface>
|
||||
<children>
|
||||
<LayoutGroup
|
||||
@@ -10,7 +14,8 @@
|
||||
<CirclePoster
|
||||
id="thumbnail"
|
||||
width="196"
|
||||
height="196" />
|
||||
height="196"
|
||||
failedBitmapUri="pkg:/images/thumbnail-missing.jpg" />
|
||||
|
||||
<Label
|
||||
id="authorLabel"
|
||||
|
||||
@@ -3,6 +3,10 @@ import "pkg:/source/utils/TimeUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
FindChildren()
|
||||
end function
|
||||
|
||||
function FindChildren()
|
||||
m.titleLabel = m.top.FindNode("titleLabel")
|
||||
m.authorLabel = m.top.FindNode("authorLabel")
|
||||
m.viewCountDateLabel = m.top.FindNode("viewCountDateLabel")
|
||||
@@ -11,7 +15,6 @@ function Init()
|
||||
m.durationRect = m.top.FindNode("durationRect")
|
||||
m.durationLabel = m.top.FindNode("durationLabel")
|
||||
m.thumbnail = m.top.FindNode("thumbnail")
|
||||
m.thumbnail.failedBitmapUri = "pkg:/images/thumbnail-missing.jpg"
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
@@ -21,6 +24,10 @@ function OnContentSet() as void
|
||||
return
|
||||
end if
|
||||
|
||||
if m.titleLabel = invalid
|
||||
FindChildren()
|
||||
end if
|
||||
|
||||
m.titleLabel.text = content.title
|
||||
m.authorLabel.text = content.author
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
id="thumbnail"
|
||||
loadDisplayMode="scaleToZoom"
|
||||
width="350"
|
||||
height="196">
|
||||
height="196"
|
||||
failedBitmapUri="pkg:/images/thumbnail-missing.jpg">
|
||||
<Rectangle
|
||||
id="durationRect"
|
||||
width="60"
|
||||
|
||||
Reference in new issue
Block a user