1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-27 21:53:57 +00:00
Files
mobile/src/App/Controls/FormEditorCell.cs

43 lines
1.0 KiB
C#

using System;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public class FormEditorCell : ExtendedViewCell
{
public FormEditorCell(Keyboard entryKeyboard = null, double? height = null)
{
Editor = new ExtendedEditor
{
Keyboard = entryKeyboard,
HasBorder = false,
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Editor))
};
if(height.HasValue)
{
Editor.HeightRequest = height.Value;
}
var stackLayout = new StackLayout
{
Padding = new Thickness(15, 10)
};
stackLayout.Children.Add(Editor);
Tapped += FormEditorCell_Tapped;
Editor.AdjustMarginsForDevice();
View = stackLayout;
}
public ExtendedEditor Editor { get; private set; }
private void FormEditorCell_Tapped(object sender, EventArgs e)
{
Editor.Focus();
}
}
}