Example #1
0
        public async void OnInfiniteScroll()
        {
            progress.ShowProgressDialog("Trwa pobieranie wiadomoœci...");
            await GetAndSetMessages();

            progress.CloseProgressDialog();
        }
Example #2
0
        private void SetRefreshAdvertisementAction()
        {
            RefreshAdvertisementList = async(withDisplayedProgress) =>
            {
                if (withDisplayedProgress)
                {
                    progress.ShowProgressDialog("Pobieranie og³oszeñ. Proszê czekaæ...");
                }
                else
                {
                    mainListSwipeLayout.Refreshing = true;
                }

                try
                {
                    await DownloadAndShowAdvertisements(true);
                }
                catch (Exception)
                {
                }
                finally
                {
                    if (withDisplayedProgress)
                    {
                        progress.CloseProgressDialog();
                    }
                    else
                    {
                        mainListSwipeLayout.Refreshing = false;
                    }
                }
            };
        }
Example #3
0
        private async Task DownloadAndShowAdvertisements()
        {
            progress.ShowProgressDialog("Pobieranie og³oszeñ. Proszê czekaæ...");
            var coordinates = gpsLocationService.GetCoordinatesModel();
            List <AdvertisementItemShort> advertisements = await this.advertisementItemService.GetUserAdvertisements(userAdvertsPageNumber, this.advertisement.SellerId, coordinates.Latitude, coordinates.Longitude);

            if (advertisements.Count > 0)
            {
                if (advertisementItemListAdapter == null)
                {
                    advertisementItemListAdapter = new AdvertisementItemListAdapter(this, advertisements, AdvertisementsKind.AdvertisementsAroundUserCurrentLocation, this);
                    advertisementItemListAdapter.AdvertisementItemClick += AdvertisementItemListAdapter_AdvertisementItemClick;
                    advertisementsRecyclerView.SetAdapter(advertisementItemListAdapter);
                }
                else
                {
                    advertisementItemListAdapter.AddAdvertisements(advertisements);
                }
            }
            else
            {
                if (advertisementItemListAdapter == null)
                {
                    advertisementItemListAdapter = new AdvertisementItemListAdapter(this, new List <AdvertisementItemShort>(), AdvertisementsKind.AdvertisementsAroundUserCurrentLocation, this);
                }
                advertisementItemListAdapter.InfiniteScrollDisabled = true;
                userAdvertsPageNumber = 0;
            }
            progress.CloseProgressDialog();
        }
        private async Task ButtonLogin_Click(object sender, EventArgs e)
        {
            if (loginFormIsValid())
            {
                progress.ShowProgressDialog("Trwa logowanie... Proszê czekaæ");
                await LoginUser();

                progress.CloseProgressDialog();
            }
            else
            {
                focusView.RequestFocus();
            }
        }
Example #5
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            ActivityInstance = this;
            progress         = new ProgressDialogHelper(this);
            signInService    = new SignInService();
            bitmapService    = new BitmapOperationService();
            appSettings      = SharedPreferencesHelper.GetAppSettings(this);
            if (!appSettings.ChatDisabled)
            {
                this.chatHubClientService = ChatHubClientService.GetServiceInstance(bearerToken);
            }
            this.messagesService = new MessagesService(bearerToken);
            SetContentView(Resource.Layout.ConversationActivity);
            SetupViews(savedInstanceState);
            SetupConversationToolbar();
            pageNumber = 0;
            GetExtras();
            player = new MediaPlayer();
            player.SetDataSource(this, Android.Net.Uri.Parse("android.resource://" + this.PackageName + "/raw/" + Resource.Raw.message_sound));
            player.Prepare();
            progress.ShowProgressDialog("Trwa pobieranie wiadomoœci...");
            await SetupIntelocutorInfo();
            await GetAndDisplayMesages(savedInstanceState);

            coversationsLayoutWrapper.Visibility = ViewStates.Visible;
            progress.CloseProgressDialog();
        }
        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();
        }
