mirror of
https://github.com/bitwarden/mobile
synced 2026-01-06 10:34:07 +00:00
Extended button and device specific monospace fonts
This commit is contained in:
18
src/App/Controls/ExtendedButton.cs
Normal file
18
src/App/Controls/ExtendedButton.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Bit.App.Enums;
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class ExtendedButton : Button
|
||||
{
|
||||
public static readonly BindableProperty PaddingProperty =
|
||||
BindableProperty.Create(nameof(Padding), typeof(Thickness), typeof(ExtendedButton), default(Thickness));
|
||||
|
||||
public Thickness Padding
|
||||
{
|
||||
get { return (Thickness)GetValue(PaddingProperty); }
|
||||
set { SetValue(PaddingProperty, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ namespace Bit.App.Controls
|
||||
|
||||
if(button1Text != null)
|
||||
{
|
||||
Button1 = new Button
|
||||
Button1 = new ExtendedButton
|
||||
{
|
||||
Text = button1Text,
|
||||
HorizontalOptions = LayoutOptions.End,
|
||||
@@ -76,7 +76,7 @@ namespace Bit.App.Controls
|
||||
|
||||
if(button2Text != null)
|
||||
{
|
||||
Button2 = new Button
|
||||
Button2 = new ExtendedButton
|
||||
{
|
||||
Text = button2Text,
|
||||
HorizontalOptions = LayoutOptions.End,
|
||||
@@ -87,6 +87,18 @@ namespace Bit.App.Controls
|
||||
buttonStackLayout.Children.Add(Button2);
|
||||
}
|
||||
|
||||
if(Device.OS == TargetPlatform.Android)
|
||||
{
|
||||
if(Button1 != null)
|
||||
{
|
||||
Button1.Padding = new Thickness(5);
|
||||
}
|
||||
if(Button2 != null)
|
||||
{
|
||||
Button2.Padding = new Thickness(5);
|
||||
}
|
||||
}
|
||||
|
||||
containerStackLayout.Children.Add(buttonStackLayout);
|
||||
|
||||
View = containerStackLayout;
|
||||
@@ -94,7 +106,7 @@ namespace Bit.App.Controls
|
||||
|
||||
public Label Label { get; private set; }
|
||||
public Label Value { get; private set; }
|
||||
public Button Button1 { get; private set; }
|
||||
public Button Button2 { get; private set; }
|
||||
public ExtendedButton Button1 { get; private set; }
|
||||
public ExtendedButton Button2 { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace Bit.App.Controls
|
||||
{
|
||||
HorizontalTextAlignment = TextAlignment.Center,
|
||||
FontSize = 35,
|
||||
FontFamily = "Courier"
|
||||
};
|
||||
FontFamily = Device.OnPlatform(iOS: "Courier", Android: "monospace", WinPhone: "Courier")
|
||||
};
|
||||
|
||||
Entry = new ExtendedEntry
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user