com.tencent.connect.share.QzoneShare Java Examples

The following examples show how to use com.tencent.connect.share.QzoneShare. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QQShareApi.java    From browser with GNU General Public License v2.0 6 votes vote down vote up
public static void shareToQzone (final Activity activity,final String url,final String title,final String desc,final String img,IUiListener listener) {

        if (api == null) {
            api = Tencent.createInstance(APP_ID, MainApp.getContext());
        }


        if(api==null){
            return;
        }

        ArrayList<String> imgs=new ArrayList<>();
        if(!StringUtils.isEmpty(img)) {
            imgs.add(img);
        }else{
            imgs.add("http://youkes.oss.aliyuncs.com/icon/icon_96.png");
        }
        final Bundle params = new Bundle();
        params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);//必填
        params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, desc);//选填
        params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, url);//必填
        params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgs);
        api.shareToQzone(activity, params, listener);
    }
 
Example #2
Source File: QQZoneShareHandler.java    From BiliShare with Apache License 2.0 6 votes vote down vote up
private void shareImageText(BaseShareParam params, ShareImage image) throws ShareException {
    if (TextUtils.isEmpty(params.getTitle()) || TextUtils.isEmpty(params.getTargetUrl())) {
        throw new InvalidParamException("Title or target url is empty or illegal");
    }

    Log.d(TAG, "share image text");
    Bundle bundle = new Bundle();
    bundle.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    bundle.putString(QzoneShare.SHARE_TO_QQ_TITLE, params.getTitle());
    bundle.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, params.getContent());
    bundle.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, params.getTargetUrl());

    ArrayList<String> imageUrls = new ArrayList<>();
    if (image != null) {
        if (image.isNetImage()) {
            imageUrls.add(image.getNetImageUrl());
        } else if (image.isLocalImage()) {
            imageUrls.add(image.getLocalPath());
        }
    }
    bundle.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imageUrls);

    doShareToQQ((Activity) getContext(), bundle);
}
 
Example #3
Source File: AbstractShare.java    From LoginSharePay with Apache License 2.0 6 votes vote down vote up
@Override
public void launchQQShare(QQMessageBody qqMessageBody) {
    super.launchQQShare(qqMessageBody);
    Bundle bundle = new Bundle();
    if (qqMessageBody.type == QQMessageBody.QQChat) {
        bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
        bundle.putString(QQShare.SHARE_TO_QQ_TITLE, qqMessageBody.getTitle());
        bundle.putString(QQShare.SHARE_TO_QQ_SUMMARY, qqMessageBody.getSummary());
        bundle.putString(QQShare.SHARE_TO_QQ_TARGET_URL, qqMessageBody.getTargetUrl());
        bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, qqMessageBody.getImageUrl());
        bundle.putString(QQShare.SHARE_TO_QQ_APP_NAME, appInfo.loadLabel(packageManager).toString());
        tencent.shareToQQ(activity, bundle, this);
    } else {
        bundle.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
        bundle.putString(QzoneShare.SHARE_TO_QQ_TITLE, qqMessageBody.getTitle());//必填
        bundle.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, qqMessageBody.getSummary());//选填
        bundle.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, qqMessageBody.getTargetUrl());//必填
        bundle.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, qqMessageBody.getImagesUtl());
        tencent.shareToQzone(activity, bundle, this);
    }
}
 
Example #4
Source File: QQShareInstance.java    From ShareLoginPayUtil with Apache License 2.0 6 votes vote down vote up
private void shareToQZoneForText(String text, Activity activity, ShareListener listener) {
    if (mTencent == null) {
        listener.shareFailure(new Exception("分享失败"));
        recycle();
        activity.finish();
        return;
    }
    if (listener != null) {
        listener.shareStart();
    }
    final Bundle params = new Bundle();
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, text);
    mTencent.publishToQzone(activity, params, listener);
    recycle();
}
 
Example #5
Source File: QQBaseShareInstance.java    From SimpleProject with MIT License 6 votes vote down vote up
@Override
public void onShare(String title, String desc, String iconUrl, String url) {
	if (tencent != null) {
		Bundle params = new Bundle();
		if (flowId == ShareConstants.SHARE_BY_QQ) {
			params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
			params.putString(QQShare.SHARE_TO_QQ_TITLE, title);
			params.putString(QQShare.SHARE_TO_QQ_SUMMARY, desc);
			params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, url);
			params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, iconUrl);
			tencent.shareToQQ(activity, params, this);
		} else {
			final ArrayList<String> imageList = new ArrayList<>();
			imageList.add(iconUrl);
			params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
					QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
			params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);
			params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, desc);
			params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, url);
			params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imageList);
			tencent.shareToQzone(activity, params, this);
		}
	}
}
 
