public NavigationViewMenu(BaseActivityWithNavigationDrawer activity, SharedPreferencesHelper sharedPreferencesHelper) { this.activity = activity; signInService = new SignInService(); this.bitmapOperationService = new BitmapOperationService(); this.progressDialogHelper = new ProgressDialogHelper(activity); this.sharedPreferencesHelper = sharedPreferencesHelper; this.gpsService = GpsLocationService.GetServiceInstance(activity); this.googleMapsAPIService = new GoogleMapsAPIService(); this.categoriesHelper = new CategoriesSelectingHelper(activity, (string)this.sharedPreferencesHelper.GetSharedPreference <string>(SharedPreferencesKeys.BEARER_TOKEN)); this.sizeSelectingHelper = new SizeSelectingHelper(activity); this.appSettings = SharedPreferencesHelper.GetAppSettings(activity); SetupViews(activity); }
public override StartCommandResult OnStartCommand(Intent intent, [GeneratedEnum] StartCommandFlags flags, int startId) { ServiceIsRunning = true; searchModelForNotifications = new AdvertisementsSearchModelForNotifications(); this.sharedPreferencesHelper = new SharedPreferencesHelper(Application.ApplicationContext); var bearerToken = (string)this.sharedPreferencesHelper.GetSharedPreference <string>(SharedPreferencesKeys.BEARER_TOKEN); this.advertisementItemService = new AdvertisementItemService(bearerToken); this.gpsLocationService = new GpsLocationService(Application.ApplicationContext, null); DoWork(); return(StartCommandResult.Sticky); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.bitmapOperationService = new BitmapOperationService(); this.advertisementItemService = new AdvertisementItemService(bearerToken); this.gpsLocationService = new GpsLocationService(this, null); this.categoriesSelectingHelper = new CategoriesSelectingHelper(this, bearerToken); this.sizeSelectingHelper = new SizeSelectingHelper(this); this.categoryInfoModel = new CategoryInfoModel(); SetContentView(Resource.Layout.AddNewAdvertisementActivity); base.SetupToolbar(); SetupViews(); photosPaths = new List <string>(); tempPhotosPaths = new List <string>(); await GetExtrasIsExistAndFillForm(); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); gpsLocationService = new GpsLocationService(this, null); this.advertisementItemService = new AdvertisementItemService(bearerToken); feedbackService = new FeedbackService(bearerToken); messagesService = new MessagesService(bearerToken); this.bitmapOperationService = new BitmapOperationService(); SetContentView(Resource.Layout.AdvertisementItemDetailsActivity); base.SetupToolbar(); SetupViews(); await GetAndShowAdvertisementDetails(); firstEntryOnUserAdvertisementsList = true; }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); FacebookSdk.SdkInitialize(this); SetFullscreenOptions(); SetContentView(Resource.Layout.StartActivity); progressHelper = new ProgressDialogHelper(this); SetupViews(); var gps = new GpsLocationService(this, this); if (!gps.CanGetLocation) { settingsAlertIsShow = true; gps.ShowSettingsAlert(); } try { userIsLogged = await SignInUser(); } catch (UserHasToSetNickNameException exc) { logoLayout.Visibility = ViewStates.Gone; setUserNameLayout.Visibility = ViewStates.Visible; return; } catch (Exception exc) { AlertsService.ShowAlertDialog(this, "Wystąpił problem z połączeniem z serwerem. Spróbuj ponownie później"); return; } if (!settingsAlertIsShow) { StartMainOrLoginActivity(userIsLogged); } else { actionToExecuteAfterCloseSettingsDialog = StartMainOrLoginActivity; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.gpsLocationService = new GpsLocationService(this, null); this.advertisementItemService = new AdvertisementItemService(bearerToken); this.categoriesHelper = new CategoriesSelectingHelper(this, bearerToken); this.sizeSelectingHelper = new SizeSelectingHelper(this); SetRefreshAdvertisementAction(); SetContentView(Resource.Layout.MainActivity); SetupToolbar(); SetupDrawer(); drawerToggle.ToolbarNavigationClickListener = this; advertisementsPage = 0; SetSortingOptionsLayout(); SetupFab(); SetAdvertisementsListKind(); SetupViews(); SetupSortingViews(); RefreshAdvertisementList(true); }
private void SetCheckingNewAdvertisementsAction(Context context) { checkingNewAdvertsAction = async() => { try { searchModelForNotifications = new AdvertisementsSearchModelForNotifications(); this.appsettings = SharedPreferencesHelper.GetAppSettings(this.context); this.advertisementItemService = new AdvertisementItemService(bearerToken); this.gpsLocationService = new GpsLocationService(context.ApplicationContext, null); var coordinates = await CheckNewAdvertisementsAroundUserCurrentLocation(); await CheckNewAdvertisementsAroundUserHomeLocation(coordinates); } catch { } finally { checkingNewAdvertsFinished = true; } }; }