Merge pull request #1004 from sevenrats/new-persondetails-view

New persondetails view
This commit is contained in:
1hitsong 2023-02-12 07:02:09 -05:00 committed by GitHub
commit 37298339cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 58 deletions

View File

@ -29,7 +29,7 @@
<StdDlgTitleArea id="titleArea" />
<StdDlgContentArea id="contentArea">
<StdDlgTextItem id="description"
namedTextStyle="secondary" />
namedTextStyle="normal" />
</StdDlgContentArea>
</children>
</component>

View File

@ -5,10 +5,7 @@ sub init()
m.btnGrp.observeField("escape", "onButtonGroupEscaped")
m.favBtn = m.top.findNode("favorite-button")
m.extrasGrp = m.top.findNode("extrasGrp")
m.top.findNode("VertSlider").keyValue = "[[30, 998], [30, 789], [30, 580], [30,371 ], [30, 162]]"
m.extrasGrp.opacity = 1.0
m.extrasGrp.translation = "[30, 998]"
m.dscr.observeField("isTextEllipsized", "onEllipsisChanged")
createDialogPallete()
m.top.optionsAvailable = false
end sub
@ -17,8 +14,18 @@ sub loadPerson()
item = m.top.itemContent
itemData = item.json
m.top.Id = itemData.id
m.top.findNode("Name").Text = itemData.Name
name = m.top.findNode("Name")
name.Text = itemData.Name
name.font.size = 70
if itemData.PremiereDate <> invalid and itemData.PremiereDate <> ""
lifeStringLabel = createObject("rosgnode", "Label")
lifeStringLabel.id = "premierDate"
lifeStringLabel.font = "font:SmallestBoldSystemFont"
lifeStringLabel.height = "100"
lifeStringLabel.vertAlign = "bottom"
name.vertAlign = "top"
name.font.size = 60
m.top.findNode("title_rectangle").appendChild(lifeStringLabel)
birthDate = CreateObject("roDateTime")
birthDate.FromISO8601String(itemData.PremiereDate)
deathDate = CreateObject("roDatetime")
@ -39,9 +46,15 @@ sub loadPerson()
end if
end if
lifeString = lifeString + " * " + tr("Age") + ": " + stri(age)
m.top.findNode("premierDate").Text = lifeString
lifeStringLabel.Text = lifeString
end if
if itemData.Overview <> invalid and itemData.Overview <> ""
m.dscr.text = itemData.Overview
else
m.dscr.text = tr("Biographical information for this person is not currently available.")
m.dscr.horizAlign = "center"
m.dscr.vertAlign = "center"
end if
m.dscr.text = itemData.Overview
if item.posterURL <> invalid and item.posterURL <> ""
m.top.findnode("personImage").uri = item.posterURL
else
@ -50,31 +63,21 @@ sub loadPerson()
m.vidsList.callFunc("loadPersonVideos", m.top.Id)
setFavoriteColor()
m.favBtn.setFocus(true)
end sub
sub onEllipsisChanged()
if m.dscr.isTextEllipsized
dscrShowFocus()
end if
if not m.favBtn.hasFocus() then dscrShowFocus()
end sub
sub dscrShowFocus()
if m.dscr.isTextEllipsized
m.dscr.setFocus(true)
m.dscr.opacity = 1.0
m.top.findNode("dscrBorder").color = "#d0d0d0ff"
end if
m.dscr.setFocus(true)
m.dscr.opacity = 1.0
m.top.findNode("dscrBorder").color = "#d0d0d0ff"
end sub
sub onButtonGroupEscaped()
key = m.btnGrp.escape
if key = "down"
m.vidsList.setFocus(true)
m.top.findNode("VertSlider").reverse = false
m.top.findNode("pplAnime").control = "start"
else if key = "up" and m.dscr.isTextEllipsized
dscrShowFocus()
m.dscr.setFocus(true)
m.dscr.opacity = 1.0
m.top.findNode("dscrBorder").color = "#d0d0d0ff"
end if
end sub
@ -82,7 +85,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false
if key = "OK"
if m.dscr.hasFocus() and m.dscr.isTextEllipsized
if m.dscr.hasFocus()
createFullDscrDlg()
return true
end if
@ -95,17 +98,24 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
if key = "down"
if m.dscr.hasFocus()
m.dscr.opacity = 0.6
m.top.findNode("dscrBorder").color = "#data202020ff"
m.vidsList.setFocus(true)
m.top.findNode("VertSlider").reverse = false
m.top.findNode("pplAnime").control = "start"
return true
end if
else if key = "up"
if m.dscr.hasFocus()
m.favBtn.setFocus(true)
m.dscr.opacity = 0.6
m.top.findNode("dscrBorder").color = "#data202020ff"
return true
end if
else if key = "up"
if m.vidsList.isInFocusChain() and m.vidsList.itemFocused = 0
else if m.vidsList.isInFocusChain() and m.vidsList.itemFocused = 0
m.top.findNode("VertSlider").reverse = true
m.top.findNode("pplAnime").control = "start"
m.favBtn.setFocus(true)
dscrShowFocus()
return true
end if
end if
@ -128,19 +138,13 @@ end sub
sub createFullDscrDlg()
dlg = CreateObject("roSGNode", "OverviewDialog")
dlg.Title = tr("Press 'OK' to Close")
dlg.Title = m.top.itemContent.json.Name
dlg.width = 1290
dlg.palette = m.dlgPalette
dlg.overview = [m.dscr.text]
dlg.overview = m.dscr.text
m.fullDscrDlg = dlg
m.top.getScene().dialog = dlg
border = createObject("roSGNode", "Poster")
border.uri = "pkg:/images/hd_focul_9.png"
border.blendColor = "#c9c9c9ff"
border.width = dlg.width + 6
border.height = dlg.height + 6
border.translation = [dlg.translation[0] - 3, dlg.translation[1] - 3]
border.visible = true
end sub
sub createDialogPallete()

View File

@ -7,32 +7,31 @@
</interface>
<children>
<LayoutGroup id="main_group"
layoutdirection="vert" translation="[60, 180]" itemSpacings="[36]">
layoutdirection="vert" translation="[60, 180]" itemSpacings="[36]" >
<LayoutGroup id="header_group" layoutdirection="horiz" >
<LayoutGroup id="title_group" layoutdirection="vert" itemSpacings="[11]" >
<Rectangle id="title_rectangle" height="100" width="1426" color="#262626">
<Label id="name" font="font:LargeBoldSystemFont" height="100" width="1426" vertAlign="bottom" />
</Rectangle>
</LayoutGroup>
<ButtonGroupHoriz id="buttons" >
<Button id="favorite-button" text="Favorite" iconUri="" focusedIconUri="" />
</ButtonGroupHoriz>
</LayoutGroup>
<LayoutGroup id="personInfoGroup"
layoutDirection="horiz" itemSpacings="[36]">
layoutDirection="horiz" itemSpacings="[46]">
<Poster id="personImage"
width="300" height="450" />
width="430" height="645" />
<LayoutGroup id="vertSpacer" layoutDirection="vert" itemSpacings="[24]">
<LayoutGroup id="dataGroup>" layoutDirection="vert"
translation="[450,180]">
<Label id="name" font="font:MediumBoldSystemFont" height="45" width="1200" />
<label id="premierDate" font="font:SmallestBoldSystemFont" height="48" vertAlign="top" />
<Rectangle id="dscrBorder"
height="360" width="1422"
color="0x202020ff">
<Rectangle id='dscrRect' translation="[3, 3]"
height="354" width="1416"
color="0x202020ff">
<LayoutGroup id="dataGroup>" layoutDirection="vert" translation="[450,180]">
<Rectangle id="dscrBorder" height="645" width="1322" color="0x202020ff" visible="true">
<Rectangle id='dscrRect' translation="[3, 3]" height="639" width="1316" color="0x202020ff">
<Label id="description"
height="342" width="1380" wrap="true" translation="[18, 15]"
height="627" width="1280" wrap="true" translation="[18, 15]"
font="font:SmallestSystemFont" color="#e4e4e4ff" ellipsisText=" ... (-OK- for More)" />
</Rectangle>
</Rectangle>
</LayoutGroup>
<ButtonGroupHoriz id="buttons" >
<Button id="favorite-button" text="Favorite"
iconUri="" focusedIconUri="" />
</ButtonGroupHoriz>
</LayoutGroup>
</LayoutGroup>
</LayoutGroup>

View File

@ -59,7 +59,6 @@ sub onAdditionalPartsLoaded()
else
m.top.rowItemSize = [[234, 396]]
end if
m.top.translation = "[75,10]"
' Load Cast and Crew and everything else...
m.LoadPeopleTask.peopleList = m.people

View File

@ -9,7 +9,7 @@
showRowLabel="true"
showRowCounter="true"
visible="true"
translation="[12,18]"
translation="[75,10]"
itemComponentName="ExtrasItem" />
<Animation id="pplAnime" duration=".4" repeat="false" >
<Vector2DFieldInterpolator

View File

@ -1021,6 +1021,10 @@
<source>If enabled, the star and community rating for episodes of a TV show will be removed. This is to prevent spoilers of an upcoming good/bad episode.</source>
<translation>If enabled, the star and community rating for episodes of a TV show will be removed. This is to prevent spoilers of an upcoming good/bad episode.</translation>
</message>
<message>
<source>Biographical information for this person is not currently available.</source>
<translation>Biographical information for this person is not currently available.</translation>
</message>
<message>
<source>Playback Bitrate Limits</source>
<translation>Playback Bitrate Limits</translation>