private async Task StartConversationBtn_Click(object sender, EventArgs e) { if (!advertisement.IsActive) { AlertsService.ShowShortToast(this, "Og³oszenie jest nieaktualne dlatego nie mo¿esz wys³aæ wiadomoœci autorowi og³oszenia"); } else { progress.ShowProgressDialog("Proszê czekaæ. Trwa przetwarzanie informacji.."); var conversationInfoModel = await messagesService.GetConversationInfoModel(this.advertisement.SellerId); progress.CloseProgressDialog(); if (conversationInfoModel.ConversationId == 0) { //if 0 that means user is trying to send message to himself AlertsService.ShowLongToast(this, "Nie mo¿esz wys³aæ wiadomoœci do samego siebie :)"); } else { var conversationIntent = new Intent(this, typeof(ConversationActivity)); conversationIntent.PutExtra(ExtrasKeys.CONVERSATION_INFO_MODEL, JsonConvert.SerializeObject(conversationInfoModel)); StartActivity(conversationIntent); } } }
private async Task BtnChoseCategory_Click(object sender, EventArgs e) { try { await this.categoriesSelectingHelper.ShowCategoriesSingleSelectAndMakeAction(GetMethodToExecuteAfterCategoryChosing(), this.categoryInfoModel.Name); } catch (Exception exc) { AlertsService.ShowShortToast(this, "Wsytapil wyjatek: " + exc); //dziwne wyjatki wystepuj¹ gdy nie zlapie tego w try catch } }
private void SetupViews() { this.textViewAppVersion = FindViewById <TextView>(Resource.Id.textViewAppVersion); var version = this.ApplicationContext.PackageManager.GetPackageInfo(this.ApplicationContext.PackageName, 0).VersionName; this.textViewAppVersion.Text = String.Format("Wersja aplikacji: {0}", version); this.infoLayout = FindViewById <NestedScrollView>(Resource.Id.appInfoLayout); this.contactLayout = FindViewById <RelativeLayout>(Resource.Id.contactLayout); this.btnSendFeedback = FindViewById <Button>(Resource.Id.btnSendFeedback); this.btnSendFeedback.Click += (s, e) => { TogleLayouts(); }; this.btnSubmitSenInfo = FindViewById <Button>(Resource.Id.btnSubmitSenInfo); btnSubmitSenInfo.Click += async(s, e) => { if (selectedMessageTypeItemPosition == 0 && String.IsNullOrEmpty(telModel.Text)) { AlertsService.ShowShortToast(this, "Podaj model telefonu"); return; } if (String.IsNullOrEmpty(messageINfoContet.Text)) { AlertsService.ShowShortToast(this, "WprowadŸ treœæ wiadomoœci."); return; } progress.ShowProgressDialog("Wysy³anie zg³oszenia..."); var model = new NotificationFromUser(); model.Title = messageTypeStringContent; model.TelModel = this.telModel.Text; model.MessageContent = this.messageINfoContet.Text; progress.CloseProgressDialog(); var success = await this.feedbackService.SendNotificationFromUser(model); if (success) { AlertsService.ShowLongToast(this, "Zg³oszenie zosta³o wys³ane. Dziêkujemy."); ClearViews(); OnBackPressed(); } else { AlertsService.ShowShortToast(this, "Nie uda³o siê wys³aæ zg³oszenia."); } }; this.messageType = FindViewById <Spinner>(Resource.Id.messageType); this.telModel = FindViewById <EditText>(Resource.Id.telModel); this.messageINfoContet = FindViewById <EditText>(Resource.Id.messageINfoContet); SetupSpinner(); }
private void SetupViews() { this.CreateAdvertMenuItemClicked = async() => { progress.ShowProgressDialog("Wysy³anie ogloszenia. Proszê czekaæ..."); try { await CreateAdvertisement(); } catch { AlertsService.ShowShortToast(this, "Wyst¹pi³ nieoczekiwany b³¹d..."); } finally { progress.CloseProgressDialog(); } }; rdBtnOnlyForSell = (RadioButton)FindViewById(Resource.Id.rdBtnOnlyForSell); progress = new ProgressDialogHelper(this); advertisementTitle = (EditText)FindViewById(Resource.Id.editTextTitle); advertisementDescription = (EditText)FindViewById(Resource.Id.editTextDescription); advertisementPrice = (EditText)FindViewById(Resource.Id.editTextPrice); mPhotoView1 = (ImageView)FindViewById(Resource.Id.photoView1); mButtonTakePicture1 = (Button)FindViewById(Resource.Id.buttonTakePicture1); mButtonTakePicture1.Tag = 1; photoDivider2 = (TextView)FindViewById(Resource.Id.photoView2Divider); mPhotoView2 = (ImageView)FindViewById(Resource.Id.photoView2); mButtonTakePicture2 = (Button)FindViewById(Resource.Id.buttonTakePicture2); mButtonTakePicture1.Tag = 1; mButtonTakePicture2.Tag = 2; photoDivider3 = (TextView)FindViewById(Resource.Id.photoView3Divider); mPhotoView3 = (ImageView)FindViewById(Resource.Id.photoView3); mButtonTakePicture3 = (Button)FindViewById(Resource.Id.buttonTakePicture3); mButtonTakePicture3.Tag = 3; btnChoseCategory = (ImageView)FindViewById(Resource.Id.btnAddAdvCategoryChosing); btnChoseCategory.Click += async(s, e) => await BtnChoseCategory_Click(s, e); textViewChodesdCategory = (TextView)FindViewById(Resource.Id.textViewChosedCategory); textViewChodesdCategory.Click += async(s, e) => await BtnChoseCategory_Click(s, e); btnChoseSize = (ImageView)FindViewById(Resource.Id.btnAddSize); btnChoseSize.Click += BtnChoseSize_Click; textViewChodesdSize = (TextView)FindViewById(Resource.Id.textViewSelectedSize); textViewChodesdSize.Click += BtnChoseSize_Click; mButtonTakePicture1.Click += MButtonTakePicture_Click; mButtonTakePicture2.Click += MButtonTakePicture_Click; mButtonTakePicture3.Click += MButtonTakePicture_Click; }
private void ReportWrongAdvert() { Action reportActionConfirmed = () => { Action <string> actionOnReasonSelected = async(reason) => { this.progress.ShowProgressDialog("Zg³aszanie og³oszenia naruszaj¹cego regulamin"); await this.feedbackService.ReportWrongAdvertisement(this.advertisement.Id, reason); this.progress.CloseProgressDialog(); AlertsService.ShowShortToast(this, "Og³oszenie zosta³o zg³oszone adminom"); }; string[] itemList = Resources.GetStringArray(Resource.Array.report_wrong_advert_reasons); AlertsService.ShowSingleSelectListString(this, itemList, actionOnReasonSelected, dialogTitle: "Wybierz powód"); }; AlertsService.ShowConfirmDialog(this, "Czy na pewno chcesz zg³osiæ to og³oszenie jako naruszenie regulaminu?", reportActionConfirmed); }
private async Task SubmitRegistrationBtn_Click(object sender, EventArgs e) { if (loginFormIsValid()) { if (!acceptCheckboxLogin.Checked) { AlertsService.ShowShortToast(this, "Zapoznaj siê i zaakceptuj Regulamin oraz Politykê Prywatnoœci"); } else { progress.ShowProgressDialog("Trwa tworzenie konta u¿ytkownika... Proszê czekaæ"); await RegisterUser(); progress.CloseProgressDialog(); } } else { focusView.RequestFocus(); } }
private void DeleteConversation() { Action actionOnConfirm = async() => { this.progress.ShowProgressDialog("Trwa oznaczanie rozmowy jako usuniêtej..."); var result = await messagesService.DeleteConversation(this.conversationInfoModel.ConversationId); this.progress.CloseProgressDialog(); if (result) { AlertsService.ShowShortToast(this, "Rozmowa zosta³a oznaczona jako usuniêta."); this.Finish(); } else { AlertsService.ShowShortToast(this, "Nie uda³o siê usun¹æ rozmowy. Spróbuj ponownie póŸniej."); } }; AlertsService.ShowConfirmDialog(this, "Czy chcesz usun¹æ tê rozmowê? Nie bêdzie ona widoczna na liœcie rozmów dopóki Ty i Twój rozmówca nie skontaktujecie siê ponownie.", actionOnConfirm); }