Beispiel #1
0
 def on_start(self):
     # on ios we have to change the status bar color right when we are up.
     if platform == 'ios':
         from pyobjus import autoclass, objc_str
         ObjcClass = autoclass('ObjcClassINSD')
         o_instance = ObjcClass.alloc().init()
         o_instance.lightStatusBar()
     print('App started')
     from modules.core.android_utils import RemoveTutorialScreen
     RemoveTutorialScreen()
     from modules.core.android_utils import Toast
     Toast('logging in...', True)
     from utilities.notification import stopNotificationService, getLastNotificationMessage
     stopNotificationService()
     # make sure that if we started from a notification we act accordingly.
     keys = getLastNotificationMessage()
     if keys:
         from kivy.clock import Clock
         def switchscreens(*largs):
             from api.streams.posts import Manager as PostsManager
             if not PostsManager.logged_in:
                 Clock.schedule_once(switchscreens, 0.125)
                 return
             if len(keys) == 1:
                 s = self.root.manager.get_screen('favs')
                 s.fake_click_for_item = keys[0]
             self.root.manager.current = 'favs'
         Clock.schedule_once(switchscreens, 0.125)
Beispiel #2
0
    def on_start(self):
        # on ios we have to change the status bar color right when we are up.
        if platform == 'ios':
            from pyobjus import autoclass, objc_str
            ObjcClass = autoclass('ObjcClassINSD')
            o_instance = ObjcClass.alloc().init()
            o_instance.lightStatusBar()
        print('App started')
        from modules.core.android_utils import RemoveTutorialScreen
        RemoveTutorialScreen()
        from modules.core.android_utils import Toast
        Toast('logging in...', True)
        from utilities.notification import stopNotificationService, getLastNotificationMessage
        stopNotificationService()
        # make sure that if we started from a notification we act accordingly.
        keys = getLastNotificationMessage()
        if keys:
            from kivy.clock import Clock

            def switchscreens(*largs):
                from api.streams.posts import Manager as PostsManager
                if not PostsManager.logged_in:
                    Clock.schedule_once(switchscreens, 0.125)
                    return
                if len(keys) == 1:
                    s = self.root.manager.get_screen('favs')
                    s.fake_click_for_item = keys[0]
                self.root.manager.current = 'favs'

            Clock.schedule_once(switchscreens, 0.125)
Beispiel #3
0
    def on_resume(self):
        from utilities.notification import stopNotificationService, getLastNotificationMessage
        stopNotificationService()
        keys = getLastNotificationMessage()
        if keys:
            if len(keys) == 1:
                s = self.root.manager.get_screen('favs')
                s.fake_click_for_item = keys[0]
            self.root.manager.current = 'favs'

        print 'Notification Keys: %s' % str(keys)
Beispiel #4
0
    def on_resume(self):
        from utilities.notification import stopNotificationService, getLastNotificationMessage
        stopNotificationService()
        keys = getLastNotificationMessage()
        if keys:
            if len(keys) == 1:
                s = self.root.manager.get_screen('favs')
                s.fake_click_for_item = keys[0]
            self.root.manager.current = 'favs'

        print 'Notification Keys: %s' % str(keys)