def open_gallery(self, *args): self.selected_images=[] gallery = Intent() gallery.setType("image/*") gallery.setAction(Intent.ACTION_GET_CONTENT) #gallery.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, True) result_bind(on_activity_result=self.activity_result_gallery) context.startActivityForResult(gallery, PICK_IMAGE)
def initialize_google(success_listener, error_listener): gso = GsoBuilder(Gso.DEFAULT_SIGN_IN).requestEmail().build() global mGSignInClient mGSignInClient = GSignIn.getClient(context, gso) gal = GoogleActivityListener(success_listener, error_listener) result_bind(on_activity_result=gal.google_activity_listener) Logger.info("KivyAuth: Initialized google signin")
def initialize_fb(success_listener, cancel_listener, error_listener): FacebookSdk.sdkInitialize(context.getApplicationContext()) mCallbackManager = CallbackManagerFactory.create() mFacebookCallback = PythonFacebookCallback(success_listener, cancel_listener, error_listener) result_bind(on_activity_result=mCallbackManager.onActivityResult) Logger.info("KivyAuth: Initialized facebook signin") return [mCallbackManager, mFacebookCallback]
def build(self): self.mAuth = FirebaseAuth.getInstance() gso = GsoBuilder(Gso.DEFAULT_SIGN_IN).requestEmail().build() self.mGSignInClient = GSignIn.getClient(context, gso) result_bind(on_activity_result=activity_listener_google) FacebookSdk.sdkInitialize(context.getApplicationContext()) mCallbackManager = CallbackManagerFactory.create() mFacebookCallback = PythonFacebookCallback() self.mLoginMgr = LoginManager.getInstance() self.mLoginMgr.registerCallback(mCallbackManager, mFacebookCallback) result_bind(on_activity_result=mCallbackManager.onActivityResult) return Builder.load_string(kv)
def initialize_fb(success_listener, error_listener, *args, **kwargs): """ Function to initialize facebook login. Must be called inside `build` method of kivy App before actual login. :param: `success_listener` - Function to be called on login success :param: `error_listener` - Function to be called on login error """ FacebookSdk.sdkInitialize(context.getApplicationContext()) mCallbackManager = CallbackManagerFactory.create() mFacebookCallback = PythonFacebookCallback(success_listener, error_listener, error_listener) result_bind(on_activity_result=mCallbackManager.onActivityResult) Logger.info("KivyAuth: Initialized facebook signin") global mList mList = [mCallbackManager, mFacebookCallback]
def initialize_google(success_listener, error_listener): """ Function to initialize google login. Must be called inside `build` method of kivy App before actual login. :param: `success_listener` - Function to be called on login success :param: `error_listener` - Function to be called on login error """ global event_success_listener event_success_listener = success_listener gso = GsoBuilder(Gso.DEFAULT_SIGN_IN).requestEmail().build() global mGSignInClient mGSignInClient = GSignIn.getClient(context, gso) gal = GoogleActivityListener(success_listener, error_listener) result_bind(on_activity_result=gal.google_activity_listener) Logger.info("KivyAuth: Initialized google signin")