from kivy.app import App
from kivy.properties import BooleanProperty, StringProperty

# The following lines ensure that FirstScreen and SecondScreen are available for when the Kv code is loaded.

# Because neither PyCharm nor PyLint are aware of the associated Kv, we must disable their warnings about these widgets
# not being used.

# noinspection PyUnresolvedReferences
from first_screen import FirstScreen  # pylint: disable=unused-import
# noinspection PyUnresolvedReferences
from second_screen import SecondScreen  # pylint: disable=unused-import


class TwoScreenApp(App):
    advancing = BooleanProperty(True)
    current_screen_name = StringProperty()  # We must wait to select a screen until the app starts.

    def open_first_screen(self):
        self.advancing = True
        self.current_screen_name = 'first'

    def open_second_screen(self):
        self.advancing = False
        self.current_screen_name = 'second'

    def on_start(self):
        self.open_first_screen()  # Once the app starts, we can select the starting screen.


if __name__ == '__main__':
    app = TwoScreenApp()
    app.run()