Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.AuthActivity);
            DroidDAL.HockeyAppRegister(this);

            _view = FindViewById <AuthView>(Resource.Id.auth_view);

            InitStatusBar();

            ThemeHolder.Init(DataService.RepositoryController.RepositoryThemes);
            _interactor = new InteractorAuth(new AuthController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseAuth), new ValidationRA());
#if MOCK
            _presenter = new PresenterAuthMOCK(_view, _interactor, new RouterAuth(this), FacebookCallLoginAction, GoogleCallLoginAction, VkCallLoginAction, OkCallLoginAction,
                                               new AuthStylesHolderDroid <GlobalControlsTheme>(new ThemeParser <GlobalControlsTheme>()), DataService.RepositoryController.RepositoryRA.LangRA);
#else
            _presenter = new PresenterAuth(_view, _interactor, new RouterAuth(this), FacebookCallLoginAction, GoogleCallLoginAction, VkCallLoginAction, OkCallLoginAction,
                                           new AuthStylesHolderDroid <GlobalControlsTheme>(new ThemeParser <GlobalControlsTheme>()), DataService.RepositoryController.RepositoryRA.LangRA);
#endif
            _presenter.SetConfig();

            _callbackManager  = CallbackManagerFactory.Create();
            _facebookCallback = new FacebookCallback(_interactor);
            LoginManager.Instance.RegisterCallback(_callbackManager, _facebookCallback);
            _interactor.OnSocialLogOut += SocialLogOut;
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            _loginManager = new LoginManager();
            _loginManager.LoginBehavior = LoginBehavior.Web;
#if MOCK
            _interactor = new InteractorAuth(new AuthController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseAuth), new ValidationRA());
            ThemeHolder.Init(DataService.RepositoryController.RepositoryThemes);
            _presenter = new PresenterAuthMOCK(_authView, _interactor, new RouterAuth(this), FacebookCallLoginAction, null, null, null, new AuthStylesHolderIOS <GlobalControlsTheme>(new ThemeParser <GlobalControlsTheme>()), DataService.RepositoryController.RepositoryRA.LangRA);
#else
            _interactor = new InteractorAuth(new AuthController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseAuth), new ValidationRA());
            ThemeHolder.Init(DataService.RepositoryController.RepositoryThemes);

            _presenter = new PresenterAuth(_authView, _interactor, new RouterAuth(this), FacebookCallLoginAction, null, null, null,
                                           new AuthStylesHolderIOS <GlobalControlsTheme>(new ThemeParser <GlobalControlsTheme>()), DataService.RepositoryController.RepositoryRA.LangRA);
#endif

            _presenter.SetConfig();

            _interactor.OnSocialLogOut += SocialLogout;
        }
Exemplo n.º 3
0
        public PresenterAuth(IViewAuth view, IInteractorAuth interactor, IRouterAuth router,
                             Action facebookCallLoginAction, Action googleCallLoginAction, Action vkCallLoginAction, Action okCallLoginAction,
                             IAuthStylesHolder stylesHolder, IRegAuth authLocaleStrings)
        {
            if (view == null || interactor == null || router == null)
            {
                throw new NullReferenceException();
            }

            _router               = router;
            _view                 = view;
            _interactor           = interactor;
            _view.Presenter       = this;
            _interactor.Presenter = this;
            _authLocaleStrings    = authLocaleStrings;

            _facebookCallLoginAction = facebookCallLoginAction;
            _googleCallLoginAction   = googleCallLoginAction;
            _vkCallLoginAction       = vkCallLoginAction;
            _okCallLoginAction       = okCallLoginAction;
            _stylesHolder            = stylesHolder;

            _view.SetConfig();
        }
Exemplo n.º 4
0
 public PresenterAuthMOCK(IViewAuth view, IInteractorAuth interactor, IRouterAuth router,
                          Action facebookCallLoginAction, Action googleCallLoginAction, Action vkCallLoginAction, Action okCallLoginAction,
                          IAuthStylesHolder stylesHolder, IRegAuth authLocaleStrings)
     : base(view, interactor, router, facebookCallLoginAction, googleCallLoginAction, vkCallLoginAction, okCallLoginAction, stylesHolder, authLocaleStrings)
 {
 }