public SharesWidget(Activity context)
        {
            this.context = context;

            shareAction = new ShareAction(context)
                          .SetDisplayList(SHARE_MEDIA.Weixin, SHARE_MEDIA.WeixinCircle, SHARE_MEDIA.WeixinFavorite, SHARE_MEDIA.Sina)
                          .SetShareboardclickCallback(this);
        }
示例#2
0
 public UMengSharesWidget(Activity context)
 {
     this.context = context;
     shareAction  = new ShareAction(context)
                    .SetDisplayList(SHARE_MEDIA.Weixin, SHARE_MEDIA.WeixinCircle, SHARE_MEDIA.WeixinFavorite, SHARE_MEDIA.Sina)
                    .AddButton("umeng_sharebutton_copy", "umeng_sharebutton_copy", "umeng_socialize_copy", "umeng_socialize_copy")
                    .SetShareboardclickCallback(this);
 }
示例#3
0
 public UMengShareWidget(Activity context)
 {
     this.context = context;
     shareAction  = new ShareAction(context)
                    .SetDisplayList(SHARE_MEDIA.Weixin, SHARE_MEDIA.WeixinCircle, SHARE_MEDIA.Qq, SHARE_MEDIA.Qzone)
                    .AddButton("΢ÐÅ", "΢ÐÅÅóÓÑȦ", "QQ", "QQ¿Õ¼ä")
                    .SetShareboardclickCallback(this);
 }
示例#4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Id = Intent.GetIntExtra("id", 0);
            articlePresenter = new ArticlePresenter(this);
            handler          = new Handler();

            StatusBarCompat.SetOrdinaryToolBar(this);
            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetNavigationIcon(Resource.Drawable.back_24dp);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            toolbar.SetNavigationOnClickListener(this);
            toolbar.SetOnMenuItemClickListener(this);
            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);
            scrollView = FindViewById <NestedScrollView>(Resource.Id.scrollView);

            txtTitle    = FindViewById <TextView>(Resource.Id.txtTitle);
            imgAvatar   = FindViewById <ImageView>(Resource.Id.llAvatar);
            txtAuthor   = FindViewById <TextView>(Resource.Id.txtAuthor);
            txtPostdate = FindViewById <TextView>(Resource.Id.txtPostdate);
            txtBody     = FindViewById <WebView>(Resource.Id.txtBody);
            txtBody.Settings.JavaScriptEnabled        = true;
            txtBody.Settings.DomStorageEnabled        = true;
            txtBody.Settings.LoadsImagesAutomatically = true;
            txtBody.Settings.DefaultTextEncodingName  = "utf-8";
            txtBody.SetWebViewClient(BodyWebViewClient.With(this));
            txtBody.ScrollBarStyle = ScrollbarStyles.InsideOverlay;
            txtBody.Settings.SetSupportZoom(false);
            txtBody.Settings.BuiltInZoomControls = false;
            txtBody.Settings.CacheMode           = CacheModes.CacheElseNetwork;
            txtBody.Settings.SetLayoutAlgorithm(WebSettings.LayoutAlgorithm.SingleColumn);
            var jsInterface = new WebViewJSInterface(this);

            txtBody.AddJavascriptInterface(jsInterface, "openlistner");
            jsInterface.CallFromPageReceived += delegate(object sender, WebViewJSInterface.CallFromPageReceivedEventArgs e)
            {
                PhotoActivity.Start(this, e.Result.Split(','), e.Index);
            };

            txtDigg     = FindViewById <TextView>(Resource.Id.txtDigg);
            txtRead     = FindViewById <TextView>(Resource.Id.txtRead);
            txtComments = FindViewById <TextView>(Resource.Id.txtComments);
            txtBookmark = FindViewById <TextView>(Resource.Id.txtBookmark);

            swipeRefreshLayout.Post(async() =>
            {
                await articlePresenter.GetClientArticle(Id);
            });

            shareAction = new ShareAction(this).SetDisplayList(SHARE_MEDIA.Weixin, SHARE_MEDIA.WeixinCircle, SHARE_MEDIA.WeixinFavorite, SHARE_MEDIA.Sina).SetShareboardclickCallback(this);
        }
示例#5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            handler = new Handler();
            fm      = SupportFragmentManager;

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            toolbar.SetOnMenuItemClickListener(this);

            coordinatorLayout = FindViewById <CoordinatorLayout>(Resource.Id.coordinatorLayout);

            drawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawerLayout);
            navigationView = FindViewById <NavigationView>(Resource.Id.navigationview);
            var headerLayout = navigationView.InflateHeaderView(Resource.Layout.header_layout);

            navigationView.InflateMenu(Resource.Menu.main);
            navigationView.SetNavigationItemSelectedListener(this);
            Avatar = headerLayout.FindViewById <ImageView>(Resource.Id.headerAvatar);
            Avatar.SetOnClickListener(this);
            Author           = headerLayout.FindViewById <TextView>(Resource.Id.headerAuthor);
            Seniority        = headerLayout.FindViewById <TextView>(Resource.Id.headerSeniority);
            txtLogout        = headerLayout.FindViewById <TextView>(Resource.Id.headerLogout);
            txtLogout.Click += delegate
            {
                LoginUtils.Instance(this).DeleteUser();
                UpdateUserView();
            };

            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close);
            drawerLayout.AddDrawerListener(this);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            StatusBarCompat.SetDrawerToolbarTabLayout(this, coordinatorLayout);

            UpdateUserView();

            navigationView.Post(() =>
            {
                SwitchNavigationBar(Resource.Id.home);
            });

            updManager = IFlytekUpdate.GetInstance(this.ApplicationContext);
            updManager.SetDebugMode(true);
            updManager.SetParameter(UpdateConstants.ExtraWifionly, "true");
            updManager.SetParameter(UpdateConstants.ExtraNotiIcon, "true");
            updManager.SetParameter(UpdateConstants.ExtraStyle, UpdateConstants.UpdateUiDialog);
            updManager.AutoUpdate(this, this);

            shareAction = new ShareAction(this).SetDisplayList(SHARE_MEDIA.Weixin, SHARE_MEDIA.WeixinCircle, SHARE_MEDIA.WeixinFavorite, SHARE_MEDIA.Sina).SetShareboardclickCallback(this);
        }
示例#6
0
    private void RPC_AddAction(string data, PhotonMessageInfo info)
    {
        string[] actionData      = data.Split(',');
        Action   actionToPerform = new Action(this);

        switch (actionData[1])
        {
        case "hitShip":
            actionToPerform = new HitShipAction(this);
            break;

        case "move":
            actionToPerform = new MoveAction(this);
            break;

        case "search":
            actionToPerform = new SearchAction(this);
            break;

        case "repair":
            actionToPerform = new RepairAction(this);
            break;

        case "heal":
            actionToPerform = new HealAction(this);
            break;

        case "boostShields":
            actionToPerform = new BoostShieldsAction(this);
            break;

        case "share":
            actionToPerform = new ShareAction(this);
            break;

        case "suffocate":
            actionToPerform = new SuffocateAction(this);
            break;
        }

        actionToPerform.Deserialize(actionData);
        actions.Add(int.Parse(actionData[0]), actionToPerform);
    }
示例#7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Id = Intent.GetIntExtra("id", 0);
            questionPresenter = new QuestionPresenter(this);
            handler           = new Handler();

            StatusBarCompat.SetOrdinaryToolBar(this);
            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetNavigationIcon(Resource.Drawable.back_24dp);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            toolbar.SetNavigationOnClickListener(this);
            toolbar.SetOnMenuItemClickListener(this);

            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);

            txtTitle     = FindViewById <TextView>(Resource.Id.txtTitle);
            imgIconName  = FindViewById <ImageView>(Resource.Id.imgIconName);
            txtUserName  = FindViewById <TextView>(Resource.Id.txtUserName);
            txtScore     = FindViewById <TextView>(Resource.Id.txtScore);
            txtDateAdded = FindViewById <TextView>(Resource.Id.txtDateAdded);
            txtGold      = FindViewById <TextView>(Resource.Id.txtGold);
            txtDealFlag  = FindViewById <TextView>(Resource.Id.txtDealFlag);
            txtTag       = FindViewById <TextView>(Resource.Id.txtTag);
            this.txtDealFlag.Selected = true;
            txtBody = FindViewById <WebView>(Resource.Id.txtBody);
            txtBody.Settings.JavaScriptEnabled        = true;
            txtBody.Settings.DomStorageEnabled        = true;
            txtBody.Settings.LoadsImagesAutomatically = true;
            txtBody.Settings.DefaultTextEncodingName  = "utf-8";
            txtBody.SetWebViewClient(BodyWebViewClient.With(this));
            txtBody.ScrollBarStyle = ScrollbarStyles.InsideOverlay;
            txtBody.Settings.SetSupportZoom(false);
            txtBody.Settings.BuiltInZoomControls = false;
            txtBody.Settings.CacheMode           = CacheModes.CacheElseNetwork;
            txtBody.Settings.SetLayoutAlgorithm(WebSettings.LayoutAlgorithm.SingleColumn);
            var jsInterface = new WebViewJSInterface(this);

            txtBody.AddJavascriptInterface(jsInterface, "openlistner");
            jsInterface.CallFromPageReceived += delegate(object sender, WebViewJSInterface.CallFromPageReceivedEventArgs e)
            {
                PhotoActivity.Start(this, e.Result.Split(','), e.Index);
            };
            txtDigg          = FindViewById <TextView>(Resource.Id.txtDigg);
            txtRead          = FindViewById <TextView>(Resource.Id.txtRead);
            txtBookmark      = FindViewById <TextView>(Resource.Id.txtBookmark);
            txtComments      = FindViewById <TextView>(Resource.Id.txtComments);
            txtComments.Text = Resources.GetString(Resource.String.answer);

            (txtComments.Parent as FrameLayout).Click += delegate
            {
                if (question != null && question.Qid > 0)
                {
                    QuestionAnswersActivity.Start(this, question.Qid);
                }
            };
            (txtBookmark.Parent as FrameLayout).Click += delegate
            {
                if (question != null && question.Qid > 0)
                {
                    var linkurl = "https://q.cnblogs.com/q/" + question.Qid + "/";
                    var title   = question.Title + "_²©ÎÊ_²©¿ÍÔ°";
                    BookmarkAddActivity.Start(this, linkurl, title, true);
                }
            };
            swipeRefreshLayout.Post(async() =>
            {
                await questionPresenter.GetClientQuestion(Id);
            });
            shareAction = new ShareAction(this).SetDisplayList(SHARE_MEDIA.Weixin, SHARE_MEDIA.WeixinCircle, SHARE_MEDIA.WeixinFavorite, SHARE_MEDIA.Sina).SetShareboardclickCallback(this);
        }
示例#8
0
        private void StartResquestForSharePoster(ShareAction shareAction)
        {
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("babyId", PlayerPrefsUtil.GetBabyId());
            paramDict.Add("shareType", 2);
            paramDict.Add("medalGrade", mData.medalModel.medalGrade);
            HttpUtil.PostWithSign <string>(UrlConst.SharePoster, paramDict)
            .Subscribe(response =>
            {
                Log.I("图片地址: " + response);
                if (shareAction == ShareAction.Save)
                {
                    if (Application.platform == RuntimePlatform.Android)
                    {
                        NativeGallery.RequestPermission((result, action) =>
                        {
                            if (result == (int)NativeGallery.Permission.Granted)
                            {
                                AndroidForUnity.CallAndroidForSavePicToAlbum(response);
                                CommonUtil.toast("保存成功");
                            }
                        }, (int)NativeAction.Album);
                    }
                    else if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        IOSClientUtil.SaveImageToAlubmCallIOSClient(response);
                    }
                }
                else if (shareAction == ShareAction.Wechat)
                {
                    if (Application.platform == RuntimePlatform.Android)
                    {
                        ShareModel shareModel   = new ShareModel();
                        shareModel.imageUrl     = response;
                        shareModel.platformName = AppConst.SHARE_WECHAT;
                        shareModel.type         = AppConst.SHARE_IMAGE_TYPE;
                        shareModel.title        = AppConst.SHARE_TITLE;
                        if (mData.medalModel.isShare == 0)
                        {
                            shareModel.toastMessage = "分享成功+" + mData.medalModel.medalShareScore + "积分";
                        }
                        AndroidForUnity.CallAndroidForShare(SerializeHelper.ToJson(shareModel));
                    }
                    else if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        Dictionary <string, object> sharParmsDic = new Dictionary <string, object>();
                        sharParmsDic.Add("platformType", "WechatSession");
                        sharParmsDic.Add("shareType", "image");
                        sharParmsDic.Add("image", response);
                        if (mData.medalModel.isShare == 0)
                        {
                            string shareToastMessage = "分享成功+" + mData.medalModel.medalShareScore + "积分";
                            sharParmsDic.Add("shareToastMsg", shareToastMessage);
                        }
                        IOSClientUtil.ShareObjectCallIOSClient(SerializeHelper.ToJson(sharParmsDic));
                    }
                }
                else if (shareAction == ShareAction.WechatMoments)
                {
                    if (Application.platform == RuntimePlatform.Android)
                    {
                        ShareModel shareModel   = new ShareModel();
                        shareModel.imageUrl     = response;
                        shareModel.platformName = AppConst.SHARE_WECHAT_MOMENTS;
                        shareModel.type         = AppConst.SHARE_IMAGE_TYPE;
                        shareModel.title        = AppConst.SHARE_TITLE;
                        if (mData.medalModel.isShare == 0)
                        {
                            shareModel.toastMessage = "分享成功+" + mData.medalModel.medalShareScore + "积分";
                        }
                        AndroidForUnity.CallAndroidForShare(SerializeHelper.ToJson(shareModel));
                    }
                    else if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        Dictionary <string, object> sharParmsDic = new Dictionary <string, object>();
                        sharParmsDic.Add("platformType", "WechatTimeLine");
                        sharParmsDic.Add("shareType", "image");
                        sharParmsDic.Add("image", response);

                        if (mData.medalModel.isShare == 0)
                        {
                            string shareToastMessage = "分享成功+" + mData.medalModel.medalShareScore + "积分";
                            sharParmsDic.Add("shareToastMsg", shareToastMessage);
                        }
                        IOSClientUtil.ShareObjectCallIOSClient(SerializeHelper.ToJson(sharParmsDic));
                    }
                }
            }
                       , e =>
            {
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }