Example #1
0
 void HandleQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     if (Element is ISearchPage searchPage)
     {
         searchPage.SearchTextEvent(e.NewText);
     }
 }
Example #2
0
        private async void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            try
            {
                this.searchToken?.Cancel();
                this.searchToken = new CancellationTokenSource();
                this.ShowListViewMessage("Loading...");
                this.adapter.Clear();
                var client  = new WebClient();
                var qstring = e.Query.Replace(".", string.Empty).Replace("/", string.Empty);
                var uri     = new System.Uri("http://hq.skivent.com.co:8080/search/" + qstring + ".json", UriKind.Absolute);
                var ret     = await Run(() => client.DownloadString(uri), this.searchToken.Token);

                var songs = this.MapSongs(ret);
                if (songs.Any())
                {
                    this.adapter          = new SongResultsAdapter(this, songs);
                    this.listView.Adapter = this.adapter;
                    this.ShowListView();
                }
                else
                {
                    this.ShowListViewMessage("No results");
                }
            }
            catch (Exception ex)
            {
                this.ShowListViewMessage($"Error loading search results: {ex.Message}");
            }
            finally
            {
                this.searchToken = null;
            }
        }
Example #3
0
 private void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     SharedComponents.ShownMovies           = WaitForItBLL.Singleton.GetMoviesBySearch(e.Query);
     filmsFragment.FilmsListView.DataSource = SharedComponents.ShownMovies;
     LoadListFragment();
     Window.SetSoftInputMode(SoftInput.StateHidden);
 }
Example #4
0
        private async void SearchBar_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            if (progessBar.Visibility == Android.Views.ViewStates.Invisible)
            {
                ImageView logo = FindViewById <ImageView>(Resource.Id.imageView1);

                FindViewById <TextView>(Resource.Id.Temp).Text      = "";
                FindViewById <TextView>(Resource.Id.Pressure).Text  = "";
                FindViewById <TextView>(Resource.Id.windSpeed).Text = "";

                logo.SetImageResource(0);

                progessBar.Visibility = Android.Views.ViewStates.Visible;
                searchBar.ClearFocus();

                var weather = await Core.Core.GetWeatherNow(searchBar.Query);

                if (weather != null)
                {
                    FindViewById <TextView>(Resource.Id.Temp).Text      = weather.Temperature;
                    FindViewById <TextView>(Resource.Id.Pressure).Text  = weather.Pressure;
                    FindViewById <TextView>(Resource.Id.windSpeed).Text = weather.WindSpeed;

                    SetIcon(weather.WeatherType, logo);
                }
                else
                {
                    FindViewById <TextView>(Resource.Id.Temp).Text = "Something went wrong.";
                }
                progessBar.Visibility = Android.Views.ViewStates.Invisible;
                FindViewById <Button>(Resource.Id.fiveDayForecast).Visibility = Android.Views.ViewStates.Visible;
            }
        }
        void SearchBar_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            Intent ViewResoults = new Intent(Activity, typeof(BeSmart_ViewResoult));

            ViewResoults.PutExtra("Distance", ChangeDistance.Text);
            ViewResoults.PutExtra("Query", e.Query);
            Activity.StartActivity(ViewResoults);
        }
Example #6
0
 private void capturaTexto(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     e.Handled = true;
     search.ClearFocus();
     ControleMapa.Limpar();
     modoDirecao = false;
     BuscaEstacionamento(e.Query.Trim());
 }
        private void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            ViewModel.ParamSearch = searchView.Query;
            ViewModel.SearchArtistCommand.Execute();

            InputMethodManager imm = (InputMethodManager)Context.GetSystemService(Context.InputMethodService);

            imm.HideSoftInputFromWindow(searchView.WindowToken, 0);
        }
        private async void _searchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            InputMethodManager imm = (InputMethodManager)Context.GetSystemService("input_method");

            imm.HideSoftInputFromWindow(((SearchView)sender).WindowToken, HideSoftInputFlags.None);
            e.Handled = true;

            await GetList();
        }
