private void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchKey = e.NewText;

                GamesTab.MAdapter.GamesList.Clear();
                GamesTab.MAdapter.NotifyDataSetChanged();

                GamesTab.SwipeRefreshLayout.Refreshing = true;

                if (!Methods.CheckConnectivity())
                {
                    Toast.MakeText(this, GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
                else
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => SearchGames()
                    });
                }

                //Hide keyboard programmatically in MonoDroid
                e.Handled = true;

                SearchView.ClearFocus();

                var inputManager = (InputMethodManager)GetSystemService(InputMethodService);
                inputManager.HideSoftInputFromWindow(ToolBar.WindowToken, 0);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 2
0
        private void SearchView_OnTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchText = e.NewText;

                SearchView.ClearFocus();

                MAdapter.JobList.Clear();
                MAdapter.NotifyDataSetChanged();

                StartApiService();

                //Hide keyboard programmatically in MonoDroid
                e.Handled = true;

                SearchView.ClearFocus();

                var inputManager = (InputMethodManager)GetSystemService(InputMethodService);
                inputManager.HideSoftInputFromWindow(ToolBar.WindowToken, 0);
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        private void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                KeySearch = e.NewText;

                MarketTab.MAdapter.MarketList.Clear();
                MarketTab.MAdapter.NotifyDataSetChanged();

                MarketTab.SwipeRefreshLayout.Refreshing = true;
                MarketTab.SwipeRefreshLayout.Enabled    = true;

                if (Methods.CheckConnectivity())
                {
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => GetMarketByKey(KeySearch)
                    });
                }
                else
                {
                    Toast.MakeText(this, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Long)?.Show();
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Exemplo n.º 4
0
        private void _searchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchKey = e.NewText;

                MRecycler.Visibility = ViewStates.Visible;

                MAdapter.VideoList.Clear();
                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;

                StartApiService();

                //Hide keyboard programmatically in MonoDroid
                e.Handled = true;

                SearchView.ClearFocus();

                var inputManager = (InputMethodManager)Activity.GetSystemService(Context.InputMethodService);
                inputManager.HideSoftInputFromWindow(ToolBar.WindowToken, 0);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 5
0
        private void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchKey = e.NewText;
                if (SearchKey.Length >= 4)
                {
                    CatRecycler.Visibility = ViewStates.Gone;
                    MRecycler.Visibility   = ViewStates.Visible;

                    MAdapter.VideoList.Clear();
                    SwipeRefreshLayout.Refreshing = true;
                    SwipeRefreshLayout.Enabled    = true;

                    StartApiService();

                    e.Handled = true;
                    SearchBox.ClearFocus();
                }
                else
                {
                    Toast.MakeText(Activity, GetText(Resource.String.Lbl_The_search_term), ToastLength.Short).Show();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        private void SearchView_OnTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchText = e.NewText;

                SearchView.ClearFocus();

                SwipeRefreshLayout.Refreshing = true;
                SwipeRefreshLayout.Enabled    = true;

                MAdapter.MentionList.Clear();
                MAdapter.NotifyDataSetChanged();

                StartSearchRequest();

                //Hide keyboard programmatically in MonoDroid
                e.Handled = true;

                SearchView.ClearFocus();

                var inputManager = (InputMethodManager)GetSystemService(InputMethodService);
                inputManager.HideSoftInputFromWindow(ToolBar.WindowToken, 0);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 7
0
        private void searchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            var searchPage = Element as SearchPage;

            searchPage.SearchText = e.Query;
            searchPage.SearchCommand?.Execute(e.Query);
            e.Handled = true;
        }
Exemplo n.º 8
0
        private void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchView.ClearFocus();

                UserTab.MAdapter.UserList.Clear();
                UserTab.MAdapter.NotifyDataSetChanged();

                HashTagTab.MAdapter.HashTagsList.Clear();
                HashTagTab.MAdapter.NotifyDataSetChanged();

                if (Methods.CheckConnectivity())
                {
                    if (UserTab.MAdapter.UserList.Count > 0)
                    {
                        UserTab.MAdapter.UserList.Clear();
                        UserTab.MAdapter.NotifyDataSetChanged();
                    }

                    if (HashTagTab.MAdapter.HashTagsList.Count > 0)
                    {
                        HashTagTab.MAdapter.HashTagsList.Clear();
                        HashTagTab.MAdapter.NotifyDataSetChanged();
                    }

                    UserTab.ProgressBarLoader.Visibility = ViewStates.Visible;
                    UserTab.EmptyStateLayout.Visibility  = ViewStates.Gone;
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        StartSearchRequest
                    });
                }
                else
                {
                    if (UserTab.Inflated == null)
                    {
                        UserTab.Inflated = UserTab.EmptyStateLayout.Inflate();
                    }

                    EmptyStateInflater x = new EmptyStateInflater();
                    x.InflateLayout(UserTab.Inflated, EmptyStateInflater.Type.NoConnection);
                    if (x.EmptyStateButton.HasOnClickListeners)
                    {
                        x.EmptyStateButton.Click -= EmptyStateButtonOnClick;
                        x.EmptyStateButton.Click -= TryAgainButton_Click;
                    }

                    x.EmptyStateButton.Click            += TryAgainButton_Click;
                    UserTab.ProgressBarLoader.Visibility = ViewStates.Gone;
                    UserTab.EmptyStateLayout.Visibility  = ViewStates.Visible;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 9
0
        private void MSearchView_QueryTextSubmit(object sender, V7SearchView.QueryTextSubmitEventArgs e)
        {
            string lineId = e.Query.Trim();
            View   view   = this.CurrentFocus;

            if (view != null)
            {
                InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                imm.HideSoftInputFromWindow(view.WindowToken, 0);
            }
        }
Exemplo n.º 10
0
 private void _SearchView_OnTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     try
     {
         MyContactsAdapter.Filter.InvokeFilter(e.Query);
         e.Handled = true;
     }
     catch (Exception exception)
     {
         Crashes.TrackError(exception);
     }
 }
 private void _SearchView_OnTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     try
     {
         ContactAdapter.Filter.InvokeFilter(e.Query);
         e.Handled = true;
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
Exemplo n.º 12
0
        private void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchText = e.NewText;

                SearchView.ClearFocus();

                MAdapter.UserList.Clear();
                MAdapter.NotifyDataSetChanged();

                OffsetUser = "******";

                if (Methods.CheckConnectivity())
                {
                    if (MAdapter.UserList.Count > 0)
                    {
                        MAdapter.UserList.Clear();
                        MAdapter.NotifyDataSetChanged();
                    }

                    ProgressBarLoader.Visibility = ViewStates.Visible;
                    EmptyStateLayout.Visibility  = ViewStates.Gone;
                    StartApiService();
                }
                else
                {
                    if (Inflated == null)
                    {
                        Inflated = EmptyStateLayout.Inflate();
                    }

                    EmptyStateInflater x = new EmptyStateInflater();
                    x.InflateLayout(Inflated, EmptyStateInflater.Type.NoConnection);
                    if (!x.EmptyStateButton.HasOnClickListeners)
                    {
                        x.EmptyStateButton.Click -= EmptyStateButtonOnClick;
                        x.EmptyStateButton.Click -= TryAgainButton_Click;
                    }

                    x.EmptyStateButton.Click    += TryAgainButton_Click;
                    ProgressBarLoader.Visibility = ViewStates.Gone;
                    EmptyStateLayout.Visibility  = ViewStates.Visible;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 13
0
        private void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            if (!(Element is SearchPage searchPage))
            {
                return;
            }
            searchPage.SearchText = e.Query;
            searchPage.SearchCommand?.Execute(e.Query);
            e.Handled = true;
        }
Exemplo n.º 14
0
        private void searchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            var searchPage = Element as TabbedSearchPage;

            if (searchPage == null)
            {
                return;
            }
            searchPage.SearchText = e.Query;
            searchPage.SearchCommand?.Execute(e.Query);
            e.Handled = true;
        }
Exemplo n.º 15
0
        private void _SearchView_OnTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                search_key = e.Query;
                Get_GifData_Api(search_key);

                //Hide keyboard programmatically in MonoDroid
                e.Handled = true;

                _SearchView.ClearFocus();

                var inputManager = (InputMethodManager)GetSystemService(InputMethodService);
                inputManager.HideSoftInputFromWindow(ToolBar.WindowToken, 0);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 16
0
        private void MSearchView_QueryTextSubmit(object sender, V7SearchView.QueryTextSubmitEventArgs e)
        {
            isSVCliced = true;
            mLineId    = e.Query.Trim();
            mGoogleMap.Clear();
            try
            {
                mClosestStopString = CalcClosest(mDB.GetAllStationsLocationFromLine(mLineId), mMyLocation);

                mGoogleMap.Clear();
                ProcessOnMap();
            }
            catch (Exception)
            {
                bool flag = false;
                for (int i = 0; i < mAllLinesId.Count; i++)
                {
                    if (mLineId == mAllLinesId[i])
                    {
                        flag = true;
                    }
                }
                if (flag == true)
                {
                    ShowAlert("Грешка", "Моля, първо проверете местоположението си");
                    flag = false;
                }
                else
                {
                    Toast.MakeText(this, "Грешна линия", ToastLength.Short).Show();
                    flag = false;
                }
            }
            View view = CurrentFocus;

            if (view != null)
            {
                InputMethodManager imm = (InputMethodManager)GetSystemService(InputMethodService);
                imm.HideSoftInputFromWindow(view.WindowToken, 0);
            }
        }
