Exemplo n.º 1
0
            public override void TappedLinkAttribute(ASTextNode textNode, string attribute, NSObject value, CGPoint point,
                                                     NSRange textRange)
            {
                var launcherService = Dependencies.Container.Resolve <ILauncherService>();

                launcherService.OpenUrl(((NSUrl)value).AbsoluteString);
            }
Exemplo n.º 2
0
        public InfoMessageNode(ChatMessageViewModel viewModel)
        {
            _infoTextNode = new ASTextNode();
            var attributedInfoText = viewModel?.Body.BuildAttributedString()
                                     .Font(UIFont.SystemFontOfSize(11, UIFontWeight.Semibold))
                                     .Foreground(UIColor.FromRGB(141, 141, 141));

            _infoTextNode.AttributedText = attributedInfoText;

            SelectionStyle = UITableViewCellSelectionStyle.None;
            AutomaticallyManagesSubnodes = true;
            SetNeedsLayout();
        }
Exemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.White;
            var viewSize = View.Frame.Size;
            DispatchQueue.DefaultGlobalQueue.DispatchAsync(() =>
                {
                    var node = new ASTextNode();
                    node.AttributedString = new NSAttributedString("hello");
                    node.Measure(viewSize);
                    node.Frame = new CGRect(new CGPoint(10,40), node.CalculatedSize);

                    DispatchQueue.MainQueue.DispatchAsync(() => View.AddSubview(node.View));
                });
        }
Exemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.White;
            var viewSize = View.Frame.Size;

            DispatchQueue.DefaultGlobalQueue.DispatchAsync(() =>
            {
                var node = new ASTextNode();
                node.AttributedString = new NSAttributedString("hello");
                node.Measure(viewSize);
                node.Frame = new CGRect(new CGPoint(10, 40), node.CalculatedSize);

                DispatchQueue.MainQueue.DispatchAsync(() => View.AddSubview(node.View));
            });
        }
Exemplo n.º 5
0
 public override bool ShouldHighlightLinkAttribute(ASTextNode textNode, string attribute, NSObject value,
                                                   CGPoint point)
 {
     return(true);
 }