private Cell CreateMessageCell() { Label lblTimeSpan = new Label(); lblTimeSpan.SetBinding(Label.TextProperty, new Binding("Timestamp", stringFormat: "[{0:HH:mm}]")); lblTimeSpan.TextColor = Color.Silver; lblTimeSpan.Font = Font.SystemFontOfSize(14); Label lblAutor = new Label(); lblAutor.SetBinding(Label.TextProperty, new Binding("AuthorName", stringFormat: "{0}: ")); lblAutor.TextColor = Device.OnPlatform(Color.Blue, Color.Yellow, Color.Yellow); lblAutor.Font = Font.SystemFontOfSize(14); Label lblMensagem = new Label(); lblMensagem.SetBinding(Label.TextProperty, new Binding("Text")); lblMensagem.Font = Font.SystemFontOfSize(14); StackLayout stack = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { lblAutor, lblMensagem } }; if (Device.Idiom == TargetIdiom.Tablet) stack.Children.Insert(0, lblTimeSpan); MessageViewCell view = new MessageViewCell { View = stack }; return view; }
public AndroidMessageViewCell(Context context, MessageViewCell cell) : base(context) { MessageViewCell = cell; var view = (context as Activity).LayoutInflater.Inflate(Resource.Layout.AndroidMessageViewCell, null); NameTextView = view.FindViewById <TextView>(Resource.Id.NameText); ContenuTextView = view.FindViewById <TextView>(Resource.Id.ContenuText); DateTextView = view.FindViewById <TextView>(Resource.Id.DateText); AddView(view); }
private Cell CreateMessageCell() { var timestampLabel = new Label(); timestampLabel.SetBinding(Label.TextProperty, new Binding("Timestamp", stringFormat: "[{0:HH:mm:ss}]")); timestampLabel.TextColor = Color.Silver; timestampLabel.Font = Font.SystemFontOfSize(14); var authorLabel = new Label(); authorLabel.SetBinding(Label.TextProperty, new Binding("ChatMessage.Name", stringFormat: "{0}: ")); authorLabel.TextColor = Device.OnPlatform(Color.Blue, Color.Yellow, Color.Yellow); authorLabel.Font = Font.SystemFontOfSize(14); var messageLabel = new Label(); messageLabel.SetBinding(Label.TextProperty, new Binding("ChatMessage.Message")); messageLabel.Font = Font.SystemFontOfSize(14); var stack = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { authorLabel, messageLabel } }; if (Device.Idiom == TargetIdiom.Tablet) { stack.Children.Insert(0, timestampLabel); } var view = new MessageViewCell { View = stack }; return(view); }
public void UpdateCell(MessageViewCell cell) { NameTextView.Text = cell.Name; ContenuTextView.Text = cell.Contenu; DateTextView.Text = cell.Date; }
private Cell CreateMessageCell() { var timestampLabel = new SquawkLabel(); timestampLabel.SetBinding(SquawkLabel.TextProperty, new Binding("Timestamp", stringFormat: "[{0:HH:mm}]")); timestampLabel.TextColor = Styling.CellDetailColor; timestampLabel.FontSize = 14; var authorLabel = new SquawkLabel(); authorLabel.SetBinding(SquawkLabel.TextProperty, new Binding("AuthorName", stringFormat: "{0}: ")); authorLabel.TextColor = Device.OnPlatform(Color.White, Color.Yellow, Color.Yellow); authorLabel.FontSize = 14; var messageLabel = new SquawkLabel(); messageLabel.SetBinding(SquawkLabel.TextProperty, new Binding("Text")); messageLabel.FontSize = 14; var stack = new StackLayout { Orientation = StackOrientation.Horizontal, Children = {authorLabel, messageLabel} }; if (Device.Idiom == TargetIdiom.Tablet) { stack.Children.Insert(0, timestampLabel); } var view = new MessageViewCell { View = stack }; return view; }
private Cell CreateMessageCell() { var timestampLabel = new Label(); timestampLabel.SetBinding(Label.TextProperty, new Binding("Timestamp", stringFormat: "[{0:HH:mm}]")); timestampLabel.TextColor = Color.Silver; timestampLabel.Font = Font.SystemFontOfSize(14); var authorLabel = new Label(); authorLabel.SetBinding(Label.TextProperty, new Binding("AuthorName", stringFormat: "{0}: ")); authorLabel.TextColor = Device.OnPlatform(Color.Blue, Color.Yellow, Color.Yellow); authorLabel.Font = Font.SystemFontOfSize(14); var messageLabel = new Label(); messageLabel.SetBinding(Label.TextProperty, new Binding("Message")); messageLabel.Font = Font.SystemFontOfSize(14); var stack = new StackLayout { Orientation = StackOrientation.Horizontal, Children = {authorLabel, messageLabel} }; var view = new MessageViewCell { View = stack }; return view; }