Exemplo n.º 17
0
        private void MSearchView_QueryTextSubmit(object sender, V7SearchView.QueryTextSubmitEventArgs e)
        {
            string lineId = e.Query.Trim();
            //mGoogleMap.Clear();
            //try
            //{
            //    DrawLinesRoute(lineId);
            //}
            //catch (Exception)
            //{
            //    Toast.MakeText(this, "Грешна линия", ToastLength.Short).Show();
            //    mSearchView.ClearAnimation();
            //}
            View view = this.CurrentFocus;

            if (view != null)
            {
                InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                imm.HideSoftInputFromWindow(view.WindowToken, 0);
            }
        }
Exemplo n.º 18
0
        public void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                search_key = e.Query;

                if (SearchUser_Tab.mSearchAdapter.mSearchUserList.Count > 0)
                {
                    SearchUser_Tab.mSearchAdapter.Clear();
                }

                if (SearchPages_Tab.mSaerchPageAdapter.mSearchPageList.Count > 0)
                {
                    SearchPages_Tab.mSaerchPageAdapter.Clear();
                }

                if (SearchGroups_Tab.mSaerchGroupAdapter.mSearchGroupList.Count > 0)
                {
                    SearchGroups_Tab.mSaerchGroupAdapter.Clear();
                }

                showData_Page  = true;
                showData_Group = true;

                GetSearch_Result(search_key);

                //Hide keyboard programmatically in MonoDroid
                e.Handled = true;

                _SearchView.ClearFocus();

                var inputManager = (InputMethodManager)GetSystemService(InputMethodService);
                inputManager.HideSoftInputFromWindow(actionBarToolBar.WindowToken, 0);
            }
            catch (Exception exception)
            {
                Crashes.TrackError(exception);
            }
        }
        private void _SearchView_OnTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                search_key = e.Query;

                mAdapter.Clear();

                SearchRecyler.Visibility      = ViewStates.Visible;
                OnlineSearch_Empty.Visibility = ViewStates.Gone;

                GetSearch_Result(search_key);

                //Hide keyboard programmatically in MonoDroid
                e.Handled = true;
                var inputManager = (InputMethodManager)GetSystemService(InputMethodService);
                inputManager.HideSoftInputFromWindow(_SearchView.WindowToken, HideSoftInputFlags.None);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
        private async void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchText = e.NewText;

                if (string.IsNullOrEmpty(SearchText) || string.IsNullOrWhiteSpace(SearchText))
                {
                    return;
                }

                SearchView.ClearFocus();

                //Show a progress
                RunOnUiThread(() => { AndHUD.Shared.Show(this, GetText(Resource.String.Lbl_Loading)); });

                var latLng = await GetLocationFromAddress(SearchText.Replace(" ", ""));

                if (latLng != null)
                {
                    RunOnUiThread(() => { AndHUD.Shared.Dismiss(this); });

                    DeviceAddress = SearchText;

                    Lat = latLng.Latitude;
                    Lng = latLng.Longitude;

                    // Creating a marker
                    MarkerOptions markerOptions = new MarkerOptions();

                    // Setting the position for the marker
                    markerOptions.SetPosition(latLng);

                    var addresses = await ReverseGeocodeCurrentLocation(latLng);

                    if (addresses != null)
                    {
                        DeviceAddress = addresses.GetAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()
                        //string city = addresses.Locality;
                        //string state = addresses.AdminArea;
                        //string country = addresses.CountryName;
                        //string postalCode = addresses.PostalCode;
                        //string knownName = addresses.FeatureName; // Only if available else return NULL

                        // Setting the title for the marker.
                        // This will be displayed on taping the marker
                        markerOptions.SetTitle(DeviceAddress);
                    }

                    // Clears the previously touched position
                    Map.Clear();

                    // Animating to the touched position
                    Map.AnimateCamera(CameraUpdateFactory.NewLatLng(latLng));

                    // Placing a marker on the touched position
                    Map.AddMarker(markerOptions);

                    CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
                    builder.Target(latLng);
                    builder.Zoom(18);
                    builder.Bearing(155);
                    builder.Tilt(65);

                    CameraPosition cameraPosition = builder.Build();

                    CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);
                    Map.MoveCamera(cameraUpdate);
                }
                else
                {
                    RunOnUiThread(() => { AndHUD.Shared.Dismiss(this); });


                    //Error Message
                    Toast.MakeText(this, GetText(Resource.String.Lbl_Error_DisplayAddress), ToastLength.Short).Show();
                }
            }
            catch (Exception exception)
            {
                RunOnUiThread(() => { AndHUD.Shared.Dismiss(this); });
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 21
0
 private void MainPageSearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs queryTextSubmitEventArgs)
 {
     ViewModel.OnSearchInputSubmit();
     MainPageSearchView.ClearFocus();
 }
 private void SearchViewSearchItems_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     thisFragmentView.RequestFocus(); //hidekeyboard
 }
