mirror of
https://github.com/bitwarden/mobile
synced 2025-12-26 13:13:28 +00:00
dark keyboard on dark themes. resolves #588
This commit is contained in:
@@ -20,6 +20,7 @@ namespace Bit.iOS.Renderers
|
||||
Control.TextContainerInset = new UIEdgeInsets(0, 0, 0, 0);
|
||||
Control.TextContainer.LineFragmentPadding = 0;
|
||||
UpdateTintColor();
|
||||
UpdateKeyboardAppearance();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,5 +37,13 @@ namespace Bit.iOS.Renderers
|
||||
{
|
||||
Control.TintColor = Element.TextColor.ToUIColor();
|
||||
}
|
||||
|
||||
private void UpdateKeyboardAppearance()
|
||||
{
|
||||
if(!Core.Utilities.ThemeHelpers.LightTheme)
|
||||
{
|
||||
Control.KeyboardAppearance = UIKeyboardAppearance.Dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace Bit.iOS.Renderers
|
||||
Control.ClearButtonMode = UITextFieldViewMode.WhileEditing;
|
||||
UpdateTintColor();
|
||||
UpdateFontSize();
|
||||
UpdateKeyboardAppearance();
|
||||
iOSHelpers.SetBottomBorder(Control);
|
||||
}
|
||||
}
|
||||
@@ -57,5 +58,13 @@ namespace Bit.iOS.Renderers
|
||||
{
|
||||
Control.TintColor = Element.TextColor.ToUIColor();
|
||||
}
|
||||
|
||||
private void UpdateKeyboardAppearance()
|
||||
{
|
||||
if(!Core.Utilities.ThemeHelpers.LightTheme)
|
||||
{
|
||||
Control.KeyboardAppearance = UIKeyboardAppearance.Dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,15 @@ namespace Bit.iOS.Renderers
|
||||
var descriptor = UIFontDescriptor.PreferredBody;
|
||||
Control.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
|
||||
iOSHelpers.SetBottomBorder(Control);
|
||||
UpdateKeyboardAppearance();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateKeyboardAppearance()
|
||||
{
|
||||
if(!Core.Utilities.ThemeHelpers.LightTheme)
|
||||
{
|
||||
Control.KeyboardAppearance = UIKeyboardAppearance.Dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
src/iOS/Renderers/CustomSearchBarRenderer.cs
Normal file
28
src/iOS/Renderers/CustomSearchBarRenderer.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Bit.iOS.Renderers;
|
||||
using UIKit;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.iOS;
|
||||
|
||||
[assembly: ExportRenderer(typeof(SearchBar), typeof(CustomSearchBarRenderer))]
|
||||
namespace Bit.iOS.Renderers
|
||||
{
|
||||
public class CustomSearchBarRenderer : SearchBarRenderer
|
||||
{
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
if(e.NewElement is SearchBar)
|
||||
{
|
||||
UpdateKeyboardAppearance();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateKeyboardAppearance()
|
||||
{
|
||||
if(!Core.Utilities.ThemeHelpers.LightTheme)
|
||||
{
|
||||
Control.KeyboardAppearance = UIKeyboardAppearance.Dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,6 +137,7 @@
|
||||
<Compile Include="Migration\KeyChainStorageService.cs" />
|
||||
<Compile Include="NFCReaderDelegate.cs" />
|
||||
<Compile Include="Renderers\CustomButtonRenderer.cs" />
|
||||
<Compile Include="Renderers\CustomSearchBarRenderer.cs" />
|
||||
<Compile Include="Renderers\CustomTabbedRenderer.cs" />
|
||||
<Compile Include="Renderers\CustomPickerRenderer.cs" />
|
||||
<Compile Include="Renderers\CustomEntryRenderer.cs" />
|
||||
|
||||
Reference in New Issue
Block a user