public ButtonGallery ()
{
//ShellAppearance.SetNavBarVisible(this, false);
- Shell.SetSearchHandler(this, new SearchHandler() { SearchBoxVisibility = SearchBoxVisiblity.Collapsable });
+ Shell.SetSearchHandler(this, new SearchHandler() { SearchBoxVisibility = SearchBoxVisibility.Collapsible });
BackgroundColor = new Color (0.9);
var normal = new Button { Text = "Normal Button" };
InitializeComponent();
ViewModel = new HomeViewModel();
NavigationPage.SetBackButtonTitle(this, "");
- //AddSearchHandler("Search", SearchBoxVisiblity.Expanded);
+ //AddSearchHandler("Search", SearchBoxVisibility.Expanded);
}
protected override void OnAppearing()
(sender as ListView).SelectedItem = null;
}
- protected void AddSearchHandler(string placeholder, SearchBoxVisiblity visibility)
+ protected void AddSearchHandler(string placeholder, SearchBoxVisibility visibility)
{
var searchHandler = new BasePage.CustomSearchHandler();
1, 2);
grid.Children.Add(MakeButton("Add Search",
- () => AddSearchHandler("Added Search", SearchBoxVisiblity.Expanded)),
+ () => AddSearchHandler("Added Search", SearchBoxVisibility.Expanded)),
2, 2);
grid.Children.Add(MakeButton("Add Toolbar",
2, 5);
grid.Children.Add(MakeButton("Hide Search",
- () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisiblity.Hidden),
+ () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisibility.Hidden),
0, 6);
grid.Children.Add(MakeButton("Collapse Search",
- () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisiblity.Collapsable),
+ () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisibility.Collapsible),
1, 6);
grid.Children.Add(MakeButton("Show Search",
- () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisiblity.Expanded),
+ () => Shell.GetSearchHandler(this).SearchBoxVisibility = SearchBoxVisibility.Expanded),
2, 6);
grid.Children.Add(MakeButton("Set Back",
}
}
- protected void AddSearchHandler(string placeholder, SearchBoxVisiblity visibility)
+ protected void AddSearchHandler(string placeholder, SearchBoxVisibility visibility)
{
var searchHandler = new CustomSearchHandler();
{
public UpdatesPage() : base("Available Updates", Color.Default)
{
- AddSearchHandler("Search Updates", SearchBoxVisiblity.Collapsable);
+ AddSearchHandler("Search Updates", SearchBoxVisibility.Collapsible);
}
}
{
public InstalledPage() : base("Installed Items", Color.Default)
{
- AddSearchHandler("Search Installed", SearchBoxVisiblity.Collapsable);
+ AddSearchHandler("Search Installed", SearchBoxVisibility.Collapsible);
}
}
{
public LibraryPage() : base("My Library", Color.Default)
{
- AddSearchHandler("Search Apps", SearchBoxVisiblity.Collapsable);
+ AddSearchHandler("Search Apps", SearchBoxVisibility.Collapsible);
}
}
{
public HomePage() : base("Store Home", Color.Default)
{
- AddSearchHandler("Search Apps", SearchBoxVisiblity.Expanded);
+ AddSearchHandler("Search Apps", SearchBoxVisibility.Expanded);
}
}
{
public GamesPage() : base("Games", Color.Default)
{
- AddSearchHandler("Search Games", SearchBoxVisiblity.Expanded);
+ AddSearchHandler("Search Games", SearchBoxVisibility.Expanded);
}
}
{
public MoviesPage() : base("Hot Movies", Color.Default)
{
- AddSearchHandler("Search Movies", SearchBoxVisiblity.Expanded);
+ AddSearchHandler("Search Movies", SearchBoxVisibility.Expanded);
}
}
{
public BooksPage() : base("Bookstore", Color.Default)
{
- AddSearchHandler("Search Books", SearchBoxVisiblity.Expanded);
+ AddSearchHandler("Search Books", SearchBoxVisibility.Expanded);
}
}
{
public MusicPage() : base("Music", Color.Default)
{
- AddSearchHandler("Search Music", SearchBoxVisiblity.Expanded);
+ AddSearchHandler("Search Music", SearchBoxVisibility.Expanded);
}
}
{
public NewsPage() : base("Newspapers", Color.Default)
{
- AddSearchHandler("Search Papers", SearchBoxVisiblity.Expanded);
+ AddSearchHandler("Search Papers", SearchBoxVisibility.Expanded);
}
}
namespace Xamarin.Forms
{
- public enum SearchBoxVisiblity
+ public enum SearchBoxVisibility
{
Hidden,
- Collapsable,
+ Collapsible,
Expanded
}
}
\ No newline at end of file
propertyChanged: OnQueryChanged);
public static readonly BindableProperty SearchBoxVisibilityProperty =
- BindableProperty.Create(nameof(SearchBoxVisibility), typeof(SearchBoxVisiblity), typeof(SearchHandler), SearchBoxVisiblity.Expanded, BindingMode.OneWay);
+ BindableProperty.Create(nameof(SearchBoxVisibility), typeof(SearchBoxVisibility), typeof(SearchHandler), SearchBoxVisibility.Expanded, BindingMode.OneWay);
static readonly BindablePropertyKey SelectedItemPropertyKey =
BindableProperty.CreateReadOnly (nameof(SelectedItem), typeof(object), typeof(SearchHandler), null, BindingMode.OneWayToSource);
set { SetValue(QueryIconNameProperty, value); }
}
- public SearchBoxVisiblity SearchBoxVisibility
+ public SearchBoxVisibility SearchBoxVisibility
{
- get { return (SearchBoxVisiblity)GetValue(SearchBoxVisibilityProperty); }
+ get { return (SearchBoxVisibility)GetValue(SearchBoxVisibilityProperty); }
set { SetValue(SearchBoxVisibilityProperty, value); }
}
}
SearchHandler = Shell.GetSearchHandler(page);
- if (SearchHandler != null && SearchHandler.SearchBoxVisibility != SearchBoxVisiblity.Hidden)
+ if (SearchHandler != null && SearchHandler.SearchBoxVisibility != SearchBoxVisibility.Hidden)
{
var context = _shellContext.AndroidContext;
if (_searchView == null)
_searchView.SearchConfirmed += OnSearchConfirmed;
}
- if (SearchHandler.SearchBoxVisibility == SearchBoxVisiblity.Collapsable)
+ if (SearchHandler.SearchBoxVisibility == SearchBoxVisibility.Collapsible)
{
var placeholder = new Java.Lang.String(SearchHandler.Placeholder);
var item = menu.Add(placeholder);
item.SetActionView(_searchView.View);
item.Dispose();
}
- else if (SearchHandler.SearchBoxVisibility == SearchBoxVisiblity.Expanded)
+ else if (SearchHandler.SearchBoxVisibility == SearchBoxVisibility.Expanded)
{
_searchView.ShowKeyboardOnAttached = false;
if (_searchView.View.Parent != _toolbar)
void OnSearchViewAttachedToWindow(object sender, AView.ViewAttachedToWindowEventArgs e)
{
// We only need to do this tint hack when using collapsed search handlers
- if (SearchHandler.SearchBoxVisibility != SearchBoxVisiblity.Collapsable)
+ if (SearchHandler.SearchBoxVisibility != SearchBoxVisibility.Collapsible)
return;
for (int i = 0; i < _toolbar.ChildCount; i++)
protected virtual void UpdateSearchVisibility(UISearchController searchController)
{
var visibility = SearchHandler.SearchBoxVisibility;
- if (visibility == SearchBoxVisiblity.Hidden)
+ if (visibility == SearchBoxVisibility.Hidden)
{
if (searchController != null)
{
NavigationItem.TitleView = null;
}
}
- else if (visibility == SearchBoxVisiblity.Collapsable || visibility == SearchBoxVisiblity.Expanded)
+ else if (visibility == SearchBoxVisibility.Collapsible || visibility == SearchBoxVisibility.Expanded)
{
if (Forms.IsiOS11OrNewer)
{
NavigationItem.SearchController = _searchController;
- NavigationItem.HidesSearchBarWhenScrolling = visibility == SearchBoxVisiblity.Collapsable;
+ NavigationItem.HidesSearchBarWhenScrolling = visibility == SearchBoxVisibility.Collapsible;
}
else
{
_searchController = new UISearchController(_resultsRenderer?.ViewController);
var visibility = SearchHandler.SearchBoxVisibility;
- if (visibility != SearchBoxVisiblity.Hidden)
+ if (visibility != SearchBoxVisibility.Hidden)
{
if (Forms.IsiOS11OrNewer)
NavigationItem.SearchController = _searchController;
UpdateSearchIsEnabled(_searchController);
searchBar.SearchButtonClicked += SearchButtonClicked;
if (Forms.IsiOS11OrNewer)
- NavigationItem.HidesSearchBarWhenScrolling = visibility == SearchBoxVisiblity.Collapsable;
+ NavigationItem.HidesSearchBarWhenScrolling = visibility == SearchBoxVisibility.Collapsible;
var icon = SearchHandler.QueryIcon;
if (icon != null)
void UpdateVerticalBounce()
{
// Normally we dont want to do this unless this scrollview is vertical and its
- // element is the child of a Page with a SearchHandler that is collapsable.
+ // element is the child of a Page with a SearchHandler that is collapsible.
// If we can't bounce in that case you may not be able to expose the handler.
// Also the hiding behavior only depends on scroll on iOS 11. In 10 and below
// the search goes in the TitleView so there is nothing to collapse/expand.
if (parent is Page)
{
var searchHandler = Shell.GetSearchHandler(parent);
- if (searchHandler?.SearchBoxVisibility == SearchBoxVisiblity.Collapsable)
+ if (searchHandler?.SearchBoxVisibility == SearchBoxVisibility.Collapsible)
_scrollView.AlwaysBounceVertical = true;
return;
}