mirror of
https://github.com/bitwarden/android.git
synced 2025-03-29 00:59:19 +03:00
search bar for ios
This commit is contained in:
parent
38f91bce1c
commit
d81585ccc3
5 changed files with 58 additions and 43 deletions
|
@ -20,34 +20,33 @@
|
||||||
<u:DateTimeConverter x:Key="dateTime" />
|
<u:DateTimeConverter x:Key="dateTime" />
|
||||||
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1"
|
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1"
|
||||||
x:Name="_closeItem" x:Key="closeItem" />
|
x:Name="_closeItem" x:Key="closeItem" />
|
||||||
|
<StackLayout
|
||||||
|
Orientation="Horizontal"
|
||||||
|
VerticalOptions="FillAndExpand"
|
||||||
|
HorizontalOptions="FillAndExpand"
|
||||||
|
Spacing="0"
|
||||||
|
Padding="0"
|
||||||
|
x:Name="_titleLayout"
|
||||||
|
x:Key="titleLayout">
|
||||||
|
<controls:MiButton
|
||||||
|
StyleClass="btn-title, btn-title-platform"
|
||||||
|
Text=""
|
||||||
|
VerticalOptions="CenterAndExpand"
|
||||||
|
Clicked="BackButton_Clicked"
|
||||||
|
x:Name="_backButton" />
|
||||||
|
<SearchBar
|
||||||
|
x:Name="_searchBar"
|
||||||
|
HorizontalOptions="FillAndExpand"
|
||||||
|
TextChanged="SearchBar_TextChanged"
|
||||||
|
SearchButtonPressed="SearchBar_SearchButtonPressed"
|
||||||
|
Placeholder="{Binding PageTitle}" />
|
||||||
|
</StackLayout>
|
||||||
|
<BoxView StyleClass="list-section-separator-bottom, list-section-separator-bottom-platform"
|
||||||
|
x:Name="_separator" x:Key="separator" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</ContentPage.Resources>
|
</ContentPage.Resources>
|
||||||
|
|
||||||
<NavigationPage.TitleView>
|
<StackLayout x:Name="_mainLayout" Spacing="0" Padding="0">
|
||||||
<StackLayout
|
|
||||||
Orientation="Horizontal"
|
|
||||||
VerticalOptions="FillAndExpand"
|
|
||||||
HorizontalOptions="FillAndExpand"
|
|
||||||
Spacing="0"
|
|
||||||
Padding="0"
|
|
||||||
x:Name="_titleLayout">
|
|
||||||
<controls:MiButton
|
|
||||||
StyleClass="btn-title, btn-title-platform"
|
|
||||||
Text=""
|
|
||||||
VerticalOptions="CenterAndExpand"
|
|
||||||
Clicked="BackButton_Clicked"
|
|
||||||
x:Name="_backButton" />
|
|
||||||
<SearchBar
|
|
||||||
x:Name="_searchBar"
|
|
||||||
HorizontalOptions="FillAndExpand"
|
|
||||||
BackgroundColor="Transparent"
|
|
||||||
TextChanged="SearchBar_TextChanged"
|
|
||||||
SearchButtonPressed="SearchBar_SearchButtonPressed"
|
|
||||||
Placeholder="{Binding PageTitle}" />
|
|
||||||
</StackLayout>
|
|
||||||
</NavigationPage.TitleView>
|
|
||||||
|
|
||||||
<StackLayout x:Name="_mainLayout">
|
|
||||||
<controls:FaLabel IsVisible="{Binding ShowSearchDirection}"
|
<controls:FaLabel IsVisible="{Binding ShowSearchDirection}"
|
||||||
Text=""
|
Text=""
|
||||||
StyleClass="text-muted"
|
StyleClass="text-muted"
|
||||||
|
@ -62,13 +61,13 @@
|
||||||
HorizontalOptions="CenterAndExpand"
|
HorizontalOptions="CenterAndExpand"
|
||||||
HorizontalTextAlignment="Center" />
|
HorizontalTextAlignment="Center" />
|
||||||
<ListView x:Name="_listView"
|
<ListView x:Name="_listView"
|
||||||
IsVisible="{Binding ShowList}"
|
IsVisible="{Binding ShowList}"
|
||||||
ItemsSource="{Binding Ciphers}"
|
ItemsSource="{Binding Ciphers}"
|
||||||
VerticalOptions="FillAndExpand"
|
VerticalOptions="FillAndExpand"
|
||||||
HasUnevenRows="true"
|
HasUnevenRows="true"
|
||||||
CachingStrategy="RecycleElement"
|
CachingStrategy="RecycleElement"
|
||||||
ItemSelected="RowSelected"
|
ItemSelected="RowSelected"
|
||||||
StyleClass="list, list-platform">
|
StyleClass="list, list-platform">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate x:DataType="views:CipherView">
|
<DataTemplate x:DataType="views:CipherView">
|
||||||
<controls:CipherViewCell
|
<controls:CipherViewCell
|
||||||
|
|
|
@ -43,7 +43,13 @@ namespace Bit.App.Pages
|
||||||
if(Device.RuntimePlatform == Device.iOS)
|
if(Device.RuntimePlatform == Device.iOS)
|
||||||
{
|
{
|
||||||
ToolbarItems.Add(_closeItem);
|
ToolbarItems.Add(_closeItem);
|
||||||
_titleLayout.Children.Remove(_backButton);
|
_searchBar.Placeholder = AppResources.Search;
|
||||||
|
_mainLayout.Children.Insert(0, _searchBar);
|
||||||
|
_mainLayout.Children.Insert(1, _separator);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NavigationPage.SetTitleView(this, _titleLayout);
|
||||||
}
|
}
|
||||||
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
|
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,16 @@
|
||||||
<Setter Property="Margin"
|
<Setter Property="Margin"
|
||||||
Value="-4, 0, -4, -4" />
|
Value="-4, 0, -4, -4" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style TargetType="SearchBar">
|
||||||
|
<Setter Property="BackgroundColor"
|
||||||
|
Value="Transparent" />
|
||||||
|
<Setter Property="TextColor"
|
||||||
|
Value="{StaticResource TitleEntryTextColor}" />
|
||||||
|
<Setter Property="CancelButtonColor"
|
||||||
|
Value="{StaticResource TitleEntryTextColor}" />
|
||||||
|
<Setter Property="PlaceholderColor"
|
||||||
|
Value="{StaticResource TitleEntryPlaceholderColor}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
|
|
||||||
|
|
|
@ -124,16 +124,6 @@
|
||||||
<Setter Property="TextColor"
|
<Setter Property="TextColor"
|
||||||
Value="{StaticResource TitleTextColor}" />
|
Value="{StaticResource TitleTextColor}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style TargetType="SearchBar">
|
|
||||||
<Setter Property="BackgroundColor"
|
|
||||||
Value="Transparent" />
|
|
||||||
<Setter Property="TextColor"
|
|
||||||
Value="{StaticResource TitleEntryTextColor}" />
|
|
||||||
<Setter Property="CancelButtonColor"
|
|
||||||
Value="{StaticResource TitleEntryTextColor}" />
|
|
||||||
<Setter Property="PlaceholderColor"
|
|
||||||
Value="{StaticResource TitleEntryPlaceholderColor}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- List -->
|
<!-- List -->
|
||||||
<Style TargetType="ListView"
|
<Style TargetType="ListView"
|
||||||
|
|
|
@ -26,6 +26,16 @@
|
||||||
<Setter Property="OnColor"
|
<Setter Property="OnColor"
|
||||||
Value="{StaticResource SwitchOnColor}" />
|
Value="{StaticResource SwitchOnColor}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style TargetType="SearchBar">
|
||||||
|
<Setter Property="BackgroundColor"
|
||||||
|
Value="{StaticResource ListHeaderBackgroundColor}" />
|
||||||
|
<Setter Property="TextColor"
|
||||||
|
Value="{StaticResource TextColor}" />
|
||||||
|
<Setter Property="CancelButtonColor"
|
||||||
|
Value="{StaticResource PrimaryColor}" />
|
||||||
|
<Setter Property="PlaceholderColor"
|
||||||
|
Value="{StaticResource MutedColor}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue