mirror of
https://github.com/bitwarden/android.git
synced 2026-05-28 07:28:29 -05:00
46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using System;
|
|
using Bit.App.Resources;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Bit.App.Controls
|
|
{
|
|
public class FormPickerCell : ExtendedViewCell
|
|
{
|
|
public FormPickerCell(string labelText, string[] pickerItems)
|
|
{
|
|
Label = new Label
|
|
{
|
|
Text = labelText,
|
|
FontSize = 14,
|
|
TextColor = Color.FromHex("777777"),
|
|
VerticalOptions = LayoutOptions.Start
|
|
};
|
|
|
|
Picker = new ExtendedPicker
|
|
{
|
|
HasBorder = false,
|
|
VerticalOptions = LayoutOptions.CenterAndExpand
|
|
};
|
|
|
|
foreach(var item in pickerItems)
|
|
{
|
|
Picker.Items.Add(item);
|
|
}
|
|
Picker.SelectedIndex = 0;
|
|
|
|
var stackLayout = new StackLayout
|
|
{
|
|
Padding = new Thickness(15)
|
|
};
|
|
|
|
stackLayout.Children.Add(Label);
|
|
stackLayout.Children.Add(Picker);
|
|
|
|
View = stackLayout;
|
|
}
|
|
|
|
public Label Label { get; private set; }
|
|
public ExtendedPicker Picker { get; private set; }
|
|
}
|
|
}
|