Example #6
Source File: QQShareInstance.java    From ShareLoginPayUtil with Apache License 2.0 6 votes vote down vote up
private void shareToQzoneForImage(String imagePath, Activity activity, ShareListener listener) {
    if (mTencent == null) {
        listener.shareFailure(new Exception("分享失败"));
        recycle();
        activity.finish();
        return;
    }
    if (listener != null) {
        listener.shareStart();
    }
    final Bundle params = new Bundle();
    final ArrayList<String> image = new ArrayList<>();
    image.add(imagePath);
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, image);
    mTencent.publishToQzone(activity, params, listener);

    recycle();
}
 
Example #7
Source File: QQShareInstance.java    From ShareLoginPayUtil with Apache License 2.0 6 votes vote down vote up
private void shareToQZoneForMedia(String title, String targetUrl, String summary,
                                  String imageUrl, Activity activity, ShareListener listener) {
    if (mTencent == null) {
        listener.shareFailure(new Exception("分享失败"));
        recycle();
        activity.finish();
        return;
    }
    if (listener != null) {
        listener.shareStart();
    }
    final Bundle params = new Bundle();
    final ArrayList<String> image = new ArrayList<>();
    image.add(imageUrl);
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, summary);
    params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, targetUrl);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, image);
    mTencent.shareToQzone(activity, params, listener);
    recycle();
}
 
Example #8
Source File: SharePopWindow.java    From QiQuYing with Apache License 2.0 5 votes vote down vote up
/**
 * 分享到QQ空间
 */
private void share2QZone() {
	ArrayList<String> imgList = new ArrayList<String>();
	//分享类型
	final Bundle params = new Bundle();
	params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
	switch (mJoke.getType()) {
	case Joke.TYPE_QUSHI:
		params.putString(QzoneShare.SHARE_TO_QQ_TITLE, context.getString(R.string.share_title_qushi));
		params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY,  mJoke.getContent().trim());
		//这里应该填写应用图标的图片
		imgList.add(appLogoUrl);
		params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgList);
		break;
	case Joke.TYPE_QUTU:
		params.putString(QzoneShare.SHARE_TO_QQ_TITLE, context.getString(R.string.share_title_qutu));
		params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY,  mJoke.getTitle());
		imgList.add(mJoke.getImgUrl());
		params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgList);
		break;
	case Joke.TYPE_MEITU:
		params.putString(QzoneShare.SHARE_TO_QQ_TITLE, context.getString(R.string.share_title_meitu));
		params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, mJoke.getTitle());
		imgList.add(mJoke.getImgUrl());
		params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgList);
		break;
	}
	params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, targetUrl + mJoke.getId());//必填
	App.mTencent.shareToQzone((Activity)context, params, iUiListener);
}
 
Example #9
Source File: QQShareManager.java    From sharesdk with Apache License 2.0 5 votes vote down vote up
QQShareManager(Context context) {
    mAppId = ShareSDK.getInstance().getQQAppId();
    mContext = context;
    if (!TextUtils.isEmpty(mAppId)) {
        mTencent = Tencent.createInstance(mAppId, context);
        mQQShare = new QQShare(context, mTencent.getQQToken());
        mQZoneShare = new QzoneShare(context, mTencent.getQQToken());
    }
}
 
Example #10
Source File: QQShareImpl.java    From ChinaShare with MIT License 5 votes vote down vote up
public void shareToQzeon(String title, String content, String shareUrl,
                         String imgUrl) {
    final Bundle params = new Bundle();
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);
    params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, shareUrl);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, content);
    params.putString(QzoneShare.SHARE_TO_QQ_APP_NAME, ShareManager.getAppName());
    ArrayList<String> list = new ArrayList<String>();
    if (!TextUtils.isEmpty(imgUrl)) {
        list.add(imgUrl);
    } else {
        if(!TextUtils.isEmpty(ShareManager.getDefShareImageUrl())){
            list.add(ShareManager.getDefShareImageUrl());
        }
    }
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, list);
    mTencent.shareToQzone(mActivity, params, new IUiListener() {

        @Override
        public void onCancel() {
        }

        @Override
        public void onError(UiError e) {
            String message = mActivity.getString(R.string.share_fail) + " " + e.errorMessage;
            Toast.makeText(mActivity, message, Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onComplete(Object response) {

        }

    });
}
 
Example #11
Source File: QQShareProxy.java    From ESSocialSDK with Apache License 2.0 5 votes vote down vote up
public static void shareToQZone(Context context, String appId, String title, String summary, String url,
                                String imageUrl, IUiListener listener) {
    Bundle params = new Bundle();
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, summary);
    params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, url);
    ArrayList<String> imgs = new ArrayList<String>();
    imgs.add(imageUrl);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgs);
    Tencent tencent = getInstance(context, appId);
    tencent.shareToQzone((Activity) context, params, listener);
}
 
Example #12
Source File: QQShareInstance.java    From smart-farmer-android with Apache License 2.0 5 votes vote down vote up
private void shareToQzoneForImage(String imagePath, Activity activity, ShareListener listener) {
    final Bundle params = new Bundle();
    final ArrayList<String> image = new ArrayList<>();
    image.add(imagePath);
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, image);
    mTencent.publishToQzone(activity, params, listener);
}
 
Example #13
Source File: QQShareInstance.java    From smart-farmer-android with Apache License 2.0 5 votes vote down vote up
private void shareToQZoneForMedia(String title, String targetUrl, String summary,
        String imageUrl, Activity activity, ShareListener listener) {
    final Bundle params = new Bundle();
    final ArrayList<String> image = new ArrayList<>();
    image.add(imageUrl);
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, summary);
    params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, targetUrl);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, image);
    mTencent.shareToQzone(activity, params, listener);
}
 
Example #14
Source File: QQShareInstance.java    From smart-farmer-android with Apache License 2.0 5 votes vote down vote up
private void shareToQZoneForText(String text, Activity activity, ShareListener listener) {
    final Bundle params = new Bundle();
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, text);
    mTencent.publishToQzone(activity, params, listener);
}
 
Example #15
Source File: QQShareInstance.java    From ShareUtil with Apache License 2.0 5 votes vote down vote up
private void shareToQzoneForImage(String imagePath, Activity activity, ShareListener listener) {
    final Bundle params = new Bundle();
    final ArrayList<String> image = new ArrayList<>();
    image.add(imagePath);
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, image);
    mTencent.publishToQzone(activity, params, listener);
}
 
Example #16
Source File: QQShareInstance.java    From ShareUtil with Apache License 2.0 5 votes vote down vote up
private void shareToQZoneForMedia(String title, String targetUrl, String summary,
        String imageUrl, Activity activity, ShareListener listener) {
    final Bundle params = new Bundle();
    final ArrayList<String> image = new ArrayList<>();
    image.add(imageUrl);
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, summary);
    params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, targetUrl);
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, image);
    mTencent.shareToQzone(activity, params, listener);
}
 
Example #17
Source File: QQShareInstance.java    From ShareUtil with Apache License 2.0 5 votes vote down vote up
private void shareToQZoneForText(String text, Activity activity, ShareListener listener) {
    final Bundle params = new Bundle();
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE,
            QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, text);
    mTencent.publishToQzone(activity, params, listener);
}
 
Example #18
Source File: QQPlatform.java    From SocialSdkLibrary with Apache License 2.0 5 votes vote down vote up
private void shareText(int shareTarget, Activity activity, ShareObj shareMediaObj) {
    if (shareTarget == Target.SHARE_QQ_FRIENDS) {
        try {
            IntentShareUtil.shareQQText(activity, shareMediaObj);
        } catch (SocialError e) {
            e.printStackTrace();
            onShareFail(e);
        }
    } else if (shareTarget == Target.SHARE_QQ_ZONE) {
        final Bundle params = new Bundle();
        params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
        params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, shareMediaObj.getSummary());
        mTencentApi.publishToQzone(activity, params, mIUiListenerWrap);
    }
}
 
Example #19
Source File: QQShareEntity.java    From SocialHelper with Apache License 2.0 5 votes vote down vote up
/**
 * 创建分享视频说说到qq空间
 *
 * @param videoUrl 视频地址,只支持本地视频;上传视频的大小最好控制在100M以内(因为QQ普通用户上传视频必须在100M以内,黄钻用户可上传1G以内视频,大于1G会直接报错。)
 */
public static ShareEntity createPublishVideoToQZone(@ParamsRequired String videoUrl) {
    ShareEntity entity = new ShareEntity(ShareEntity.TYPE_PUBLISH);
    addParams(entity.params, QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHVIDEO);
    addParams(entity.params, QzonePublish.PUBLISH_TO_QZONE_VIDEO_PATH, videoUrl);
    return entity;
}
 
Example #20
Source File: QQShareEntity.java    From SocialHelper with Apache License 2.0 5 votes vote down vote up
/**
 * 创建分享图文说说到qq空间
 *
 * @param imgUrl 图片地址,只支持本地图片;注:<=9张图片为发表说说,>9张为上传图片到相册
 */
public static ShareEntity createPublishImageToQZone(@ParamsRequired ArrayList<String> imgUrl) {
    ShareEntity entity = new ShareEntity(ShareEntity.TYPE_PUBLISH);
    addParams(entity.params, QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    addParams(entity.params, QzonePublish.PUBLISH_TO_QZONE_IMAGE_URL, imgUrl);
    return entity;
}
 
Example #21
Source File: QQShareEntity.java    From SocialHelper with Apache License 2.0 5 votes vote down vote up
/**
 * 创建分享图文说说到qq空间
 *
 * @param summary 摘要,长度限制600个字
 */
public static ShareEntity createPublishTextToQZone(@ParamsRequired String summary) {
    ShareEntity entity = new ShareEntity(ShareEntity.TYPE_PUBLISH);
    addParams(entity.params, QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzonePublish.PUBLISH_TO_QZONE_TYPE_PUBLISHMOOD);
    addParams(entity.params, QzoneShare.SHARE_TO_QQ_SUMMARY, summary);
    return entity;
}
 
Example #22
Source File: QQShareEntity.java    From SocialHelper with Apache License 2.0 5 votes vote down vote up
/**
 * 创建分享图文到qq空间
 *
 * @param title     标题,长度限制200个字符
 * @param targetUrl 跳转地址
 * @param imgUrl    图片地址,目前会第一张有效,待qq优化
 * @param summary   摘要,长度限制600个字
 * @param appName   应用名;手Q客户端顶部,替换“返回”按钮文字,如果为空,用返回代替
 */
public static ShareEntity createImageTextInfoToQZone(@ParamsRequired String title, @ParamsRequired String targetUrl,
                                                     @ParamsRequired ArrayList<String> imgUrl, String summary, String appName) {
    ShareEntity entity = new ShareEntity(ShareEntity.TYPE_Q_ZONE);
    addParams(entity.params, QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    addParams(entity.params, QzoneShare.SHARE_TO_QQ_TITLE, title);
    addParams(entity.params, QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl);
    addParams(entity.params, QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgUrl);
    addParams(entity.params, QzoneShare.SHARE_TO_QQ_SUMMARY, summary);
    addParams(entity.params, QzoneShare.SHARE_TO_QQ_APP_NAME, appName);
    return entity;
}
 
Example #23
Source File: AppbarActivity.java    From letv with Apache License 2.0 5 votes vote down vote up
public void shareToQzone() {
    final QQToken token = getToken();
    if (token != null) {
        QzoneShare qzoneShare = new QzoneShare(this, token);
        Bundle bundle = new Bundle();
        bundle.putInt("req_type", 1);
        bundle.putString("title", this.model.a);
        bundle.putString("summary", this.model.b);
        bundle.putString("targetUrl", this.model.d);
        ArrayList arrayList = new ArrayList();
        f.b(f.d, "-->shareToQzone : mIconUrl = " + this.model.c);
        arrayList.add(this.model.c);
        bundle.putStringArrayList("imageUrl", arrayList);
        qzoneShare.shareToQzone(this, bundle, new IUiListener(this) {
            final /* synthetic */ AppbarActivity b;

            public void onError(UiError uiError) {
                f.b(f.d, "-->(AppbarActivity)shareToQzone onError");
                this.b.jsBridge.responseShareFail(2);
            }

            public void onComplete(Object obj) {
                f.b(f.d, "-->(AppbarActivity)shareToQzone onComplete");
                this.b.jsBridge.responseShare(2);
                a.a(token.getAppId(), PLAYER.PLAY, "SDK.APPBAR.HOME.SHARE.QZ");
            }

            public void onCancel() {
                f.b(f.d, "-->(AppbarActivity)shareToQzone onCancel");
                this.b.jsBridge.responseShareFail(2);
            }
        });
        a.a(token.getAppId(), "200", "SDK.APPBAR.HOME.SHARE.QZ");
    }
}
 
Example #24
Source File: Tencent.java    From letv with Apache License 2.0 4 votes vote down vote up
public void shareToQzone(Activity activity, Bundle bundle, IUiListener iUiListener) {
    new QzoneShare(activity, this.mQQAuth.getQQToken()).shareToQzone(activity, bundle, iUiListener);
}
 
Example #25
Source File: BlackBoxCoinDetailsActivity.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 4 votes vote down vote up
@OnClick({R.id.img_right, R.id.go_transfer_accounts, R.id.go_make_collections})
public void onViewClicked(View view) {
    Bundle bundle = new Bundle();
    switch (view.getId()) {
        case R.id.img_right:
            String desc = null;
            final Bundle params = new Bundle();
            if (accountWithCoinBean.getCoinName().equals("OCT")) {
                desc = getString(R.string.reference_price_cny) + StringUtils.addComma(accountWithCoinBean.getOct_price_cny()) + getString(R.string.toast_down_up) + accountWithCoinBean.getCoinUpsAndDowns() + getString(R.string.all_market_price) + StringUtils.addComma(accountWithCoinBean.getOct_market_cap_cny());
            } else {
                desc = getString(R.string.reference_price_cny) + StringUtils.addComma(accountWithCoinBean.getEos_price_cny()) + getString(R.string.toast_down_up) + accountWithCoinBean.getCoinUpsAndDowns() + getString(R.string.all_market_price) + StringUtils.addComma(accountWithCoinBean.getEos_market_cap_cny());
            }
            if (dialog == null) {
                bundle.putParcelable("coin", accountWithCoinBean);
                final String finalDesc = desc;
                dialog = new ShareCoinDetailsDialog(BlackBoxCoinDetailsActivity.this, new ShareCoinDetailsCallBack() {
                    @Override
                    public void goWeixinFriend() {
                        WxShareAndLoginUtils.WxUrlShare(BlackBoxCoinDetailsActivity.this, "https://pocketeos.com", accountWithCoinBean.getCoinName() + "最新资讯详情", finalDesc,
                                MyApplication.getInstance().getUserBean().getWallet_img(),
                                WxShareAndLoginUtils.WECHAT_FRIEND);
                    }

                    @Override
                    public void goWeixinCircle() {
                        WxShareAndLoginUtils.WxUrlShare(BlackBoxCoinDetailsActivity.this, "https://pocketeos.com", accountWithCoinBean.getCoinName() + "最新资讯详情", finalDesc,
                                MyApplication.getInstance().getUserBean().getWallet_img(),
                                WxShareAndLoginUtils.WECHAT_MOMENT);
                    }

                    @Override
                    public void goQQFriend() {
                        params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
                        params.putString(QQShare.SHARE_TO_QQ_TITLE, accountWithCoinBean.getCoinName() + "最新资讯详情");// 标题
                        params.putString(QQShare.SHARE_TO_QQ_SUMMARY, finalDesc);// 摘要
                        params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, "https://pocketeos.com");// 内容地址
                        params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, "http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");
                        params.putString(QQShare.SHARE_TO_QQ_EXT_INT, "其它附加功能");
                        MyApplication.getInstance().getTencent().shareToQQ(BlackBoxCoinDetailsActivity.this, params, new BaseUIListener(BlackBoxCoinDetailsActivity.this, true));
                    }

                    @Override
                    public void goQzone() {
                        params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
                        params.putString(QzoneShare.SHARE_TO_QQ_TITLE, accountWithCoinBean.getCoinName() + "最新资讯详情");// 标题
                        params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, finalDesc);// 摘要
                        params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, "https://pocketeos.com");// 内容地址
                        ArrayList<String> imgUrlList = new ArrayList<>();
                        imgUrlList.add("http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");
                        params.putStringArrayList(QzonePublish.PUBLISH_TO_QZONE_IMAGE_URL,
                                imgUrlList);// 图片地址ArrayList
                        MyApplication.getInstance().getTencent().shareToQzone(BlackBoxCoinDetailsActivity.this, params, new BaseUIListener(BlackBoxCoinDetailsActivity.this, true));
                    }
                });
                dialog.setContent(bundle);
                dialog.setCancelable(true);
                dialog.show();
            } else {
                dialog.show();
            }
            break;
        case R.id.go_transfer_accounts:
            bundle.putString("account", getIntent().getStringExtra("account"));
            bundle.putString("coin", accountWithCoinBean.getCoinName());
            bundle.putString("from", "coin");
            ActivityUtils.next(BlackBoxCoinDetailsActivity.this, TransferAccountsActivity.class, bundle, 100);
            break;
        case R.id.go_make_collections:
            bundle.putString("account", getIntent().getStringExtra("account"));
            bundle.putString("coin", accountWithCoinBean.getCoinName());
            bundle.putString("from", "coin");
            ActivityUtils.next(BlackBoxCoinDetailsActivity.this, TransferAccountsActivity.class, bundle, 100);
            break;
    }
}
 
Example #26
Source File: ShareByQZone.java    From ShareSDK with MIT License 4 votes vote down vote up
@Override
public void share(ShareEntity data, final OnShareListener listener) {
    if (null == data) {
        return;
    }
    if (context == null || !(context instanceof Activity)) {
        return;
    }
    final Bundle params = new Bundle();
    params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
    params.putString(QzoneShare.SHARE_TO_QQ_TITLE, data.getTitle());//必填
    params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, data.getContent());//选填
    params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, data.getUrl());//必填
    ArrayList<String> arrayList = new ArrayList<>();
    if (!TextUtils.isEmpty(data.getImgUrl())) {
        arrayList.add(data.getImgUrl());
    }
    params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, arrayList);
    mTencent.shareToQzone((Activity) context, params, new IUiListener() {
        @Override
        public void onComplete(Object o) {
            if (null != listener) {
                listener.onShare(ShareConstant.SHARE_CHANNEL_QZONE, ShareConstant.SHARE_STATUS_COMPLETE);
            }
            ToastUtil.showToast(context, R.string.share_success, true);
        }
        @Override
        public void onError(UiError uiError) {
            if (null != listener) {
                listener.onShare(ShareConstant.SHARE_CHANNEL_QZONE, ShareConstant.SHARE_STATUS_FAILED);
            }
            if (null != uiError) {
                ToastUtil.showToast(context, uiError.errorMessage, true);
            }
        }
        @Override
        public void onCancel() {
            if (null != listener) {
                listener.onShare(ShareConstant.SHARE_CHANNEL_QZONE, ShareConstant.SHARE_STATUS_CANCEL);
            }
            ToastUtil.showToast(context, R.string.share_cancel, true);
        }
    });
}
 
Example #27
Source File: CoinDetailsActivity.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 4 votes vote down vote up
@OnClick({R.id.img_right, R.id.go_transfer_accounts, R.id.go_make_collections, R.id.go_red_packet})
public void onViewClicked(View view) {
    Bundle bundle = new Bundle();
    switch (view.getId()) {
        case R.id.img_right://分享操作
            String desc = null;
            final Bundle params = new Bundle();
            if (accountWithCoinBean.getCoinName().equals("OCT")) {
                desc = getString(R.string.reference_price_cny) + StringUtils.addComma(accountWithCoinBean.getOct_price_cny()) + getString(R.string.toast_down_up) + accountWithCoinBean.getCoinUpsAndDowns() + getString(R.string.all_market_price)+ StringUtils.addComma(accountWithCoinBean.getOct_market_cap_cny());
            } else {
                desc =  getString(R.string.reference_price_cny) + StringUtils.addComma(accountWithCoinBean.getEos_price_cny()) + getString(R.string.toast_down_up) + accountWithCoinBean.getCoinUpsAndDowns() + getString(R.string.all_market_price) + StringUtils.addComma(accountWithCoinBean.getEos_market_cap_cny());
            }
            if (dialog == null) {
                bundle.putParcelable("coin", accountWithCoinBean);
                final String finalDesc = desc;
                dialog = new ShareCoinDetailsDialog(CoinDetailsActivity.this, new ShareCoinDetailsCallBack() {
                    @Override
                    public void goWeixinFriend() {
                        WxShareAndLoginUtils.WxUrlShare(CoinDetailsActivity.this, "https://pocketeos.com", accountWithCoinBean.getCoinName() + "最新资讯详情", finalDesc,
                                MyApplication.getInstance().getUserBean().getWallet_img(),
                                WxShareAndLoginUtils.WECHAT_FRIEND);
                    }

                    @Override
                    public void goWeixinCircle() {
                        WxShareAndLoginUtils.WxUrlShare(CoinDetailsActivity.this, "https://pocketeos.com", accountWithCoinBean.getCoinName() + "最新资讯详情", finalDesc,
                                MyApplication.getInstance().getUserBean().getWallet_img(),
                                WxShareAndLoginUtils.WECHAT_MOMENT);
                    }

                    @Override
                    public void goQQFriend() {
                        params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
                        params.putString(QQShare.SHARE_TO_QQ_TITLE, accountWithCoinBean.getCoinName() + "最新资讯详情");// 标题
                        params.putString(QQShare.SHARE_TO_QQ_SUMMARY, finalDesc);// 摘要
                        params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, "https://pocketeos.com");// 内容地址
                        params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, "http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");
                        params.putString(QQShare.SHARE_TO_QQ_EXT_INT, "其它附加功能");
                        MyApplication.getInstance().getTencent().shareToQQ(CoinDetailsActivity.this, params, new BaseUIListener(CoinDetailsActivity.this, true));
                    }

                    @Override
                    public void goQzone() {
                        params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
                        params.putString(QzoneShare.SHARE_TO_QQ_TITLE, accountWithCoinBean.getCoinName() + "最新资讯详情");// 标题
                        params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, finalDesc);// 摘要
                        params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, "https://pocketeos.com");// 内容地址
                        ArrayList<String> imgUrlList = new ArrayList<>();
                        imgUrlList.add("http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");
                        params.putStringArrayList(QzonePublish.PUBLISH_TO_QZONE_IMAGE_URL,
                                imgUrlList);// 图片地址ArrayList
                        MyApplication.getInstance().getTencent().shareToQzone(CoinDetailsActivity.this, params, new BaseUIListener(CoinDetailsActivity.this, true));
                    }
                });
                dialog.setContent(bundle);
                dialog.setCancelable(true);
                dialog.show();
            } else {
                dialog.show();
            }

            break;
        case R.id.go_transfer_accounts:
            bundle.putString("account", getIntent().getStringExtra("account"));
            bundle.putString("coin", accountWithCoinBean.getCoinName());
            bundle.putString("from", "coin");
            ActivityUtils.next(CoinDetailsActivity.this, TransferAccountsActivity.class, bundle, 100);
            break;
        case R.id.go_make_collections:
            bundle.putString("account", getIntent().getStringExtra("account"));
            bundle.putString("coin", accountWithCoinBean.getCoinName());
            ActivityUtils.next(CoinDetailsActivity.this, MakeCollectionsActivity.class, bundle);
            break;
        case R.id.go_red_packet:
            ActivityUtils.next(CoinDetailsActivity.this, EmptyActivity.class);
            break;
    }
}
 
Example #28
Source File: AnticipationRedPacketActivity.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 4 votes vote down vote up
@OnClick({R.id.go_weixin_friend, R.id.go_weixin_circle, R.id.go_qq_friend, R.id.go_qzone})
public void onViewClicked(View view) {
    Bundle params = new Bundle();
    if (!TextUtils.isEmpty(message)) {
        presenter.getAuthRedPacketData(mDataBean.getId(), getIntent().getStringExtra("txtid"));
    } else {
        switch (view.getId()) {
            case R.id.go_weixin_friend:
                WxShareAndLoginUtils.WxUrlShare(AnticipationRedPacketActivity.this, "https://pocketeos.com", getString(R.string.share_redpacket_title), getString(R.string.share_redpacket_message),
                        MyApplication.getInstance().getUserBean().getWallet_img(),
                        WxShareAndLoginUtils.WECHAT_FRIEND);
                break;
            case R.id.go_weixin_circle:
                WxShareAndLoginUtils.WxUrlShare(AnticipationRedPacketActivity.this, "https://pocketeos.com", getString(R.string.share_redpacket_title),
                        getString(R.string.share_redpacket_message),
                        MyApplication.getInstance().getUserBean().getWallet_img(),
                        WxShareAndLoginUtils.WECHAT_MOMENT);
                break;
            case R.id.go_qq_friend:
                params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
                params.putString(QQShare.SHARE_TO_QQ_TITLE, getString(R.string.share_redpacket_title));// 标题
                params.putString(QQShare.SHARE_TO_QQ_SUMMARY, getString(R.string.share_redpacket_message));// 摘要
                params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, "http://192.168.33.17:8081?id=" + mDataBean.getId() + "&verifystring=" + mDataBean.getVerifyString());// 内容地址
                params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, "http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");// 网络图片地址
                params.putString(QQShare.SHARE_TO_QQ_EXT_INT, "其它附加功能");
                MyApplication.getInstance().getTencent().shareToQQ(AnticipationRedPacketActivity.this, params, new BaseUIListener(AnticipationRedPacketActivity.this, true));
                break;
            case R.id.go_qzone:
                params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
                params.putString(QzoneShare.SHARE_TO_QQ_TITLE, getString(R.string.share_redpacket_title));// 标题
                params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, getString(R.string.share_redpacket_message));// 摘要
                params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, "https://pocketeos.com");// 内容地址
                ArrayList<String> imgUrlList = new ArrayList<>();
                imgUrlList.add("http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");
                params.putStringArrayList(QzonePublish.PUBLISH_TO_QZONE_IMAGE_URL,
                        imgUrlList);// 图片地址ArrayList
                MyApplication.getInstance().getTencent().shareToQzone(AnticipationRedPacketActivity.this, params, new BaseUIListener(AnticipationRedPacketActivity.this, true));
                break;
        }
    }
}
 
