예제 #1
0
        private async void Search(string text)
        {
            IsLoading         = true;
            _clear.Visibility = string.IsNullOrEmpty(text) ? ViewStates.Invisible : ViewStates.Visible;
            _filteredSources  = await SearchAsync(text);

            _listResults.Adapter = _resultAdapter = new SearchAdapter(_context, _filteredSources, _search);
            ItemsFiltered?.Invoke(this, new SearchBoxItemFilteredEventArgs(_filteredSources.ToList()));
            IsLoading = false;
        }
예제 #2
0
        private void OpenSearch()
        {
            if (_isSearching)
            {
                return;
            }
            _placeholder.Visibility = ViewStates.Gone;
            _search.Visibility      = ViewStates.Visible;
            _search.RequestFocus();
            _listResults.Visibility = ViewStates.Visible;
            _clear.Visibility       = string.IsNullOrEmpty(_search.Text) ? ViewStates.Invisible : ViewStates.Visible;
            _resultAdapter          = new SearchAdapter(_context, _filteredSources, _search);
            _listResults.Adapter    = _resultAdapter;

            _drawerArrowDrawable.setParameter(1);
            _drawerArrowDrawable.setFlip(true);
            EnableKeyboard();
            _isSearching = true;
        }