public ForgotPasswordRepository(IRestServices restServices, IRxSchedulersFacade rxSchedulersFacade,
                                 IDeviceLog log)
 {
     _restServices       = restServices;
     _rxSchedulersFacade = rxSchedulersFacade;
     _log = log;
 }
예제 #2
0
 public ResetPassDialog(Context context, IAppRes appRes, IDeviceLog log, IForgotPasswordViewModel viewModel)
     : base(context, appRes, log)
 {
     _viewModel = viewModel;
     if (_viewModel is IBaseViewModel vm)
     {
         SubscribeToastDialog(vm);
     }
 }
예제 #3
0
 public AuthRepository(IRestServices restServices, IAuthService authService,
                       IRxSchedulersFacade rxSchedulersFacade,
                       IConnectionStatusRepository connectionStatusRepository, IDeviceLog log)
 {
     _restServices               = restServices;
     _authService                = authService;
     _rxSchedulersFacade         = rxSchedulersFacade;
     _connectionStatusRepository = connectionStatusRepository;
     _log = log;
 }
예제 #4
0
        public MainViewModel(IAppRes appRes, IRxSchedulersFacade rxSchedulersFacade, IDeviceLog deviceLog,
                             IAuthRepository authRepository) : base(appRes, rxSchedulersFacade, deviceLog)
        {
            _authRepository = authRepository;

            RxDisposables.Add(authRepository.AuthStatus
                              .ObserveOn(RxSchedulersFacade.IO())
                              .SubscribeOn(RxSchedulersFacade.IO())
                              .Subscribe(status => AuthStatus.PostValue(status),
                                         exception => Log.Error("MainViewModel",
                                                                "Error observing AuthRepository AuthStatus", exception)));
        }
예제 #5
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            if (Activity is IBaseFragmentContract contract)
            {
                Log    = contract.GetDeviceLog();
                AppRes = contract.GetAppRes();
            }
            else
            {
                throw new Exception("Context not implementing IBaseFragmentContract");
            }

            ApplyI18N();
        }
예제 #6
0
        public AppRes(IDeviceStorageRepository deviceStorageRepository, IDeviceLog deviceLog)
        {
            _deviceStorageRepository = deviceStorageRepository;
            _log = deviceLog;

            I18N.Current.SetResourcesFolder("Resources.Locales")
            .SetFallbackLocale("en")
            .SetNotFoundSymbol("$")
            .SingleFileResourcesMode()
            .SetSingleFileLocaleReader(new CsvColSingleFileReader(), ".csv")
            .Init(GetType().Assembly);

            var savedLocale = ReadLocale();

            if (!savedLocale.Equals(LangCode))
            {
                I18N.Current.Locale = savedLocale;
            }
        }
예제 #7
0
        public SplashViewModel(IAppRes appRes, IRxSchedulersFacade rxSchedulersFacade, IDeviceLog deviceLog,
                               IAuthRepository authRepository)
            : base(appRes, rxSchedulersFacade, deviceLog)
        {
            _authRepository = authRepository;

            RxDisposables.Add(_authRepository.AuthStatus
                              .ObserveOn(RxSchedulersFacade.IO())
                              .SubscribeOn(RxSchedulersFacade.IO())
                              .Subscribe(status =>
            {
                if (status == AuthStatusEnum.LoggedOut)
                {
                    StartupLiveData.PostValue(AppStartStatus.LoginRequired);
                }
                else if (status == AuthStatusEnum.NoInternet)
                {
                    StartupLiveData.PostValue(AppStartStatus.NoInternet);
                }
            }, e =>
            {
                StartupLiveData.PostValue(AppStartStatus.LoginRequired);
                Log.Error("SplashViewModel", "error subscribing to AuthStatus", e);
            }));
        }
예제 #8
0
        public ForgotPasswordViewModel(IAppRes appRes, IRxSchedulersFacade rxSchedulersFacade, IDeviceLog deviceLog,
                                       IForgotPasswordRepository forgotPasswordRepository) : base(appRes, rxSchedulersFacade, deviceLog)
        {
            _forgotPasswordRepository = forgotPasswordRepository;

            RxDisposables.Add(_forgotPasswordRepository.ForgotPasswordRequestStatusSubject
                              .SubscribeOn(RxSchedulersFacade.IO())
                              .ObserveOn(RxSchedulersFacade.UI())
                              .Subscribe(HandleNewForgotPasswordRequestStatus, e =>
            {
                LongToast(AppRes["ForgotPasswordError"]);
                Log.Error("ForgotPasswordPageViewModel",
                          "error subscribing to ForgotPasswordRequestStatusSubject", e);
            }
                                         ));
        }
예제 #9
0
 protected BaseCustomDialog(Context context, IAppRes appRes, IDeviceLog log, int themeResId)
     : base(context, themeResId)
 {
     AppRes = appRes;
     Log    = log;
 }
예제 #10
0
 protected BaseCustomDialog(Context context, IAppRes appRes, IDeviceLog log) : base(context)
 {
     AppRes = appRes;
     Log    = log;
 }
예제 #11
0
 protected BaseViewModel(IAppRes appRes, IRxSchedulersFacade rxSchedulersFacade, IDeviceLog deviceLog)
 {
     AppRes             = appRes;
     RxSchedulersFacade = rxSchedulersFacade;
     Log = deviceLog;
 }
예제 #12
0
 public ConnectionStatusRepository(Context appContext, IDeviceLog log)
 {
     _log = log;
     _connectivityManager = (ConnectivityManager)appContext.GetSystemService(Context.ConnectivityService);
 }
 public ConnectionStatusRepository(IDeviceLog log)
 {
     _log = log;
 }