Example #7
0
        private async Task DownloadAndShowConversations(bool resetList)
        {
            progress.ShowProgressDialog("Pobieranie rozmów. Proszê czekaæ...");
            SetConversationsListPageNumber(resetList);
            List <ConversationItemModel> conversations = await GetConversations();

            if (conversations != null && conversations.Count > 0)
            {
                if (this.conversationsRecyclerView.Visibility == ViewStates.Gone)
                {
                    this.conversationsRecyclerView.Visibility = ViewStates.Visible;
                    this.textViewNoConversations.Visibility   = ViewStates.Gone;
                }
                if (conversationsListAdapter == null || resetList)
                {
                    conversationsListAdapter = new ConversationsListAdapter(conversations, this);
                    conversationsListAdapter.ConversationItemClick += ConversationsListAdapter_ConversationItemClick;;
                    var mLayoutManager = new LinearLayoutManager(this);
                    conversationsRecyclerView.SetLayoutManager(mLayoutManager);
                    conversationsRecyclerView.SetAdapter(conversationsListAdapter);
                    conversationsRecyclerView.RequestLayout();
                    if (conversations.Count < 10)
                    {
                        //przy pierwszym pociagnieciu jak sciagnie malo to niech nie mryga drugi raz po infinite scrolu tylko od razu wylacze
                        conversationsListAdapter.InfiniteScrollDisabled = true;
                    }
                }
                else
                {
                    conversationsListAdapter.AddConversations(conversations);
                }
            }
            else
            {
                if (conversationsListAdapter == null)
                {
                    conversationsListAdapter = new ConversationsListAdapter(new List <ConversationItemModel>(), this);
                }
                conversationsListAdapter.InfiniteScrollDisabled = true;
                if (conversationsListAdapter.ItemCount == 0)
                {
                    this.conversationsRecyclerView.Visibility = ViewStates.Gone;
                    this.textViewNoConversations.Visibility   = ViewStates.Visible;
                }
            }
            progress.CloseProgressDialog();
        }
Example #8
0
        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;
        }
Example #9
0
        private void UpdateNewFunctionFilterEntries()
        {
            var mapper = new TreeViewSchemaFilterMapper();

            mapper.AddTreeView(AddTreeView.TreeViewControl, null);
            var filterEntryBag = mapper.CreateSchemaFilterEntryBag();

            // because we only added the AddTreeView above IncludedSprocEntries is the list of selected
            // sprocs in the Add tab only
            var newFunctionEntries = filterEntryBag.IncludedSprocEntries.ToList();

            // if there are any new Function entries and if the user has selected to create matching Function Imports
            // then create and run a ProgressDialog while we are collecting the sproc return type info
            if (newFunctionEntries.Count > 0 &&
                chkCreateFunctionImports.Checked)
            {
                var result = ProgressDialogHelper.ShowProgressDialog(this, newFunctionEntries, Wizard.ModelBuilderSettings);
            }
        }
Example #10
0
        private void UpdateModelBuilderFilterSettings()
        {
            var mapper         = new TreeViewSchemaFilterMapper(databaseObjectTreeView.TreeViewControl);
            var filterEntryBag = mapper.CreateSchemaFilterEntryBag();

            IList <EntityStoreSchemaFilterEntry> newFunctionEntries = new List <EntityStoreSchemaFilterEntry>();

            foreach (var entry in filterEntryBag.IncludedSprocEntries)
            {
                newFunctionEntries.Add(entry);
            }

            // if there are any new Function entries and if the user has selected to create matching Function Imports
            // then create and run a ProgressDialog while we are collecting the sproc return type info
            if (newFunctionEntries.Count > 0 &&
                chkCreateFunctionImports.Checked)
            {
                var result = ProgressDialogHelper.ShowProgressDialog(this, newFunctionEntries, Wizard.ModelBuilderSettings);
            }
        }
        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();
            }
        }