mirror of
https://github.com/bitwarden/android.git
synced 2024-12-18 23:31:52 +03:00
some style consolidation
This commit is contained in:
parent
7c6a4c8fb1
commit
0c3bd0b92c
10 changed files with 5947 additions and 104 deletions
5937
src/Android/Resources/Resource.Designer.cs
generated
5937
src/Android/Resources/Resource.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -9,6 +9,7 @@ using System.Diagnostics;
|
|||
using Plugin.Fingerprint.Abstractions;
|
||||
using System.Threading.Tasks;
|
||||
using Plugin.Settings.Abstractions;
|
||||
using Bit.App.Controls;
|
||||
|
||||
namespace Bit.App
|
||||
{
|
||||
|
@ -30,6 +31,8 @@ namespace Bit.App
|
|||
_fingerprint = fingerprint;
|
||||
_settings = settings;
|
||||
|
||||
SetStyles();
|
||||
|
||||
if(authService.IsAuthenticated)
|
||||
{
|
||||
MainPage = new MainPage();
|
||||
|
@ -133,5 +136,74 @@ namespace Bit.App
|
|||
// Use master password to unlock if no other methods are set
|
||||
}
|
||||
}
|
||||
|
||||
private void SetStyles()
|
||||
{
|
||||
var gray = Color.FromHex("333333");
|
||||
var grayLight = Color.FromHex("777777");
|
||||
var grayLighter = Color.FromHex("d2d6de");
|
||||
var primaryColor = Color.FromHex("3c8dbc");
|
||||
|
||||
Resources = new ResourceDictionary();
|
||||
|
||||
// Labels
|
||||
|
||||
Resources.Add(new Style(typeof(Label))
|
||||
{
|
||||
Setters = {
|
||||
new Setter { Property = Label.TextColorProperty, Value = gray }
|
||||
}
|
||||
});
|
||||
|
||||
Resources.Add("text-muted", new Style(typeof(Label))
|
||||
{
|
||||
Setters = {
|
||||
new Setter { Property = Label.TextColorProperty, Value = grayLight }
|
||||
}
|
||||
});
|
||||
|
||||
// Buttons
|
||||
|
||||
Resources.Add("btn-default", new Style(typeof(Button))
|
||||
{
|
||||
Setters = {
|
||||
new Setter { Property = Button.TextColorProperty, Value = gray }
|
||||
}
|
||||
});
|
||||
|
||||
Resources.Add(new Style(typeof(Button))
|
||||
{
|
||||
Setters = {
|
||||
new Setter { Property = Button.TextColorProperty, Value = primaryColor }
|
||||
}
|
||||
});
|
||||
|
||||
// Editors
|
||||
|
||||
Resources.Add(new Style(typeof(Editor))
|
||||
{
|
||||
Setters = {
|
||||
new Setter { Property = Editor.TextColorProperty, Value = gray }
|
||||
}
|
||||
});
|
||||
|
||||
// Entries
|
||||
|
||||
Resources.Add(new Style(typeof(Entry))
|
||||
{
|
||||
Setters = {
|
||||
new Setter { Property = Entry.TextColorProperty, Value = gray }
|
||||
}
|
||||
});
|
||||
|
||||
// List View
|
||||
|
||||
Resources.Add(new Style(typeof(ListView))
|
||||
{
|
||||
Setters = {
|
||||
new Setter { Property = ListView.SeparatorColorProperty, Value = grayLighter }
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,12 @@ namespace Bit.App.Controls
|
|||
{
|
||||
public class ExtendedTextCell : TextCell
|
||||
{
|
||||
public ExtendedTextCell()
|
||||
{
|
||||
TextColor = Color.FromHex("333333");
|
||||
DetailColor = Color.FromHex("777777");
|
||||
}
|
||||
|
||||
public static readonly BindableProperty BackgroundColorProperty =
|
||||
BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(ExtendedTextCell), Color.White);
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ namespace Bit.App.Controls
|
|||
{
|
||||
Text = labelText,
|
||||
FontSize = 14,
|
||||
TextColor = Color.FromHex("777777"),
|
||||
VerticalOptions = LayoutOptions.Start
|
||||
VerticalOptions = LayoutOptions.Start,
|
||||
Style = (Style)Application.Current.Resources["text-muted"]
|
||||
};
|
||||
|
||||
Entry = new ExtendedEntry
|
||||
|
@ -20,8 +20,7 @@ namespace Bit.App.Controls
|
|||
Keyboard = entryKeyboard,
|
||||
HasBorder = false,
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
IsPassword = IsPassword,
|
||||
TextColor = Color.FromHex("333333")
|
||||
IsPassword = IsPassword
|
||||
};
|
||||
|
||||
if(nextElement != null)
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace Bit.App.Controls
|
|||
{
|
||||
Text = labelText,
|
||||
FontSize = 14,
|
||||
TextColor = Color.FromHex("777777"),
|
||||
Style = (Style)Application.Current.Resources["text-muted"],
|
||||
VerticalOptions = LayoutOptions.Start
|
||||
};
|
||||
|
||||
|
@ -39,8 +39,7 @@ namespace Bit.App.Controls
|
|||
{
|
||||
Text = valueText,
|
||||
LineBreakMode = LineBreakMode.TailTruncation,
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
TextColor = Color.FromHex("333333")
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand
|
||||
};
|
||||
|
||||
labelValueStackLayout.Children.Add(Value);
|
||||
|
@ -59,8 +58,7 @@ namespace Bit.App.Controls
|
|||
Text = button1Text,
|
||||
HorizontalOptions = LayoutOptions.End,
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
Margin = new Thickness(0),
|
||||
TextColor = Color.FromHex("3c8dbc")
|
||||
Margin = new Thickness(0)
|
||||
};
|
||||
|
||||
buttonStackLayout.Children.Add(Button1);
|
||||
|
@ -73,8 +71,7 @@ namespace Bit.App.Controls
|
|||
Text = button2Text,
|
||||
HorizontalOptions = LayoutOptions.End,
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
Margin = new Thickness(0),
|
||||
TextColor = Color.FromHex("3c8dbc")
|
||||
Margin = new Thickness(0)
|
||||
};
|
||||
|
||||
buttonStackLayout.Children.Add(Button2);
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Bit.App.Controls
|
|||
{
|
||||
HorizontalTextAlignment = TextAlignment.Center,
|
||||
FontSize = 30,
|
||||
TextColor = Color.FromHex("333333"),
|
||||
FontFamily = "Courier"
|
||||
};
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Bit.App.Pages
|
|||
Text = "Use Fingerprint to Unlock",
|
||||
Command = new Command(async () => await CheckFingerprintAsync()),
|
||||
VerticalOptions = LayoutOptions.EndAndExpand,
|
||||
TextColor = Color.FromHex("333333")
|
||||
Style = (Style)Application.Current.Resources["btn-default"]
|
||||
};
|
||||
|
||||
var logoutButton = new Button
|
||||
|
@ -46,7 +46,7 @@ namespace Bit.App.Pages
|
|||
Text = AppResources.LogOut,
|
||||
Command = new Command(async () => await LogoutAsync()),
|
||||
VerticalOptions = LayoutOptions.End,
|
||||
TextColor = Color.FromHex("333333")
|
||||
Style = (Style)Application.Current.Resources["btn-default"]
|
||||
};
|
||||
|
||||
var stackLayout = new StackLayout { Padding = new Thickness(30, 40), Spacing = 10 };
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Bit.App.Pages
|
|||
Text = AppResources.LogOut,
|
||||
Command = new Command(async () => await LogoutAsync()),
|
||||
VerticalOptions = LayoutOptions.End,
|
||||
TextColor = Color.FromHex("333333")
|
||||
Style = (Style)Application.Current.Resources["btn-default"]
|
||||
};
|
||||
|
||||
var stackLayout = new StackLayout
|
||||
|
|
|
@ -33,8 +33,7 @@ namespace Bit.App.Pages
|
|||
|
||||
var listView = new ListView
|
||||
{
|
||||
ItemsSource = Folders,
|
||||
SeparatorColor = Color.FromHex("d2d6de")
|
||||
ItemsSource = Folders
|
||||
};
|
||||
listView.ItemSelected += FolderSelected;
|
||||
listView.ItemTemplate = new DataTemplate(() => new SettingsFolderListViewCell(this));
|
||||
|
|
|
@ -48,7 +48,6 @@ namespace Bit.App.Pages
|
|||
IsGroupingEnabled = true,
|
||||
ItemsSource = Folders,
|
||||
HasUnevenRows = true,
|
||||
SeparatorColor = Color.FromHex("d2d6de"),
|
||||
GroupHeaderTemplate = new DataTemplate(() => new VaultListHeaderViewCell(this)),
|
||||
ItemTemplate = new DataTemplate(() => new VaultListViewCell(this))
|
||||
};
|
||||
|
@ -185,9 +184,6 @@ namespace Bit.App.Pages
|
|||
ContextActions.Add(deleteAction);
|
||||
ContextActions.Add(moreAction);
|
||||
|
||||
TextColor = Color.FromHex("333333");
|
||||
DetailColor = Color.FromHex("777777");
|
||||
|
||||
DisclousureTapped += VaultListViewCell_DisclousureTapped;
|
||||
ShowDisclousure = true;
|
||||
DisclousureImage = "more";
|
||||
|
@ -221,10 +217,10 @@ namespace Bit.App.Pages
|
|||
|
||||
var label = new Label
|
||||
{
|
||||
TextColor = Color.FromHex("777777"),
|
||||
VerticalTextAlignment = TextAlignment.Center,
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
FontSize = 14
|
||||
FontSize = 14,
|
||||
Style = (Style)Application.Current.Resources["text-muted"]
|
||||
};
|
||||
|
||||
label.SetBinding<VaultListPageModel.Folder>(Label.TextProperty, s => s.Name);
|
||||
|
|
Loading…
Reference in a new issue