1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-17 15:27:43 +01:00

searchbar on ciphers page

This commit is contained in:
Kyle Spearrin 2019-05-04 00:14:49 -04:00
parent 2553938380
commit 128935eb9f
8 changed files with 70 additions and 1 deletions

View File

@ -79,6 +79,7 @@
<Compile Include="Autofill\FilledItem.cs" /> <Compile Include="Autofill\FilledItem.cs" />
<Compile Include="Autofill\Parser.cs" /> <Compile Include="Autofill\Parser.cs" />
<Compile Include="Autofill\SavedItem.cs" /> <Compile Include="Autofill\SavedItem.cs" />
<Compile Include="Renderers\CustomSearchBarRenderer.cs" />
<Compile Include="SplashActivity.cs" /> <Compile Include="SplashActivity.cs" />
<Compile Include="Renderers\BoxedView\BoxedViewRecyclerAdapter.cs" /> <Compile Include="Renderers\BoxedView\BoxedViewRecyclerAdapter.cs" />
<Compile Include="Renderers\BoxedView\BoxedViewRenderer.cs" /> <Compile Include="Renderers\BoxedView\BoxedViewRenderer.cs" />

View File

@ -0,0 +1,30 @@
using Android.Content;
using Bit.Droid.Renderers.BoxedView;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(SearchBar), typeof(CustomSearchBarRenderer))]
namespace Bit.Droid.Renderers.BoxedView
{
public class CustomSearchBarRenderer : SearchBarRenderer
{
public CustomSearchBarRenderer(Context context)
: base(context)
{ }
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
{
base.OnElementChanged(e);
if(Control != null && e.NewElement != null)
{
try
{
var magId = Resources.GetIdentifier("android:id/search_mag_icon", null, null);
var magImage = (Android.Widget.ImageView)Control.FindViewById(magId);
magImage.LayoutParameters = new Android.Widget.LinearLayout.LayoutParams(0, 0);
}
catch { }
}
}
}
}

View File

@ -18,6 +18,7 @@
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item> <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
<item name="android:colorActivatedHighlight">@android:color/transparent</item> <item name="android:colorActivatedHighlight">@android:color/transparent</item>
<item name="android:textCursorDrawable">@null</item>
</style> </style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog"> <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">

View File

@ -22,6 +22,27 @@
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<NavigationPage.TitleView>
<StackLayout
Orientation="Horizontal"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
Spacing="0"
Padding="0">
<controls:MiButton
Text="&#xe5c4;"
BackgroundColor="Transparent"
Padding="0"
WidthRequest="37"
FontSize="25"
VerticalOptions="CenterAndExpand" />
<SearchBar
HorizontalOptions="FillAndExpand"
BackgroundColor="Transparent"
Placeholder="{u:I18n SearchVault}" />
</StackLayout>
</NavigationPage.TitleView>
<StackLayout x:Name="_mainLayout"> <StackLayout x:Name="_mainLayout">
<Label IsVisible="{Binding ShowNoData}" <Label IsVisible="{Binding ShowNoData}"
Text="{Binding NoDataText}" Text="{Binding NoDataText}"

View File

@ -98,7 +98,7 @@ namespace Bit.App.Pages
private async void Search_Clicked(object sender, System.EventArgs e) private async void Search_Clicked(object sender, System.EventArgs e)
{ {
await Navigation.PushModalAsync(new CiphersPage(), false); await Navigation.PushModalAsync(new NavigationPage(new CiphersPage()), false);
} }
} }
} }

View File

@ -48,6 +48,16 @@
<Setter Property="FontAttributes" <Setter Property="FontAttributes"
Value="Bold" /> Value="Bold" />
</Style> </Style>
<Style TargetType="SearchBar">
<Setter Property="BackgroundColor"
Value="Transparent" />
<Setter Property="TextColor"
Value="{StaticResource HeaderEntryTextColor}" />
<Setter Property="CancelButtonColor"
Value="{StaticResource HeaderEntryTextColor}" />
<Setter Property="PlaceholderColor"
Value="{StaticResource HeaderEntryPlaceholderColor}" />
</Style>
<!-- Buttons --> <!-- Buttons -->
<Style TargetType="Button" <Style TargetType="Button"

View File

@ -18,6 +18,9 @@
<Color x:Key="BoxBorderColor">#f0f0f0</Color> <Color x:Key="BoxBorderColor">#f0f0f0</Color>
<Color x:Key="BoxHeaderTextColor">#3c8dbc</Color> <Color x:Key="BoxHeaderTextColor">#3c8dbc</Color>
<Color x:Key="HeaderEntryTextColor">#ffffff</Color>
<Color x:Key="HeaderEntryPlaceholderColor">#707070</Color>
<Color x:Key="ListItemBorderColor">#f0f0f0</Color> <Color x:Key="ListItemBorderColor">#f0f0f0</Color>
<Color x:Key="ListHeaderTextColor">#3c8dbc</Color> <Color x:Key="ListHeaderTextColor">#3c8dbc</Color>
</ResourceDictionary> </ResourceDictionary>

View File

@ -18,6 +18,9 @@
<Color x:Key="BoxBorderColor">#dddddd</Color> <Color x:Key="BoxBorderColor">#dddddd</Color>
<Color x:Key="BoxHeaderTextColor">#3c8dbc</Color> <Color x:Key="BoxHeaderTextColor">#3c8dbc</Color>
<Color x:Key="HeaderEntryTextColor">#ffffff</Color>
<Color x:Key="HeaderEntryPlaceholderColor">#c0dbeb</Color>
<Color x:Key="ListItemBorderColor">#f0f0f0</Color> <Color x:Key="ListItemBorderColor">#f0f0f0</Color>
<Color x:Key="ListHeaderTextColor">#3c8dbc</Color> <Color x:Key="ListHeaderTextColor">#3c8dbc</Color>
</ResourceDictionary> </ResourceDictionary>