mirror of
https://github.com/bitwarden/mobile
synced 2025-12-31 15:43:19 +00:00
ExtendedTextCell and ExtendedViewCell for iOS and Android. BackgroundColor and Disclousure Indicators
This commit is contained in:
@@ -1,17 +1,34 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class ExtendedTextCell : TextCell
|
||||
{
|
||||
public static readonly BindableProperty BackgroundColorProperty =
|
||||
BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(ExtendedTextCell), Color.Transparent);
|
||||
BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(ExtendedTextCell), Color.White);
|
||||
|
||||
public static readonly BindableProperty ShowDisclousureProperty =
|
||||
BindableProperty.Create(nameof(DisclousureImage), typeof(bool), typeof(ExtendedTextCell), false);
|
||||
|
||||
public static readonly BindableProperty DisclousureImageProperty =
|
||||
BindableProperty.Create(nameof(DisclousureImage), typeof(string), typeof(ExtendedTextCell), string.Empty);
|
||||
|
||||
public Color BackgroundColor
|
||||
{
|
||||
get { return (Color)GetValue(BackgroundColorProperty); }
|
||||
set { SetValue(BackgroundColorProperty, value); }
|
||||
}
|
||||
|
||||
public bool ShowDisclousure
|
||||
{
|
||||
get { return (bool)GetValue(ShowDisclousureProperty); }
|
||||
set { SetValue(ShowDisclousureProperty, value); }
|
||||
}
|
||||
|
||||
public string DisclousureImage
|
||||
{
|
||||
get { return (string)GetValue(DisclousureImageProperty); }
|
||||
set { SetValue(DisclousureImageProperty, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
src/App/Controls/ExtendedViewCell.cs
Normal file
16
src/App/Controls/ExtendedViewCell.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class ExtendedViewCell : ViewCell
|
||||
{
|
||||
public static readonly BindableProperty BackgroundColorProperty =
|
||||
BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(ExtendedTextCell), Color.White);
|
||||
|
||||
public Color BackgroundColor
|
||||
{
|
||||
get { return (Color)GetValue(BackgroundColorProperty); }
|
||||
set { SetValue(BackgroundColorProperty, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class FormEditorCell : ViewCell
|
||||
public class FormEditorCell : ExtendedViewCell
|
||||
{
|
||||
public FormEditorCell(Keyboard entryKeyboard = null, double? height = null)
|
||||
{
|
||||
@@ -20,8 +20,7 @@ namespace Bit.App.Controls
|
||||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Padding = new Thickness(15),
|
||||
BackgroundColor = Color.White
|
||||
Padding = new Thickness(15)
|
||||
};
|
||||
|
||||
stackLayout.Children.Add(Editor);
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class FormEntryCell : ViewCell
|
||||
public class FormEntryCell : ExtendedViewCell
|
||||
{
|
||||
public FormEntryCell(string labelText, Keyboard entryKeyboard = null, bool IsPassword = false)
|
||||
{
|
||||
@@ -25,8 +24,7 @@ namespace Bit.App.Controls
|
||||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Padding = new Thickness(15),
|
||||
BackgroundColor = Color.White
|
||||
Padding = new Thickness(15)
|
||||
};
|
||||
|
||||
stackLayout.Children.Add(Label);
|
||||
|
||||
@@ -4,7 +4,7 @@ using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class FormPickerCell : ViewCell
|
||||
public class FormPickerCell : ExtendedViewCell
|
||||
{
|
||||
public FormPickerCell(string labelText, string[] pickerItems)
|
||||
{
|
||||
@@ -31,8 +31,7 @@ namespace Bit.App.Controls
|
||||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Padding = new Thickness(15),
|
||||
BackgroundColor = Color.White
|
||||
Padding = new Thickness(15)
|
||||
};
|
||||
|
||||
stackLayout.Children.Add(Label);
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
using Acr.UserDialogs;
|
||||
using Bit.App.Abstractions;
|
||||
using Bit.App.Resources;
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
using XLabs.Ioc;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public class LabeledValueCell : ViewCell
|
||||
public class LabeledValueCell : ExtendedViewCell
|
||||
{
|
||||
public LabeledValueCell(
|
||||
string labelText = null,
|
||||
@@ -18,7 +13,6 @@ namespace Bit.App.Controls
|
||||
var containerStackLayout = new StackLayout
|
||||
{
|
||||
Padding = new Thickness(15),
|
||||
BackgroundColor = Color.White,
|
||||
Orientation = StackOrientation.Horizontal
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user