-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature flag * Move view * Service selection UI * tweak * tweak
- Loading branch information
Showing
19 changed files
with
250 additions
and
19 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
playlet-lib/src/components/ContentNode/BackendTypeContentNode.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<component name="BackendTypeContentNode" extends="ContentNode"> | ||
<interface> | ||
<field id="backendLogoUri" type="uri" /> | ||
</interface> | ||
</component> |
9 changes: 9 additions & 0 deletions
9
...b/src/components/Screens/ProfileScreen/BackendTypeSelectionView/BackendTypeRowListCell.bs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function OnContentSet() as void | ||
content = m.top.itemContent | ||
if content = invalid | ||
return | ||
end if | ||
|
||
m.top.backendName = content.title | ||
m.top.backendLogoUri = content.backendLogoUri | ||
end function |
24 changes: 24 additions & 0 deletions
24
.../src/components/Screens/ProfileScreen/BackendTypeSelectionView/BackendTypeRowListCell.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<component name="BackendTypeRowListCell" extends="Group"> | ||
<interface> | ||
<field id="itemContent" type="node" onChange="OnContentSet" /> | ||
<field id="backendName" type="string" alias="BackendNameLabel.text" /> | ||
<field id="backendLogoUri" type="uri" alias="BackendLogoPoster.uri" /> | ||
</interface> | ||
|
||
<children> | ||
<Group translation="[20,20]"> | ||
<Poster | ||
id="BackendLogoPoster" | ||
width="160" | ||
height="160" | ||
translation="[20,20]"> | ||
</Poster> | ||
<Label | ||
id="BackendNameLabel" | ||
width="200" | ||
horizAlign="center" | ||
translation="[0,240]"> | ||
</Label> | ||
</Group> | ||
</children> | ||
</component> |
57 changes: 57 additions & 0 deletions
57
...src/components/Screens/ProfileScreen/BackendTypeSelectionView/BackendTypeSelectionView.bs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import "pkg:/components/Navigation/Navigation.bs" | ||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs" | ||
import "pkg:/source/utils/FocusManagement.bs" | ||
import "pkg:/source/utils/Logging.bs" | ||
import "pkg:/source/utils/RemoteKeys.bs" | ||
import "pkg:/source/utils/Types.bs" | ||
|
||
function Init() | ||
m.rowList = m.top.FindNode("BackendRowList") | ||
m.rowList.ObserveField("rowItemSelected", FuncName(OnRowItemSelected)) | ||
end function | ||
|
||
function OnFocusChange() as void | ||
if not m.top.focus | ||
return | ||
end if | ||
|
||
NodeSetFocus(m.rowList, true) | ||
end function | ||
|
||
function OnKeyEvent(key as string, press as boolean) as boolean | ||
if key = RemoteKeys.Options or key = RemoteKeys.Play or key = RemoteKeys.Pause or key = RemoteKeys.PlayOnly | ||
' A pass-through to the app controller, so it can toggle picture-in-picture and pause/play | ||
return false | ||
end if | ||
|
||
if key = RemoteKeys.Back and press | ||
Close() | ||
return true | ||
end if | ||
|
||
return true | ||
end function | ||
|
||
function Close() | ||
m.top.appController@.PopScreen() | ||
end function | ||
|
||
function OnRowItemSelected(event as object) as void | ||
index = event.GetData() | ||
if index = invalid or index.count() <> 2 | ||
LogWarn("Invalid index:", index) | ||
return | ||
end if | ||
|
||
Close() | ||
|
||
content = m.rowList.content | ||
|
||
rowIndex = index[0] | ||
rowItemIndex = index[1] | ||
|
||
row = content.GetChild(rowIndex) | ||
rowItem = row.GetChild(rowItemIndex) | ||
|
||
m.top.selectedBackendType = rowItem.id | ||
end function |
46 changes: 46 additions & 0 deletions
46
...rc/components/Screens/ProfileScreen/BackendTypeSelectionView/BackendTypeSelectionView.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<component name="BackendTypeSelectionView" extends="Group" includes="AutoBind,Focus"> | ||
<interface> | ||
<field id="selectedBackendType" type="string" /> | ||
<field id="appController" type="node" bind="/AppController" /> | ||
</interface> | ||
<children> | ||
<Rectangle | ||
width="1280" | ||
height="720" | ||
color="#000000" | ||
opacity="0.5"> | ||
</Rectangle> | ||
|
||
<Rectangle | ||
width="720" | ||
height="420" | ||
translation="[280,150]" | ||
color="#242424"> | ||
<Label | ||
width="720" | ||
horizAlign="center" | ||
translation="[0,38]" | ||
text="Select a service to login"> | ||
<Font role="font" uri="font:SystemFontFile" size="24" /> | ||
</Label> | ||
|
||
<RowList | ||
id="BackendRowList" | ||
translation="[120,100]" | ||
numRows="2" | ||
rowitemSize="[[240,240]]" | ||
rowItemSpacing="[[0,0]]" | ||
itemSize="[500,500]" | ||
itemComponentName="BackendTypeRowListCell" | ||
rowFocusAnimationStyle="floatingfocus" | ||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png"> | ||
<ContentNode role="content"> | ||
<ContentNode> | ||
<BackendTypeContentNode id="BackendTypeYouTube" title="YouTube" backendLogoUri="pkg:/images/youtube-logo.png" /> | ||
<BackendTypeContentNode id="BackendTypeInvidious" title="Invidious" backendLogoUri="pkg:/images/invidious-logo.png" /> | ||
</ContentNode> | ||
</ContentNode> | ||
</RowList> | ||
</Rectangle> | ||
</children> | ||
</component> |
11 changes: 11 additions & 0 deletions
11
...omponents/Screens/ProfileScreen/BackendTypeSelectionView/BackendTypeSelectionViewUtils.bs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace BackendTypeSelectionViewUtils | ||
|
||
function Open(appController as object) as object | ||
backendTypeSelectionView = CreateObject("roSGNode", "BackendTypeSelectionView") | ||
|
||
appController@.PushScreen(backendTypeSelectionView) | ||
backendTypeSelectionView@.BindNode() | ||
return backendTypeSelectionView | ||
end function | ||
|
||
end namespace |
2 changes: 0 additions & 2 deletions
2
playlet-lib/src/components/Screens/ProfileScreen/ProfileRowList/ProfileRowList.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
inputHash: '339be7a03116276ba83ce7b1bb905e40', | ||
outputs: [ | ||
{ | ||
outputFilePath: 'images/invidious-logo.png', | ||
outputHash: '31fcb0fb5d7506ba6e742a31497ca052', | ||
width: 256, | ||
height: 256, | ||
}, | ||
], | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
inputHash: '38d7d7e95f79456ccb7a29aef004dd73', | ||
outputs: [ | ||
{ | ||
outputFilePath: 'images/youtube-logo.png', | ||
outputHash: 'a015e471b97c7ffbbd012b4c9b9e0624', | ||
width: 256, | ||
height: 256, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ hidden=1 | |
|
||
git_commit_sha=unknown | ||
|
||
bs_const=DEBUG=false | ||
bs_const=DEBUG=false;YT_OAUTH_SUPPORT=false |