Example #9
0
//              //  case "HELP":
//                    //                    creedOpen = false; catechismOpen = false; confessionOpen = false; helpOpen = true;
//                    //                    SetContentView(Resource.Layout.main);
//                    //                    FindViewById<TextView>(Resource.Id.appTitle).Text = "Help Page";
//                    //                    FindViewById<TextView>(Resource.Id.searchByLabel).Text = GetString(Resource.String.catechism_help);
//                    //                    FindViewById<TextView>(Resource.Id.catechismPgh).Text = GetString(Resource.String.catechismPgh);
//                    //                    FindViewById<TextView>(Resource.Id.confessionHelp).Text = GetString(Resource.String.confession_help);
//                    //                    FindViewById<TextView>(Resource.Id.confessionPgh).Text = GetString(Resource.String.confessionPgh);
//                    //                    FindViewById<TextView>(Resource.Id.creedHelp).Text = "Creed Help:";
//                    //                    FindViewById<TextView>(Resource.Id.creedPgh).Text = GetString(Resource.String.creedPgh);
//                    //                    FindViewById<TextView>(Resource.Id.otherStuff).Text = "Other Stuff:";
//                    //                    FindViewById<TextView>(Resource.Id.otherPgh).Text = GetString(Resource.String.other_pgh);
//                    //                    fab = FindViewById<FloatingActionButton>(Resource.Id.floatingActionButton);
//                    //                    fab.Click += Fab_Click;
//                    //                    FindViewById<TextView>(Resource.Id.sourceTV).Text = "All documents listed below are public domain, the websites below helped me with collecting them. \nThe formatting on the page was used as a guide to formatting the files needed for the app." +

//                    //"    \n\nApostle's Creed: https://reformed.org/documents/apostles_creed.html " +
//                    //"    \n1618 Belgic Confession: https://reformed.org/documents/BelgicConfession.html " +
//                    //    "\n1646 Westminster Confession of Faith: https://reformed.org/documents/wcf_with_proofs/index.html" +
//                    //    "\n1689 London Baptist Confession of Faith: https://reformed.org/documents/baptist_1689.html" +
//                    //    "\n1658 Savoy Declaration of Faith and Order: https://reformed.org/documents/Savoy_Declaration/index.html" +
//                    //   "\nWestminster Shorter Catechism: https://reformed.org/documents/wsc/index.html" +
//                    //   " \nWestminster Larger Catechism: https://reformed.org/documents/wlc_w_proofs/index.html " +
//                    //"    \nHeidelberg Catechism: https://reformed.org/documents/heidelberg.html " +
//                    //    "\nNicean Creed: https://reformed.org/documents/nicene.html " +
//                    //   "\nAthanasian Creed: https://reformed.org/documents/athanasian.html  ";

//                    //                    break;
        #endregion
        //Search View Text Submit
        #region MyRegion
        private void Search_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            recurCall++;
            if (recurCall == 1)
            {
                string query = e.Query;
                Search(query);
            }
        }
Example #10
0
 void BusquedaCliente_QuerySubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     if (e.Query == "")
     {
         LoadData();
     }
     else
     {
         LoadDataBusqueda(e.Query);
     }
 }
Example #11
0
 void BusquedaProducto_QuerySubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     if (e.Query == "")
     {
         LoadDataBusq("%");
     }
     else
     {
         LoadDataBusq(e.Query);
     }
 }
Example #12
0
        async private void SrchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(e.Query))
            {
                return;
            }

            // TODO: Must make SMSManager accept await
            _smsManager.SortSMSMessagesBy(e.Query);
            // TODO: crash after populate. It might be SMSManager
            PopulateListView();
        }
Example #13
0
        private void Sview_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            new Thread(() =>
            {
                string query = ((SearchView)sender).Query;
                HideKeyboard();

                Intent i = new Intent(context, typeof(SearchResults));
                i.PutExtra("query", query);
                ((Activity)context).StartActivity(i);
            }).Start();
        }
Example #14
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;
        }
Example #15
0
        void CaixaPesquisa_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            caixaPesquisa.ClearFocus();
            if (!e.Query.Trim().Equals(""))
            {
                Console.WriteLine("Pesquisa: " + e.Query);

                // passar a lista
                List <PetiscoModel> lista;
                if (filtro1.Visibility.Equals(ViewStates.Gone))
                {
                    lista = ApiHTTP.GetSugestoes(user.Username, e.Query, null, null, null);
                }
                else
                {
                    int  min, max;
                    bool minB   = Int32.TryParse(editMin.Text, out min);
                    bool maxB   = Int32.TryParse(editMax.Text, out max);
                    int? minRes = null;
                    if (minB)
                    {
                        minRes = min;
                    }
                    int?maxRes = null;
                    if (maxB)
                    {
                        maxRes = max;
                    }
                    lista = ApiHTTP.GetSugestoes(user.Username, e.Query, minRes, maxRes, distSB.Progress);
                }

                if (lista.Count == 0)
                {
                    Toast.MakeText(this, "Não há sugestões para esta pesquisa.", ToastLength.Short).Show();
                    return;
                }

                ((MainApplication)Application.Context).SetPetiscos(lista);
                // mudar para a vista de lista de petiscos
                Intent i = new Intent(this, typeof(PetiscosListActivity));
                StartActivity(i);
            }
            else
            {
                Console.WriteLine("Nenhuma Pesquisa");
                Toast.MakeText(this, "Escreva algo para pesquisar", ToastLength.Short).Show();
            }
        }
        private void searchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            var searchPage = Element as MyCustomPage;

            if (searchPage == null)
            {
                return;
            }
            searchPage.SearchText = e.Query;
            searchPage.SearchCommand?.Execute(e.Query);
            e.Handled = true;
        }
Example #17
0
        private async Task SearchForSong(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            var dialog = DisplayHelper.MakeProgressDialog(this, "Searching...");

            dialog.Show();
            var dataService = new DataService();
            var content     = await dataService.GetRequestJson(tag + "Shortest video");

            var items = await DeserializeObjectAsync(content);

            dialog.Hide();
            songSearchView.ClearFocus();
            songListView.Adapter    = new VideoAdapter(Application.Context, items.items);
            songListView.ItemClick += async(s, events) => await StartPlayingSong(s, events);

            Window.SetSoftInputMode(SoftInput.StateHidden);
        }
        private void SearchViewButton_Click(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            var searchText                = e.Query;
            var companionPlantListView    = FindViewById <ListView>(Resource.Id.companionPlantListView);
            var companionPlantsRepository = new CompanionPlantsRepository();

            if (!string.IsNullOrEmpty(searchText))
            {
                _plants = companionPlantsRepository.GetPlants().Where(w => w.Plant.ToLower().Contains(searchText.ToLower()) ||
                                                                      w.Companions.Contains(searchText)).ToList <CompanionPlant>();
            }
            else
            {
                _plants = companionPlantsRepository.GetPlants();
            }
            companionPlantListView.Adapter = new CompanionPlantListAdapter(this, _plants);
            e.Handled = true;
        }
Example #19
0
 private void ColorSearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     GetColorItemsList(e.Query);
     colorAdapter.NotifyDataSetChanged();
 }
Example #20
0
 private void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     _data = FindTasks(e.Query);
     RenderItems(_listView, _data);
 }
 private void HandleQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     _searchProvider?.SearchCommand.Execute(e.Query);
 }
Example #22
0
 void OnSearchTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     SearchQuery = e.Query;
     Filter(this, new EventArgs());
     Console.WriteLine("OnQueryTextSubmit {0}", SearchQuery);
 }
Example #23
0
 //applyTextSubmittedFilter
 void applyTextSubmittedFilter(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     //todo: filter client list
     Toast.MakeText(this, "Soon to Implement. Searching for " + e.Query, ToastLength.Short).Show();
     e.Handled = true;
 }
        private void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            SearchView SearchView = FindViewById <SearchView>(Resource.Id.searchView1);

            GetMoviesAsync(SearchView.Query);
        }
 private void searchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     ExecuteSearch(e.Query);
 }
Example #26
0
 void OnQueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
 }
 void SearchView_QueryTextSubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     StartSearch();
     e.Handled = false;
 }
Example #28
0
 //I know this is wrong, but i will fix this later.
 // MvvmLight does not support EventHandler<T> binding
 //Binding library in the core project, does not support binding to event-to-command
 //So somehow i need to accomplish this task
 void OnQuerySubmit(object sender, SearchView.QueryTextSubmitEventArgs e)
 {
     _viewModel.UserIsTypingCommand.Execute(_searchView.Query);
 }
Example #29
0
        private async void submitQueryListener(object sender, SearchView.QueryTextSubmitEventArgs e)
        {
            MainActivity act        = (MainActivity)this.Activity;
            SearchView   searchView = (SearchView)act.FindViewById(Resource.Id.searchView1);
            string       input      = e.Query;

            searchView.SetIconifiedByDefault(true);
            searchView.OnActionViewCollapsed();
            searchView.Focusable = false;

            //Ping database by name
            string data = GetData();

            JArray        jsonArray    = JArray.Parse(data);
            List <string> searched_Loc = new List <string>();
            List <string> similar_Loc  = new List <string>();

            string debugMe    = "";
            string tempinput  = input;
            string inputBlock = tempinput;

            tempinput = RemoveSpecialCharacters(tempinput);
            tempinput = tempinput.Replace(" ", System.String.Empty);

            AddressLocator        tempAddress;
            List <AddressLocator> mAddresses = new List <AddressLocator>();

            for (int i = 0; i < jsonArray.Count; i++)
            {
                JToken json = jsonArray[i];
                string temp = (string)json["name"];
                temp = RemoveSpecialCharacters(temp);
                temp = temp.Replace(" ", System.String.Empty);
                if (((string)json["name"]).Equals(input, StringComparison.InvariantCultureIgnoreCase) || temp.Equals(tempinput, StringComparison.InvariantCultureIgnoreCase))
                {
                    //Location stuff - make sure user location permissions were give
                    if (act.CheckSelfPermission(Android.Manifest.Permission.AccessCoarseLocation) == (int)Android.Content.PM.Permission.Granted)
                    {
                        Geocoder        coder   = new Geocoder(act);
                        IList <Address> address = new List <Address>();


                        address = coder.GetFromLocationName(((string)json["street"]) + " " + ((string)json["city"]) + " " + ((string)json["state"]), 5);

                        float lon = (float)address.ElementAt(0).Longitude;
                        float lat = (float)address.ElementAt(0).Latitude;

                        tempAddress = new AddressLocator((string)json["name"], ((string)json["street"]) + " " + ((string)json["city"]) + " " + ((string)json["state"]), lon, lat);
                        mAddresses.Add(tempAddress);


                        userLocationObtained = true;
                    }
                    else // if not, grab list like before.
                    {
                        searched_Loc.Add(((string)json["name"]) + ": " + ((string)json["street"]) + " " + ((string)json["city"]) + " " + ((string)json["state"]));
                    }
                }
            }

            if (userLocationObtained)
            {
                //calculate distances
                CalculateAddressDistance(mAddresses);
                //sort distances
                mAddresses.Sort();

                for (int x = 0; x < mAddresses.Count; x++)
                {
                    searched_Loc.Add(mAddresses.ElementAt(x).Name + ": " + mAddresses.ElementAt(x).Address + " (" + mAddresses.ElementAt(x).Distance.ToString("n2") + " miles)");
                }
            }

            for (int j = 0; j < searched_Loc.Count; j++)
            {
                debugMe += searched_Loc[j];
                debugMe += "\n";
            }

            if (searched_Loc.Count == 0)
            {
                for (int i = 0; i < jsonArray.Count; i++)
                {
                    JToken json      = jsonArray[i];
                    bool   wordMatch = false;
                    string temp      = (string)json["name"];

                    string[] outputBlock = temp.Split(" ");

                    temp = RemoveSpecialCharacters(temp);
                    temp = temp.Replace(" ", System.String.Empty);

                    wordMatch = InputsMatch(inputBlock.ToLower(), outputBlock);

                    if ((tempinput.StartsWith(temp.Substring(0, 2), StringComparison.InvariantCultureIgnoreCase) || wordMatch) && !userLocationObtained)
                    {
                        similar_Loc.Add(((string)json["name"]) + ": " + ((string)json["street"]) + " " + ((string)json["city"]) + " " + ((string)json["state"]));
                    }
                    else if ((tempinput.StartsWith(temp.Substring(0, 2), StringComparison.InvariantCultureIgnoreCase) || wordMatch) && userLocationObtained)
                    {
                        Geocoder        coder   = new Geocoder(act);
                        IList <Address> address = new List <Address>();


                        address = coder.GetFromLocationName(((string)json["street"]) + " " + ((string)json["city"]) + " " + ((string)json["state"]), 5);

                        float lon = (float)address.ElementAt(0).Longitude;
                        float lat = (float)address.ElementAt(0).Latitude;

                        tempAddress = new AddressLocator((string)json["name"], ((string)json["street"]) + " " + ((string)json["city"]) + " " + ((string)json["state"]), lon, lat);
                        mAddresses.Add(tempAddress);
                    }
                }
                if (userLocationObtained)
                {
                    //calculate distances
                    CalculateAddressDistance(mAddresses);
                    //sort distances
                    mAddresses.Sort();

                    for (int x = 0; x < mAddresses.Count; x++)
                    {
                        similar_Loc.Add(mAddresses.ElementAt(x).Name + ": " + mAddresses.ElementAt(x).Address + " (" + mAddresses.ElementAt(x).Distance.ToString("n2") + " miles)");
                    }
                }
            }

            mTv = act.FindViewById <ListView>(Resource.Id.searchResults);
            ArrayAdapter <string> arrayAdapter;

            if (searched_Loc.Count == 0 && similar_Loc.Count == 0)
            {
                Toast.MakeText(MainActivity.activity, "There were no results for that Location.", ToastLength.Long).Show();
                arrayAdapter = new ArrayAdapter <string>(act, Android.Resource.Layout.SimpleListItem1, similar_Loc);
            }
            else if (searched_Loc.Count == 0)
            {
                arrayAdapter = new ArrayAdapter <string>(act, Android.Resource.Layout.SimpleListItem1, similar_Loc);
            }
            else
            {
                arrayAdapter = new ArrayAdapter <string>(act, Android.Resource.Layout.SimpleListItem1, searched_Loc);
            }

            mTv.Adapter = arrayAdapter;
            mTv.SetFooterDividersEnabled(true);
            mTv.SetHeaderDividersEnabled(true);
        }