Ejemplo n.º 1
0
        protected void AutoLinkAction(AutoLinkType type, string link)
        {
            if (string.IsNullOrEmpty(link))
            {
                return;
            }

            switch (type)
            {
            case AutoLinkType.Hashtag:
                Activity.Intent.PutExtra(SearchFragment.SearchExtra, link);
                ((BaseActivity)Activity).OpenNewContentFragment(new PreSearchFragment());
                break;

            case AutoLinkType.Mention:
                ((BaseActivity)Activity).OpenNewContentFragment(new ProfileFragment(link));
                break;

            case AutoLinkType.Url:
                var intent = new Intent(Intent.ActionView);
                intent.SetData(Android.Net.Uri.Parse(link));
                StartActivity(intent);
                break;
            }
        }
        private void LinkClick(AutoLinkType type, string url)
        {
            var intent = new Intent(Intent.ActionView);

            intent.SetData(Android.Net.Uri.Parse(url));
            _context.StartActivity(intent);
        }
Ejemplo n.º 3
0
 private void AppendLinkItems(HashSet <LinkItem> set, AutoLinkType type, Matcher matcher)
 {
     while (matcher.Find())
     {
         set.Add(new LinkItem
         {
             Matched = matcher.Group(),
             Start   = matcher.Start(),
             End     = matcher.End(),
             Mode    = type
         });
     }
 }
Ejemplo n.º 4
0
 private void LinkClick(AutoLinkType type, string link)
 {
     Cancel();
     _autoLinkAction?.Invoke(type, link);
 }