Example #29
Source File: Tencent.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void shareToQzone(Activity activity, Bundle bundle, IUiListener iuilistener)
{
    (new QzoneShare(activity, a.getQQToken())).shareToQzone(activity, bundle, iuilistener);
}
 
Example #30
Source File: ContinueRdPacketActivity.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 4 votes vote down vote up
@OnClick({R.id.iv_back, R.id.go_red_pocket})
public void onViewClicked(View view) {
    switch (view.getId()) {
        case R.id.iv_back:
            finish();
            break;
        case R.id.go_red_pocket:
            final Bundle params = new Bundle();
            if (dialog == null) {
                dialog = new ShareDialog(ContinueRdPacketActivity.this, new ShareCallBack() {
                    @Override
                    public void goWeixinFriend() {
                        WxShareAndLoginUtils.WxUrlShare(ContinueRdPacketActivity.this,
                                "https://pocketeos.com",
                                getString(R.string.share_redpacket_title),
                                mRedPacketStatus.getText().toString(),
                                MyApplication.getInstance().getUserBean().getWallet_img(),
                                WxShareAndLoginUtils.WECHAT_FRIEND);
                    }

                    @Override
                    public void goWeixinCircle() {
                        WxShareAndLoginUtils.WxUrlShare(ContinueRdPacketActivity.this, "https://pocketeos.com",
                                getString(R.string.share_redpacket_title),
                                mRedPacketStatus.getText().toString(),
                                MyApplication.getInstance().getUserBean().getWallet_img(),
                                WxShareAndLoginUtils.WECHAT_MOMENT);
                    }

                    @Override
                    public void goQQFriend() {
                        params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT);
                        params.putString(QQShare.SHARE_TO_QQ_TITLE, getString(R.string.share_redpacket_title));// 标题
                        params.putString(QQShare.SHARE_TO_QQ_SUMMARY, mRedPacketStatus.getText().toString());// 摘要
                        params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, "http://10.0.0.48:8081?id=" + mDataBean.getId() + "&verifystring=" + mDataBean.getVerifyString());// 内容地址
                        params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, "http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");// 网络图片地址
                        params.putString(QQShare.SHARE_TO_QQ_EXT_INT, "其它附加功能");
                        MyApplication.getInstance().getTencent().shareToQQ(ContinueRdPacketActivity.this, params, new BaseUIListener(ContinueRdPacketActivity.this, true));
                    }

                    @Override
                    public void goQzone() {
                        params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT);
                        params.putString(QzoneShare.SHARE_TO_QQ_TITLE, getString(R.string.share_redpacket_title));// 标题
                        params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, mRedPacketStatus.getText().toString());// 摘要
                        params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, "https://pocketeos.com");// 内容地址
                        ArrayList<String> imgUrlList = new ArrayList<>();
                        imgUrlList.add("http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");
                        params.putStringArrayList(QzonePublish.PUBLISH_TO_QZONE_IMAGE_URL,
                                imgUrlList);// 图片地址ArrayList
                        MyApplication.getInstance().getTencent().shareToQzone(ContinueRdPacketActivity.this, params, new BaseUIListener(ContinueRdPacketActivity.this, true));
                    }
                });
                dialog.setContent(getString(R.string.red_packet_send_to));
                dialog.setCancelable(true);
                dialog.show();
            } else {
                dialog.show();
            }

            break;
    }
}