Exemplo n.º 23
0
 private void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     //hide keyboard??
     (sender as SearchView).ClearFocus();
 }
Exemplo n.º 24
0
 private void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs queryTextSubmitEventArgs)
 {
     this.Search(queryTextSubmitEventArgs.Query);
 }
 private void SearchViewOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs queryTextSubmitEventArgs)
 {
     AndroidUtilities.HideKeyboard();
     ViewModel.SearchCommand.Execute(null);
 }
Exemplo n.º 26
0
 private void OnSearchSubmitted(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     ViewModel.SearchRecipesCommand.Execute(e.Query);
     Toolbar.Title = GetTitle(ViewModel.Query);
     e.Handled     = true;
 }
        void HandleQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            InputMethodManager imm = CrossCurrentActivity.Current.Activity.GetSystemService(Context.InputMethodService) as InputMethodManager;

            imm.HideSoftInputFromWindow(SearchView.WindowToken, HideSoftInputFlags.None);
        }
Exemplo n.º 28
0
        private void SearchBoxOnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                SearchBox.ClearFocus();
                SongsTab.MAdapter.SoundsList.Clear();
                SongsTab.MAdapter.NotifyDataSetChanged();

                AlbumsTab.MAdapter.AlbumsList.Clear();
                AlbumsTab.MAdapter.NotifyDataSetChanged();

                PlaylistTab.MAdapter.PlaylistList.Clear();
                PlaylistTab.MAdapter.NotifyDataSetChanged();

                ArtistsTab.MAdapter.UsersList.Clear();
                ArtistsTab.MAdapter.NotifyDataSetChanged();

                OffsetSongs    = "0";
                OffsetAlbums   = "0";
                OffsetPlaylist = "0";
                OffsetArtists  = "0";

                if (Methods.CheckConnectivity())
                {
                    if (SongsTab.MAdapter.SoundsList.Count > 0)
                    {
                        SongsTab.MAdapter.SoundsList.Clear();
                        SongsTab.MAdapter.NotifyDataSetChanged();
                    }

                    if (AlbumsTab.MAdapter.AlbumsList.Count > 0)
                    {
                        AlbumsTab.MAdapter.AlbumsList.Clear();
                        AlbumsTab.MAdapter.NotifyDataSetChanged();
                    }

                    SongsTab.ProgressBarLoader.Visibility = ViewStates.Visible;
                    SongsTab.EmptyStateLayout.Visibility  = ViewStates.Gone;
                    StartApiService();
                }
                else
                {
                    if (SongsTab.Inflated == null)
                    {
                        SongsTab.Inflated = SongsTab.EmptyStateLayout.Inflate();
                    }

                    EmptyStateInflater x = new EmptyStateInflater();
                    x.InflateLayout(SongsTab.Inflated, EmptyStateInflater.Type.NoConnection);
                    if (x.EmptyStateButton.HasOnClickListeners)
                    {
                        x.EmptyStateButton.Click -= EmptyStateButtonOnClick;
                        x.EmptyStateButton.Click -= TryAgainButton_Click;
                    }

                    x.EmptyStateButton.Click += TryAgainButton_Click;
                    SongsTab.ProgressBarLoader.Visibility = ViewStates.Gone;
                    SongsTab.EmptyStateLayout.Visibility  = ViewStates.Visible;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }