mirror of
https://github.com/bitwarden/android.git
synced 2024-12-19 07:41:52 +03:00
Android style updates
This commit is contained in:
parent
4dfba13aea
commit
90a6855e39
5 changed files with 26 additions and 3 deletions
|
@ -16,6 +16,7 @@ namespace Bit.Android.Controls
|
|||
|
||||
var view = (ExtendedPicker)Element;
|
||||
|
||||
Control.TextSize = (float)Device.GetNamedSize(NamedSize.Small, typeof(Picker));
|
||||
SetBorder(view);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,16 +12,24 @@ namespace Bit.Android.Controls
|
|||
{
|
||||
public class ExtendedSwitchCellRenderer : SwitchCellRenderer
|
||||
{
|
||||
protected AView View { get; private set; }
|
||||
protected BaseCellView View { get; private set; }
|
||||
|
||||
protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
|
||||
{
|
||||
var View = base.GetCellCore(item, convertView, parent, context);
|
||||
var View = base.GetCellCore(item, convertView, parent, context) as SwitchCellView;
|
||||
var extendedCell = (ExtendedSwitchCell)item;
|
||||
|
||||
if(View != null)
|
||||
{
|
||||
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
|
||||
if(item.IsEnabled)
|
||||
{
|
||||
View.SetMainTextColor(Color.Black);
|
||||
}
|
||||
else
|
||||
{
|
||||
View.SetMainTextColor(Color.FromHex("d2d6de"));
|
||||
}
|
||||
}
|
||||
|
||||
return View;
|
||||
|
|
|
@ -27,6 +27,12 @@ namespace Bit.App.Controls
|
|||
|
||||
Tapped += FormEditorCell_Tapped;
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
Editor.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label));
|
||||
Editor.Margin = new Thickness(-4, -2, -4, -10);
|
||||
}
|
||||
|
||||
View = stackLayout;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace Bit.App.Controls
|
|||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
stackLayout.Spacing = 0;
|
||||
Picker.Margin = new Thickness(-4, -2, -4, -10);
|
||||
}
|
||||
|
||||
Tapped += FormPickerCell_Tapped;
|
||||
|
|
|
@ -41,9 +41,10 @@ namespace Bit.App.Pages
|
|||
|
||||
private void Init()
|
||||
{
|
||||
var fingerprintName = Device.OnPlatform(iOS: "Touch ID", Android: "Fingerprint", WinPhone: "Fingerprint");
|
||||
FingerprintCell = new ExtendedSwitchCell
|
||||
{
|
||||
Text = "Unlock with Touch ID" + (!_fingerprint.IsAvailable ? " (Unavilable)" : null),
|
||||
Text = "Unlock with " + fingerprintName + (!_fingerprint.IsAvailable ? " (Unavilable)" : null),
|
||||
On = _settings.GetValueOrDefault<bool>(Constants.SettingFingerprintUnlockOn),
|
||||
IsEnabled = _fingerprint.IsAvailable
|
||||
};
|
||||
|
@ -428,6 +429,12 @@ namespace Bit.App.Pages
|
|||
Padding = new Thickness(15)
|
||||
};
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
labelDetailStackLayout.Spacing = 5;
|
||||
Label.TextColor = Color.Black;
|
||||
}
|
||||
|
||||
ShowDisclousure = true;
|
||||
View = labelDetailStackLayout;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue