Example #1
0
 public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
 {
     if (snsPlatform.MShowWord.Equals("umeng_sharebutton_copy"))
     {
         try {
             ClipboardManager cm = (ClipboardManager)context.GetSystemService(Context.ClipboardService);
             // 将文本内容放到系统剪贴板里。
             cm.Text = umWeb.ToUrl();
             Toast.MakeText(context, "已复制链接到剪贴板", ToastLength.Short).Show();
         }
         catch (System.Exception ex) {
             Toast.MakeText(context, "很抱歉,浏览器打开失败", ToastLength.Short).Show();
         }
     }
     else if (snsPlatform.MShowWord.Equals("umeng_sharebutton_copyurl"))
     {
         try {
             Intent intent = new Intent(Intent.ActionView);
             intent.SetData(Android.Net.Uri.Parse(umWeb.ToUrl()));
             context.StartActivity(intent);
         }
         catch (System.Exception ex) {
             Toast.MakeText(context, "很抱歉,浏览器打开失败", ToastLength.Short).Show();
         }
     }
     else
     {
         new ShareAction(context).WithMedia(umWeb)
         .SetPlatform(media)
         .SetCallback(this)
         .Share();
     }
 }
 public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
 {
     new ShareAction(context).WithMedia(umWeb)
     .SetPlatform(media)
     .SetCallback(this)
     .Share();
 }
Example #3
0
        public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
        {
            UMWeb web = new UMWeb("http://kb.cnblogs.com/page/" + kbarticle.Id + "/");

            web.Title       = kbarticle.Title;
            web.Description = kbarticle.Summary;
            new ShareAction(this).WithMedia(web)
            .SetPlatform(media)
            .SetCallback(new UMengCustomShare(this))
            .Share();
        }
Example #4
0
        public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
        {
            UMWeb web = new UMWeb(article.Url);

            web.Title       = article.Title;
            web.Description = article.Description;
            new ShareAction(this).WithMedia(web)
            .SetPlatform(media)
            .SetCallback(new UMengCustomShare(this))
            .Share();
        }
Example #5
0
        public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
        {
            UMWeb web = new UMWeb("https://q.cnblogs.com/q/" + question.Qid + "/");

            web.Title       = question.Title;
            web.Description = question.Summary;
            new ShareAction(this).WithMedia(web)
            .SetPlatform(media)
            .SetCallback(new UMengCustomShare(this))
            .Share();
        }
Example #6
0
        public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
        {
            UMWeb web = new UMWeb(Resources.GetString(Resource.String.open_source_url));

            web.Title       = Resources.GetString(Resource.String.share_title);
            web.Description = Resources.GetString(Resource.String.share_title);
            web.SetThumb(new UMImage(this, Resource.Mipmap.ic_launcher));
            new ShareAction(this).WithMedia(web)
            .SetPlatform(media)
            .SetCallback(new UMengCustomShare(this))
            .Share();
        }
Example #7
0
        public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
        {
            var icon = news.TopicIcon;

            if (icon.IndexOf("https://") == -1)
            {
                icon = "https:" + icon;
            }
            UMWeb web = new UMWeb("https://news.cnblogs.com/n/" + news.Id + "/");

            web.Title       = news.Title;
            web.Description = news.Summary;
            web.SetThumb(new UMImage(this, icon));
            new ShareAction(this).WithMedia(web)
            .SetPlatform(media)
            .SetCallback(new UMengCustomShare(this))
            .Share();
        }
Example #8
0
 //IShareBoardListener
 public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
 {
     if (snsPlatform.MShowWord.Equals("ä¯ÀÀÆ÷´ò¿ª"))
     {
         try
         {
             Intent intent = new Intent(Intent.ActionView);
             intent.SetData(Android.Net.Uri.Parse(umWeb.ToUrl()));
             context.StartActivity(intent);
         }
         catch (System.Exception e)
         {
             AlertUtil.ToastShort(context, "ä¯ÀÀÆ÷´ò¿ªÊ§°Ü");
         }
     }
     else
     {
         new ShareAction(context).WithMedia(umWeb)
         .SetPlatform(media)
         .SetCallback(this)
         .Share();
     }
 }
 public void Onclick(SnsPlatform snsPlatform, SHARE_MEDIA media)
 {
     if (snsPlatform.MShowWord.Equals("umeng_sharebutton_copy"))
     {
         try
         {
             Intent intent = new Intent(Intent.ActionView);
             intent.SetData(Android.Net.Uri.Parse(umWeb.ToUrl()));
             context.StartActivity(intent);
         }
         catch (System.Exception ex)
         {
             MobclickAgent.ReportError(context, ex.Message);
             Toast.MakeText(context, "很抱歉,浏览器打开失败", ToastLength.Short).Show();
         }
     }
     else
     {
         new ShareAction(context).WithMedia(umWeb)
         .SetPlatform(media)
         .SetCallback(this)
         .Share();
     }
 }