Merge pull request #1446 from cewert/import-npm-bgv

Copy ButtonGroupVert code into app instead of using NPM package
This commit is contained in:
1hitsong 2023-10-31 19:47:28 -04:00 committed by GitHub
commit bd94f9ccd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 10 deletions

View File

@ -0,0 +1,44 @@
sub init()
m.top.layoutDirection = "vert"
m.top.observeField("focusedChild", "onFocusChanged")
m.top.observeField("focusButton", "onFocusButtonChanged")
end sub
sub onFocusChanged()
if m.top.hasFocus()
m.top.getChild(0).setFocus(true)
m.top.focusButton = 0
end if
end sub
sub onFocusButtonChanged()
m.top.getChild(m.top.focusButton).setFocus(true)
end sub
function onKeyEvent(key as string, press as boolean) as boolean
if key = "OK"
m.top.selected = m.top.focusButton
return true
end if
if not press then return false
if key = "down"
i = m.top.focusButton
target = i + 1
if target >= m.top.getChildCount() then return false
m.top.focusButton = target
return true
else if key = "up"
i = m.top.focusButton
target = i - 1
if target < 0 then return false
m.top.focusButton = target
return true
else if key = "left" or key = "right"
m.top.escape = key
return true
end if
return false
end function

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="ButtonGroupVert" extends="ButtonGroup">
<interface>
<field id="escape" type="string" alwaysNotify="true" />
<field id="selected" type="integer" alwaysNotify="true" />
</interface>
</component>

View File

@ -33,11 +33,11 @@
</SectionScroller>
<bgv_ButtonGroupVert id="sectionNavigation" translation="[-100, 175]" itemSpacings="[10]">
<ButtonGroupVert id="sectionNavigation" translation="[-100, 175]" itemSpacings="[10]">
<sob_SlideOutButton background="#070707" focusBackground="#00a4dc" highlightBackground="#555555" padding="20" icon="pkg:/images/icons/details.png" text="Details" height="50" width="60" />
<sob_SlideOutButton id="albumsLink" background="#070707" focusBackground="#00a4dc" highlightBackground="#555555" padding="20" icon="pkg:/images/icons/cd.png" text="Albums" height="50" width="60" />
<sob_SlideOutButton id="appearsOnLink" background="#070707" focusBackground="#00a4dc" highlightBackground="#555555" padding="20" icon="pkg:/images/icons/cassette.png" text="Appears On" height="50" width="60" />
</bgv_ButtonGroupVert>
</ButtonGroupVert>
<Animation id="pageLoad" duration="1" repeat="false">
<Vector2DFieldInterpolator key="[0.5, 1.0]" keyValue="[[-100, 175], [40, 175]]" fieldToInterp="sectionNavigation.translation" />

7
package-lock.json generated
View File

@ -11,7 +11,6 @@
"license": "GPL-2.0",
"dependencies": {
"@rokucommunity/bslib": "0.1.1",
"bgv": "npm:button-group-vert@1.0.2",
"brighterscript-formatter": "1.6.34",
"intKeyboard": "npm:integer-keyboard@1.0.12",
"log": "npm:roku-log@0.11.1",
@ -638,12 +637,6 @@
"tweetnacl": "^0.14.3"
}
},
"node_modules/bgv": {
"name": "button-group-vert",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/button-group-vert/-/button-group-vert-1.0.2.tgz",
"integrity": "sha512-pfrUYI/aFubtjhA8I08qNCtDluyIScksldR15icR7Pj24tNELYCYXE7M0jaU7xgdiFAhZJcYuB3aCXzyI1CoMw=="
},
"node_modules/binary-extensions": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",

View File

@ -4,7 +4,6 @@
"description": "Roku app for Jellyfin media server",
"dependencies": {
"@rokucommunity/bslib": "0.1.1",
"bgv": "npm:button-group-vert@1.0.2",
"brighterscript-formatter": "1.6.34",
"intKeyboard": "npm:integer-keyboard@1.0.12",
"log": "npm:roku-log@0.11.1",