Exemple #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;
        }
        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;
        }