def screen_manager_current(self, current, direction=None, history=True):
screens = {
'overview': OverviewScreen,
'switch_account': SwitchAccountScreen,
'manage_keystores': ManageKeystoreScreen,
'flashqrcode': FlashQrCodeScreen,
'about': AboutScreen,
}
screen_manager = self.screen_manager
# creates the Screen object if it doesn't exist
if not screen_manager.has_screen(current):
screen = screens[current](name=current)
screen_manager.add_widget(screen)
if direction is not None:
screen_manager.transition.direction = direction
screen_manager.current = current
if history:
# do not update history if it's the same screen because we do not
# want the go back button to behave like it was doing nothing
if not self.screen_history or self.screen_history[-1] != current:
self.screen_history.append(current)
# in this case let's reset since the overview is the root screen
# because we never want the back button to bring us from overview
# to another screen
if current == 'overview':
self.screen_history = []
评论列表
文章目录