2017-07-13 07:02:37 +03:00
|
|
|
|
using FFImageLoading.Forms;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Bit.App.Controls
|
|
|
|
|
{
|
|
|
|
|
public class LabeledRightDetailCell : ExtendedViewCell
|
|
|
|
|
{
|
2017-07-22 22:38:08 +03:00
|
|
|
|
public LabeledRightDetailCell(bool showIcon = true)
|
2017-07-13 07:02:37 +03:00
|
|
|
|
{
|
|
|
|
|
Label = new Label
|
|
|
|
|
{
|
|
|
|
|
LineBreakMode = LineBreakMode.TailTruncation,
|
|
|
|
|
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
|
|
|
|
|
HorizontalOptions = LayoutOptions.StartAndExpand,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Detail = new Label
|
|
|
|
|
{
|
|
|
|
|
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
|
|
|
|
|
Style = (Style)Application.Current.Resources["text-muted"],
|
|
|
|
|
HorizontalOptions = LayoutOptions.End,
|
|
|
|
|
VerticalOptions = LayoutOptions.Center
|
|
|
|
|
};
|
|
|
|
|
|
2017-07-22 22:38:08 +03:00
|
|
|
|
StackLayout = new StackLayout
|
2017-07-13 07:02:37 +03:00
|
|
|
|
{
|
|
|
|
|
Orientation = StackOrientation.Horizontal,
|
|
|
|
|
Padding = new Thickness(15, 10),
|
2017-07-22 22:38:08 +03:00
|
|
|
|
Children = { Label, Detail }
|
2017-07-13 07:02:37 +03:00
|
|
|
|
};
|
|
|
|
|
|
2017-07-22 22:38:08 +03:00
|
|
|
|
if(showIcon)
|
|
|
|
|
{
|
|
|
|
|
Icon = new CachedImage
|
|
|
|
|
{
|
|
|
|
|
WidthRequest = 16,
|
|
|
|
|
HeightRequest = 16,
|
|
|
|
|
HorizontalOptions = LayoutOptions.End,
|
|
|
|
|
VerticalOptions = LayoutOptions.Center,
|
|
|
|
|
Margin = new Thickness(5, 0, 0, 0)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StackLayout.Children.Add(Icon);
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-13 07:02:37 +03:00
|
|
|
|
if(Device.RuntimePlatform == Device.Android)
|
|
|
|
|
{
|
|
|
|
|
Label.TextColor = Color.Black;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-22 22:38:08 +03:00
|
|
|
|
View = StackLayout;
|
2017-07-13 07:02:37 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Label Label { get; private set; }
|
|
|
|
|
public Label Detail { get; private set; }
|
|
|
|
|
public CachedImage Icon { get; private set; }
|
2017-07-22 22:38:08 +03:00
|
|
|
|
public StackLayout StackLayout { get; private set; }
|
2017-07-13 07:02:37 +03:00
|
|
|
|
}
|
|
|
|
|
}
|