diff --git a/components/ItemGrid/Alpha.bs b/components/ItemGrid/Alpha.bs
index 26b686808..d64753e6c 100644
--- a/components/ItemGrid/Alpha.bs
+++ b/components/ItemGrid/Alpha.bs
@@ -1,40 +1,39 @@
sub init()
- m.top.visible = true
- m.Alphamenu = m.top.findNode("Alphamenu")
- m.Alphamenu.focusable = true
- m.Alphatext = m.top.findNode("alphatext")
- m.focusedChild = m.top.findNode("focusedChild")
- m.Alphamenu.focusedFont.size = 25
- m.Alphamenu.font.size = 25
+ m.top.setFocus(false)
+
+ m.alphaText = m.top.findNode("alphaText")
+ m.alphaMenu = m.top.findNode("alphaMenu")
+ m.alphaMenu.setFocus(false)
+ m.alphaMenu.focusedFont.size = 25
+ m.alphaMenu.font.size = 25
+
+ ' show mic icon above alpha menu if remote supports voice commands
+ if m.global.device.hasVoiceRemote
+ alphaMic = m.top.findNode("alphaMic")
+ alphaMic.visible = true
+ end if
end sub
function onKeyEvent(key as string, press as boolean) as boolean
-
if not press then return false
+ if not m.alphaMenu.isInFocusChain() then return false
if key = "OK"
- child = m.Alphatext.getChild(m.Alphamenu.itemFocused)
-
- if child.title = m.top.itemAlphaSelected
- m.top.itemAlphaSelected = ""
- m.Alphamenu.focusFootprintBitmapUri = ""
- else
- m.Alphamenu.focusFootprintBitmapUri = "pkg:/images/white.png"
- m.top.itemAlphaSelected = child.title
- end if
+ child = m.alphaText.getChild(m.alphaMenu.itemFocused)
+ m.top.letterSelected = child.title
return true
end if
if key = "up"
- if m.Alphamenu.itemFocused = 0
- m.Alphamenu.jumpToItem = m.Alphamenu.numRows - 1
+ if m.alphaMenu.itemFocused = 0
+ m.alphaMenu.jumpToItem = m.alphaMenu.numRows - 1
return true
end if
end if
if key = "down"
- if m.Alphamenu.itemFocused = m.Alphamenu.numRows - 1
- m.Alphamenu.jumpToItem = 0
+ if m.alphaMenu.itemFocused = m.alphaMenu.numRows - 1
+ m.alphaMenu.jumpToItem = 0
return true
end if
end if
diff --git a/components/ItemGrid/Alpha.xml b/components/ItemGrid/Alpha.xml
index 8525180dc..89e7294e4 100644
--- a/components/ItemGrid/Alpha.xml
+++ b/components/ItemGrid/Alpha.xml
@@ -1,21 +1,23 @@
+
-
-
-
+
\ No newline at end of file
diff --git a/components/ItemGrid/ItemGrid.bs b/components/ItemGrid/ItemGrid.bs
index c23bc962b..ba9c6fcd8 100644
--- a/components/ItemGrid/ItemGrid.bs
+++ b/components/ItemGrid/ItemGrid.bs
@@ -36,7 +36,6 @@ sub init()
m.itemGrid.observeField("itemFocused", "onItemFocused")
m.itemGrid.observeField("itemSelected", "onItemSelected")
- m.itemGrid.observeField("alphaSelected", "onItemalphaSelected")
'Voice filter setup
m.voiceBox = m.top.findNode("voiceBox")
@@ -67,19 +66,11 @@ sub init()
m.spinner = m.top.findNode("spinner")
m.spinner.visible = true
- m.Alpha = m.top.findNode("AlphaMenu")
- m.AlphaSelected = m.top.findNode("AlphaSelected")
+ m.alpha = m.top.findNode("alpha")
+ m.alphaSelected = m.top.findNode("alphaSelected")
'Get reset folder setting
m.resetGrid = m.global.session.user.settings["itemgrid.reset"]
-
- m.micButton = m.top.findNode("micButton")
- m.micButtonText = m.top.findNode("micButtonText")
- 'Hide voice search if device does not have voice remote
- if m.global.device.hasVoiceRemote = false
- m.micButton.visible = false
- m.micButtonText.visible = false
- end if
end sub
'
@@ -106,13 +97,22 @@ sub loadInitialItems()
if m.top.parentItem.collectionType = "livetv"
' Translate between app and server nomenclature
viewSetting = m.global.session.user.settings["display.livetv.landing"]
- 'Move mic to be visiable on TV Guide screen
- if m.global.device.hasVoiceRemote = true
- m.micButton.translation = "[1540, 92]"
- m.micButtonText.visible = true
- m.micButtonText.translation = "[1600,130]"
- m.micButtonText.font.size = 22
- m.micButtonText.text = tr("Search")
+ ' Show mic icon and text on TV Guide screen
+ if m.global.device.hasVoiceRemote
+ micIcon = CreateObject("roSGNode", "Poster")
+ micIcon.id = "micIcon"
+ micIcon.uri = "pkg:/images/icons/mic_icon.png"
+ micIcon.translation = "[1578, 130]"
+
+ micIconText = CreateObject("roSGNode", "Label")
+ micIconText.id = "micIconText"
+ micIconText.font = "font:SmallSystemFont"
+ micIconText.translation = "[1600,130]"
+ micIconText.font.size = 22
+ micIconText.text = tr("Search")
+
+ m.top.appendChild(micIcon)
+ m.top.appendChild(micIconText)
end if
if viewSetting = "guide"
m.view = "tvGuide"
@@ -166,9 +166,15 @@ sub loadInitialItems()
else
m.loadItemsTask.itemId = m.top.parentItem.Id
end if
+
+ ' if we already searched for this alpha text than reset filter
+ if m.loadItemsTask.nameStartsWith = m.top.alphaSelected
+ m.loadItemsTask.nameStartsWith = ""
+ else
+ m.loadItemsTask.nameStartsWith = m.alpha.letterSelected
+ end if
updateTitle()
- m.loadItemsTask.nameStartsWith = m.top.alphaSelected
m.loadItemsTask.searchTerm = m.voiceBox.text
m.emptyText.visible = false
m.loadItemsTask.sortField = m.sortField
@@ -446,7 +452,6 @@ sub SetUpOptions()
m.options.options = options
end sub
-
'
'Handle loaded data, and add to Grid
sub ItemDataLoaded(msg)
@@ -483,8 +488,14 @@ sub ItemDataLoaded(msg)
m.data.appendChild(item)
end for
- m.itemGrid.opacity = "1"
- m.genreList.opacity = "0"
+ ' keep focus on alpha menu when loading new data
+ if not m.alpha.isinFocusChain()
+ m.itemGrid.opacity = "1"
+ m.genreList.opacity = "0"
+
+ m.itemGrid.setFocus(true)
+ m.genreList.setFocus(false)
+ end if
'Update the stored counts
m.loadedItems = m.itemGrid.content.getChildCount()
@@ -496,8 +507,6 @@ sub ItemDataLoaded(msg)
m.emptyText.visible = true
end if
- m.itemGrid.setFocus(true)
- m.genreList.setFocus(false)
m.spinner.visible = false
end sub
@@ -585,7 +594,7 @@ sub onItemSelected()
m.top.selectedItem = m.itemGrid.content.getChild(m.itemGrid.itemSelected)
end sub
-sub onItemalphaSelected()
+sub alphaSelectedChanged()
if m.top.alphaSelected <> ""
m.loadedRows = 0
m.loadedItems = 0
@@ -593,8 +602,8 @@ sub onItemalphaSelected()
m.itemGrid.content = m.data
m.loadItemsTask.searchTerm = ""
m.VoiceBox.text = ""
- m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected
m.spinner.visible = true
+
loadInitialItems()
end if
end sub
@@ -826,14 +835,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
else if key = "left" and topGrp.isinFocusChain()
m.top.alphaActive = true
topGrp.setFocus(false)
- alpha = m.alpha.getChild(0).findNode("Alphamenu")
+ alpha = m.alpha.getChild(0).findNode("alphaMenu")
alpha.setFocus(true)
return true
- else if key = "right" and m.Alpha.isinFocusChain()
+ else if key = "right" and m.alpha.isinFocusChain()
m.top.alphaActive = false
- m.Alpha.setFocus(false)
- m.Alpha.visible = true
+ m.alpha.setFocus(false)
topGrp.setFocus(true)
return true
else if key = "replay" and topGrp.isinFocusChain()
@@ -872,7 +880,7 @@ sub updateTitle()
m.top.overhangTitle = m.top.parentItem.title + tr(" (Filtered by ") + m.loadItemsTask.searchTerm + ")"
end if
- if m.top.alphaSelected <> ""
+ if m.loadItemsTask.nameStartsWith <> ""
m.top.overhangTitle = m.top.parentItem.title + tr(" (Filtered by ") + m.loadItemsTask.nameStartsWith + ")"
end if
diff --git a/components/ItemGrid/ItemGrid.xml b/components/ItemGrid/ItemGrid.xml
index 3c5d2c797..dc39a50aa 100644
--- a/components/ItemGrid/ItemGrid.xml
+++ b/components/ItemGrid/ItemGrid.xml
@@ -17,9 +17,7 @@
drawFocusFeedback="false" />
-
-
-
+
@@ -27,7 +25,7 @@
-
+
@@ -35,7 +33,7 @@
-
+
diff --git a/components/ItemGrid/MovieLibraryView.bs b/components/ItemGrid/MovieLibraryView.bs
index 1c7c498cb..02d61c378 100644
--- a/components/ItemGrid/MovieLibraryView.bs
+++ b/components/ItemGrid/MovieLibraryView.bs
@@ -18,10 +18,8 @@ sub setupNodes()
m.movieLogo = m.top.findNode("movieLogo")
m.swapAnimation = m.top.findNode("backroundSwapAnimation")
m.spinner = m.top.findNode("spinner")
- m.Alpha = m.top.findNode("AlphaMenu")
- m.AlphaSelected = m.top.findNode("AlphaSelected")
- m.micButton = m.top.findNode("micButton")
- m.micButtonText = m.top.findNode("micButtonText")
+ m.alpha = m.top.findNode("alpha")
+ m.alphaSelected = m.top.findNode("alphaSelected")
m.communityRatingGroup = m.top.findNode("communityRatingGroup")
m.criticRatingIcon = m.top.findNode("criticRatingIcon")
m.criticRatingGroup = m.top.findNode("criticRatingGroup")
@@ -53,7 +51,6 @@ sub init()
m.itemGrid.observeField("itemFocused", "onItemFocused")
m.itemGrid.observeField("itemSelected", "onItemSelected")
- m.itemGrid.observeField("alphaSelected", "onItemalphaSelected")
'Voice filter setup
m.voiceBox.voiceEnabled = true
@@ -87,12 +84,6 @@ sub init()
'Get reset folder setting
m.resetGrid = m.global.session.user.settings["itemgrid.reset"]
-
- 'Hide voice search if device does not have voice remote
- if m.global.device.hasVoiceRemote = false
- m.micButton.visible = false
- m.micButtonText.visible = false
- end if
end sub
sub OnScreenHidden()
@@ -163,7 +154,12 @@ sub loadInitialItems()
m.loadItemsTask.itemId = m.top.parentItem.Id
end if
- m.loadItemsTask.nameStartsWith = m.top.alphaSelected
+ ' if we already searched for this alpha text than reset filter
+ if m.loadItemsTask.nameStartsWith = m.top.alphaSelected
+ m.loadItemsTask.nameStartsWith = ""
+ else
+ m.loadItemsTask.nameStartsWith = m.alpha.letterSelected
+ end if
m.loadItemsTask.searchTerm = m.voiceBox.text
m.emptyText.visible = false
m.loadItemsTask.sortField = m.sortField
@@ -444,11 +440,14 @@ sub ItemDataLoaded(msg)
return
end if
- m.itemGrid.opacity = "1"
- m.genreList.opacity = "0"
+ ' keep focus on alpha menu when loading new data
+ if not m.alpha.isinFocusChain()
+ m.itemGrid.opacity = "1"
+ m.genreList.opacity = "0"
- m.itemGrid.setFocus(true)
- m.genreList.setFocus(false)
+ m.itemGrid.setFocus(true)
+ m.genreList.setFocus(false)
+ end if
if m.data.getChildCount() = 0
m.itemGrid.jumpToItem = 0
@@ -722,7 +721,7 @@ sub onGenreItemSelected()
m.top.selectedItem = m.genreList.content.getChild(m.genreList.rowItemSelected[0]).getChild(m.genreList.rowItemSelected[1])
end sub
-sub onItemalphaSelected()
+sub alphaSelectedChanged()
if m.top.alphaSelected <> ""
m.loadedRows = 0
m.loadedItems = 0
@@ -735,7 +734,6 @@ sub onItemalphaSelected()
m.loadItemsTask.searchTerm = ""
m.VoiceBox.text = ""
- m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected
m.spinner.visible = true
loadInitialItems()
end if
@@ -886,21 +884,20 @@ function onKeyEvent(key as string, press as boolean) as boolean
if m.itemGrid.isinFocusChain()
m.top.alphaActive = true
m.itemGrid.setFocus(false)
- alpha = m.alpha.getChild(0).findNode("Alphamenu")
+ alpha = m.alpha.getChild(0).findNode("alphaMenu")
alpha.setFocus(true)
return true
else if m.genreList.isinFocusChain()
m.top.alphaActive = true
m.genreList.setFocus(false)
- alpha = m.alpha.getChild(0).findNode("Alphamenu")
+ alpha = m.alpha.getChild(0).findNode("alphaMenu")
alpha.setFocus(true)
return true
end if
- else if key = "right" and m.Alpha.isinFocusChain()
+ else if key = "right" and m.alpha.isinFocusChain()
m.top.alphaActive = false
- m.Alpha.setFocus(false)
- m.Alpha.visible = true
+ m.alpha.setFocus(false)
m.itemGrid.setFocus(m.itemGrid.opacity = 1)
m.genreList.setFocus(m.genreList.opacity = 1)
diff --git a/components/ItemGrid/MovieLibraryView.xml b/components/ItemGrid/MovieLibraryView.xml
index 3200ae277..a1606ef67 100644
--- a/components/ItemGrid/MovieLibraryView.xml
+++ b/components/ItemGrid/MovieLibraryView.xml
@@ -35,8 +35,6 @@
-
-
@@ -44,7 +42,7 @@
-
+
@@ -52,7 +50,7 @@
-
+
diff --git a/components/ItemGrid/MusicLibraryView.bs b/components/ItemGrid/MusicLibraryView.bs
index 1f7d27ee7..6ecd33bd0 100644
--- a/components/ItemGrid/MusicLibraryView.bs
+++ b/components/ItemGrid/MusicLibraryView.bs
@@ -18,10 +18,8 @@ sub setupNodes()
m.artistLogo = m.top.findNode("artistLogo")
m.swapAnimation = m.top.findNode("backroundSwapAnimation")
m.spinner = m.top.findNode("spinner")
- m.Alpha = m.top.findNode("AlphaMenu")
- m.AlphaSelected = m.top.findNode("AlphaSelected")
- m.micButton = m.top.findNode("micButton")
- m.micButtonText = m.top.findNode("micButtonText")
+ m.alpha = m.top.findNode("alpha")
+ m.alphaSelected = m.top.findNode("alphaSelected")
m.overhang = m.top.getScene().findNode("overhang")
m.genreList = m.top.findNode("genrelist")
end sub
@@ -49,7 +47,6 @@ sub init()
m.itemGrid.observeField("itemFocused", "onItemFocused")
m.itemGrid.observeField("itemSelected", "onItemSelected")
- m.itemGrid.observeField("alphaSelected", "onItemalphaSelected")
'Voice filter setup
m.voiceBox.voiceEnabled = true
@@ -81,12 +78,6 @@ sub init()
'Get reset folder setting
m.resetGrid = m.global.session.user.settings["itemgrid.reset"]
-
- 'Hide voice search if device does not have voice remote
- if m.global.device.hasVoiceRemote = false
- m.micButton.visible = false
- m.micButtonText.visible = false
- end if
end sub
sub OnScreenHidden()
@@ -155,7 +146,12 @@ sub loadInitialItems()
m.loadItemsTask.itemId = m.top.parentItem.Id
end if
- m.loadItemsTask.nameStartsWith = m.top.alphaSelected
+ ' if we already searched for this alpha text than reset filter
+ if m.loadItemsTask.nameStartsWith = m.top.alphaSelected
+ m.loadItemsTask.nameStartsWith = ""
+ else
+ m.loadItemsTask.nameStartsWith = m.alpha.letterSelected
+ end if
m.loadItemsTask.searchTerm = m.voiceBox.text
m.emptyText.visible = false
m.loadItemsTask.sortField = m.sortField
@@ -355,11 +351,14 @@ sub ItemDataLoaded(msg)
return
end if
- m.itemGrid.opacity = "1"
- m.genreList.opacity = "0"
+ ' keep focus on alpha menu when loading new data
+ if not m.alpha.isinFocusChain()
+ m.itemGrid.opacity = "1"
+ m.genreList.opacity = "0"
- m.itemGrid.setFocus(true)
- m.genreList.setFocus(false)
+ m.itemGrid.setFocus(true)
+ m.genreList.setFocus(false)
+ end if
for each item in itemData
m.data.appendChild(item)
@@ -598,7 +597,7 @@ sub onGenreItemFocused()
end if
end sub
-sub onItemalphaSelected()
+sub alphaSelectedChanged()
if m.top.alphaSelected <> ""
m.loadedRows = 0
m.loadedItems = 0
@@ -611,7 +610,6 @@ sub onItemalphaSelected()
m.loadItemsTask.searchTerm = ""
m.VoiceBox.text = ""
- m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected
m.spinner.visible = true
loadInitialItems()
end if
@@ -746,20 +744,20 @@ function onKeyEvent(key as string, press as boolean) as boolean
if m.itemGrid.isinFocusChain()
m.top.alphaActive = true
m.itemGrid.setFocus(false)
- alpha = m.alpha.getChild(0).findNode("Alphamenu")
+ alpha = m.alpha.getChild(0).findNode("alphaMenu")
alpha.setFocus(true)
return true
else if m.genreList.isinFocusChain()
m.top.alphaActive = true
m.genreList.setFocus(false)
- alpha = m.alpha.getChild(0).findNode("Alphamenu")
+ alpha = m.alpha.getChild(0).findNode("alphaMenu")
alpha.setFocus(true)
return true
end if
- else if key = "right" and m.Alpha.isinFocusChain()
+ else if key = "right" and m.alpha.isinFocusChain()
m.top.alphaActive = false
- m.Alpha.setFocus(false)
- m.Alpha.visible = true
+ m.alpha.setFocus(false)
+ m.alpha.visible = true
m.itemGrid.setFocus(m.itemGrid.opacity = 1)
m.genreList.setFocus(m.genreList.opacity = 1)
diff --git a/components/ItemGrid/MusicLibraryView.xml b/components/ItemGrid/MusicLibraryView.xml
index 645ea4a98..01ccc2481 100644
--- a/components/ItemGrid/MusicLibraryView.xml
+++ b/components/ItemGrid/MusicLibraryView.xml
@@ -20,8 +20,6 @@
-
-
@@ -29,7 +27,7 @@
-
+
@@ -37,7 +35,7 @@
-
+