|
|
@ -17,19 +17,19 @@ local function updateMargins(tabBar, ignored)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local function updateNavigation(tabBar)
|
|
|
|
local function updateNavigation(tabBar)
|
|
|
|
if prevNavigation then
|
|
|
|
if tabBar.prevNavigation then
|
|
|
|
if #tabBar.preTabs > 0 or table.find(tabBar.tabs, tabBar.currentTab) ~= 1 then
|
|
|
|
if #tabBar.preTabs > 0 or table.find(tabBar.tabs, tabBar.currentTab) ~= 1 then
|
|
|
|
prevNavigation:enable()
|
|
|
|
tabBar.prevNavigation:enable()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
prevNavigation:disable()
|
|
|
|
tabBar.prevNavigation:disable()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if nextNavigation then
|
|
|
|
if tabBar.nextNavigation then
|
|
|
|
if #tabBar.postTabs > 0 or table.find(tabBar.tabs, tabBar.currentTab) ~= #tabBar.tabs then
|
|
|
|
if #tabBar.postTabs > 0 or table.find(tabBar.tabs, tabBar.currentTab) ~= #tabBar.tabs then
|
|
|
|
nextNavigation:enable()
|
|
|
|
tabBar.nextNavigation:enable()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
nextNavigation:disable()
|
|
|
|
tabBar.nextNavigation:disable()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -218,6 +218,19 @@ function UIMoveableTabBar.create()
|
|
|
|
return tabbar
|
|
|
|
return tabbar
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function UIMoveableTabBar:onDestroy()
|
|
|
|
|
|
|
|
if self.prevNavigation then
|
|
|
|
|
|
|
|
self.prevNavigation:disable()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self.nextNavigation then
|
|
|
|
|
|
|
|
self.nextNavigation:disable()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.nextNavigation = nil
|
|
|
|
|
|
|
|
self.prevNavigation = nil
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function UIMoveableTabBar:setContentWidget(widget)
|
|
|
|
function UIMoveableTabBar:setContentWidget(widget)
|
|
|
|
self.contentWidget = widget
|
|
|
|
self.contentWidget = widget
|
|
|
|
if #self.tabs > 0 then
|
|
|
|
if #self.tabs > 0 then
|
|
|
@ -467,14 +480,14 @@ function UIMoveableTabBar:getCurrentTab()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function UIMoveableTabBar:setNavigation(prevButton, nextButton)
|
|
|
|
function UIMoveableTabBar:setNavigation(prevButton, nextButton)
|
|
|
|
prevNavigation = prevButton
|
|
|
|
self.prevNavigation = prevButton
|
|
|
|
nextNavigation = nextButton
|
|
|
|
self.nextNavigation = nextButton
|
|
|
|
|
|
|
|
|
|
|
|
if prevNavigation then
|
|
|
|
if self.prevNavigation then
|
|
|
|
prevNavigation.onClick = function() self:selectPrevTab() end
|
|
|
|
self.prevNavigation.onClick = function() self:selectPrevTab() end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if nextNavigation then
|
|
|
|
if self.nextNavigation then
|
|
|
|
nextNavigation.onClick = function() self:selectNextTab() end
|
|
|
|
self.nextNavigation.onClick = function() self:selectNextTab() end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
updateNavigation(self)
|
|
|
|
updateNavigation(self)
|
|
|
|
end
|
|
|
|
end
|
|
|
|