com.tencent.tauth.IUiListener Java Examples
The following examples show how to use
com.tencent.tauth.IUiListener.
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: LocationApi.java From letv with Apache License 2.0 | 6 votes |
public void searchNearby(Activity activity, Bundle bundle, IUiListener iUiListener) { if (c()) { this.e = bundle; this.f = iUiListener; this.b.post(new Runnable(this) { final /* synthetic */ LocationApi a; { this.a = r1; } public void run() { if (this.a.d.a()) { Message.obtain(this.a.c, 103).sendToTarget(); } else { Message.obtain(this.a.c, 104).sendToTarget(); } } }); } else if (iUiListener != null) { iUiListener.onComplete(d()); } }
Example #2
Source File: SocialApiIml.java From letv with Apache License 2.0 | 6 votes |
public void reactive(Activity activity, Bundle bundle, IUiListener iUiListener) { this.b = activity; Intent agentIntentWithTarget = getAgentIntentWithTarget(SocialConstants.ACTIVITY_FRIEND_CHOOSER); if (agentIntentWithTarget == null) { agentIntentWithTarget = getAgentIntentWithTarget(SocialConstants.ACTIVITY_REACTIVE); } bundle.putAll(composeActivityParams()); String envUrl = ServerSetting.getInstance().getEnvUrl(Global.getContext(), ServerSetting.DEFAULT_URL_REACTIVE); if (agentIntentWithTarget == null && a()) { this.mProgressDialog = new ProgressDialog(activity); this.mProgressDialog.setMessage("请稍候..."); this.mProgressDialog.show(); bundle.putString("type", SocialConstants.TYPE_REACTIVE); a(activity, SocialConstants.ACTION_REACTIVE, new a(this, a(bundle, SocialConstants.ACTION_REACTIVE, envUrl, iUiListener))); return; } bundle.putString(SocialConstants.PARAM_SEND_IMG, bundle.getString("img")); bundle.putString("type", SocialConstants.TYPE_REACTIVE); bundle.remove("img"); a(activity, agentIntentWithTarget, SocialConstants.ACTION_REACTIVE, bundle, envUrl, iUiListener, false); }
Example #3
Source File: AuthAgent.java From letv with Apache License 2.0 | 6 votes |
protected void a(IUiListener iUiListener) { f.c(f.d, "reportDAU() -- start"); String str = "tencent&sdk&qazxc***14969%%"; String str2 = "qzone3.4"; Object accessToken = this.mToken.getAccessToken(); Object openId = this.mToken.getOpenId(); Object appId = this.mToken.getAppId(); Object obj = ""; if (!(TextUtils.isEmpty(accessToken) || TextUtils.isEmpty(openId) || TextUtils.isEmpty(appId))) { obj = Util.encrypt(str + accessToken + appId + openId + str2); } if (TextUtils.isEmpty(obj)) { f.e(f.d, "reportDAU -- encrytoken is null"); return; } Bundle composeCGIParams = composeCGIParams(); composeCGIParams.putString("encrytoken", obj); HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://openmobile.qq.com/user/user_login_statis", composeCGIParams, "POST", null); f.c(f.d, "reportDAU() -- end"); }
Example #4
Source File: QQAvatar.java From letv with Apache License 2.0 | 6 votes |
public void setAvatar(Activity activity, Uri uri, IUiListener iUiListener, int i) { if (this.a != null) { this.a.onCancel(); } this.a = iUiListener; Bundle bundle = new Bundle(); bundle.putString(SocialConstants.PARAM_AVATAR_URI, uri.toString()); bundle.putInt("exitAnim", i); bundle.putString("appid", this.mToken.getAppId()); bundle.putString("access_token", this.mToken.getAccessToken()); bundle.putLong("expires_in", this.mToken.getExpireTimeInSecond()); bundle.putString("openid", this.mToken.getOpenId()); this.mActivityIntent = a(activity); if (hasActivityForIntent()) { a(activity, bundle); d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_SET_AVATAR, "12", "18", "0"); return; } d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_SET_AVATAR, "12", "18", "1"); }
Example #5
Source File: BrowserActivity.java From browser with GNU General Public License v2.0 | 6 votes |
private void shareQQZone(String url,String title,String imageUrl){ QQShareApi.shareToQzone(this, url, title, "", imageUrl, new IUiListener() { @Override public void onComplete(Object o) { } @Override public void onError(UiError uiError) { } @Override public void onCancel() { } }); }
Example #6
Source File: QQAuth.java From letv with Apache License 2.0 | 6 votes |
private int a(Activity activity, Fragment fragment, String str, IUiListener iUiListener, String str2) { String str3; String packageName = activity.getApplicationContext().getPackageName(); for (ApplicationInfo applicationInfo : activity.getPackageManager().getInstalledApplications(128)) { if (packageName.equals(applicationInfo.packageName)) { str3 = applicationInfo.sourceDir; break; } } str3 = null; if (str3 != null) { try { String readChannelId = ApkExternalInfoTool.readChannelId(new File(str3)); if (!TextUtils.isEmpty(readChannelId)) { f.b(f.d, "-->login channelId: " + readChannelId); return loginWithOEM(activity, str, iUiListener, readChannelId, readChannelId, ""); } } catch (IOException e) { f.b(f.d, "-->login get channel id exception." + e.getMessage()); e.printStackTrace(); } } f.b(f.d, "-->login channelId is null "); BaseApi.isOEM = false; return this.a.doLogin(activity, str, iUiListener, false, fragment); }
Example #7
Source File: SocialApiIml.java From letv with Apache License 2.0 | 6 votes |
private void a(Activity activity, String str, Bundle bundle, String str2, IUiListener iUiListener) { f.b(f.d, "-->handleIntentWithH5 " + str + " params=" + bundle); Intent targetActivityIntent = getTargetActivityIntent("com.tencent.open.agent.AgentActivity"); Object cVar = new c(this, activity, iUiListener, str, str2, bundle); Intent targetActivityIntent2 = getTargetActivityIntent("com.tencent.open.agent.EncryTokenActivity"); if (targetActivityIntent2 == null || targetActivityIntent == null || targetActivityIntent.getComponent() == null || targetActivityIntent2.getComponent() == null || !targetActivityIntent.getComponent().getPackageName().equals(targetActivityIntent2.getComponent().getPackageName())) { String encrypt = Util.encrypt("tencent&sdk&qazxc***14969%%" + this.mToken.getAccessToken() + this.mToken.getAppId() + this.mToken.getOpenId() + "qzone3.4"); JSONObject jSONObject = new JSONObject(); try { jSONObject.put(SocialConstants.PARAM_ENCRY_EOKEN, encrypt); } catch (JSONException e) { e.printStackTrace(); } cVar.onComplete(jSONObject); return; } targetActivityIntent2.putExtra("oauth_consumer_key", this.mToken.getAppId()); targetActivityIntent2.putExtra("openid", this.mToken.getOpenId()); targetActivityIntent2.putExtra("access_token", this.mToken.getAccessToken()); targetActivityIntent2.putExtra(Constants.KEY_ACTION, SocialConstants.ACTION_CHECK_TOKEN); this.mActivityIntent = targetActivityIntent2; if (hasActivityForIntent()) { startAssitActivity(activity, (IUiListener) cVar); } }
Example #8
Source File: QQShareProxy.java From ESSocialSDK with Apache License 2.0 | 5 votes |
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 #9
Source File: AppbarActivity.java From letv with Apache License 2.0 | 5 votes |
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 #10
Source File: RecordManager.java From letv with Apache License 2.0 | 5 votes |
public void getRecord(String str, final IUiListener iUiListener) { Bundle composeCGIParams = composeCGIParams(); IRequestListener tempRequestListener = new TempRequestListener(new IUiListener(this) { final /* synthetic */ RecordManager b; public void onError(UiError uiError) { iUiListener.onError(uiError); } public void onComplete(Object obj) { JSONObject jSONObject = (JSONObject) obj; try { if (jSONObject.getInt("ret") == 0) { iUiListener.onComplete(Util.hexToString(jSONObject.getJSONObject(ShareRequestParam.RESP_UPLOAD_PIC_PARAM_DATA).getString(Constants.VALUE_ID))); return; } iUiListener.onError(new UiError(-4, jSONObject.toString(), null)); } catch (JSONException e) { iUiListener.onError(new UiError(-4, e.getMessage(), null)); } } public void onCancel() { iUiListener.onCancel(); } }); composeCGIParams.putString("key", Util.toHexString(str)); HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://graph.qq.com/weiyun/get_record", composeCGIParams, "GET", tempRequestListener); }
Example #11
Source File: SocialApiIml.java From letv with Apache License 2.0 | 5 votes |
public void invite(Activity activity, Bundle bundle, IUiListener iUiListener) { this.b = activity; Intent agentIntentWithTarget = getAgentIntentWithTarget(SocialConstants.ACTIVITY_FRIEND_CHOOSER); if (agentIntentWithTarget == null) { agentIntentWithTarget = getAgentIntentWithTarget(SocialConstants.ACTIVITY_INVITE); } bundle.putAll(composeActivityParams()); Activity activity2 = activity; a(activity2, agentIntentWithTarget, SocialConstants.ACTION_INVITE, bundle, ServerSetting.getInstance().getEnvUrl(Global.getContext(), ServerSetting.DEFAULT_URL_INVITE), iUiListener, false); }
Example #12
Source File: SocialApiIml.java From letv with Apache License 2.0 | 5 votes |
public void story(Activity activity, Bundle bundle, IUiListener iUiListener) { this.b = activity; Intent agentIntentWithTarget = getAgentIntentWithTarget(SocialConstants.ACTIVITY_STORY); bundle.putAll(composeActivityParams()); Activity activity2 = activity; a(activity2, agentIntentWithTarget, SocialConstants.ACTION_STORY, bundle, ServerSetting.getInstance().getEnvUrl(Global.getContext(), ServerSetting.DEFAULT_URL_SEND_STORY), iUiListener, false); }
Example #13
Source File: AuthDialog.java From letv with Apache License 2.0 | 5 votes |
public OnTimeListener(AuthDialog authDialog, String str, String str2, String str3, IUiListener iUiListener) { this.c = authDialog; this.d = str; this.a = str2; this.b = str3; this.e = iUiListener; }
Example #14
Source File: SocialApiIml.java From letv with Apache License 2.0 | 5 votes |
private void a(Activity activity, Bundle bundle, IUiListener iUiListener) { Intent agentIntentWithTarget = getAgentIntentWithTarget(SocialConstants.ACTIVITY_VOICE); String envUrl = ServerSetting.getInstance().getEnvUrl(Global.getContext(), ServerSetting.DEFAULT_URL_VOICE); if (agentIntentWithTarget == null && a()) { if (this.mProgressDialog == null || !this.mProgressDialog.isShowing()) { this.mProgressDialog = new ProgressDialog(activity); this.mProgressDialog.setTitle("请稍候"); this.mProgressDialog.show(); } a(activity, SocialConstants.ACTION_VOICE, new a(this, a(bundle, SocialConstants.ACTION_VOICE, envUrl, iUiListener))); return; } a(activity, agentIntentWithTarget, SocialConstants.ACTION_VOICE, bundle, envUrl, iUiListener, true); }
Example #15
Source File: i.java From MiBandDecompiled with Apache License 2.0 | 5 votes |
public i(AuthAgent authagent, Context context, IUiListener iuilistener, boolean flag, boolean flag1) { a = authagent; super(); d = context; b = iuilistener; c = flag; com.tencent.a.a.c.b("openSDK_LOG", "OpenUi, TokenListener()"); }
Example #16
Source File: QQShareApi.java From browser with GNU General Public License v2.0 | 5 votes |
public static void login(Activity activity,String scope,IUiListener listener) { if (api == null) { api = Tencent.createInstance(APP_ID, MainApp.getContext()); } if(api==null){ return; } if (!api.isSessionValid()) { api.login(activity, scope, listener); } }
Example #17
Source File: AuthDialog.java From letv with Apache License 2.0 | 5 votes |
public AuthDialog(Context context, String str, String str2, IUiListener iUiListener, QQToken qQToken) { super(context, 16973840); this.l = context; this.b = str2; this.c = new OnTimeListener(this, str, str2, qQToken.getAppId(), iUiListener); this.e = new THandler(this, this.c, context.getMainLooper()); this.d = iUiListener; this.j = str; this.m = new b(); getWindow().setSoftInputMode(32); }
Example #18
Source File: RecordManager.java From letv with Apache License 2.0 | 5 votes |
public void deleteRecord(String str, final IUiListener iUiListener) { Bundle composeCGIParams = composeCGIParams(); IRequestListener tempRequestListener = new TempRequestListener(new IUiListener(this) { final /* synthetic */ RecordManager b; public void onError(UiError uiError) { iUiListener.onError(uiError); } public void onComplete(Object obj) { JSONObject jSONObject = (JSONObject) obj; try { if (jSONObject.getInt("ret") == 0) { iUiListener.onComplete(""); } else { iUiListener.onError(new UiError(-4, jSONObject.toString(), null)); } } catch (JSONException e) { iUiListener.onError(new UiError(-4, e.getMessage(), null)); } } public void onCancel() { iUiListener.onCancel(); } }); composeCGIParams.putString("key", Util.toHexString(str)); HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://graph.qq.com/weiyun/delete_record", composeCGIParams, "GET", tempRequestListener); }
Example #19
Source File: RecordManager.java From letv with Apache License 2.0 | 5 votes |
public void queryAllRecord(final IUiListener iUiListener) { HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://graph.qq.com/weiyun/query_all_record", composeCGIParams(), "GET", new TempRequestListener(new IUiListener(this) { final /* synthetic */ RecordManager b; public void onError(UiError uiError) { iUiListener.onError(uiError); } public void onComplete(Object obj) { JSONObject jSONObject = (JSONObject) obj; try { if (jSONObject.getInt("ret") == 0) { List arrayList = new ArrayList(); JSONObject jSONObject2 = jSONObject.getJSONObject(ShareRequestParam.RESP_UPLOAD_PIC_PARAM_DATA); if (!jSONObject2.isNull("keys")) { JSONArray jSONArray = jSONObject2.getJSONArray("keys"); for (int i = 0; i < jSONArray.length(); i++) { arrayList.add(Util.hexToString(jSONArray.getJSONObject(i).getString("key"))); } } iUiListener.onComplete(arrayList); return; } iUiListener.onError(new UiError(-4, jSONObject.toString(), null)); } catch (JSONException e) { iUiListener.onError(new UiError(-4, e.getMessage(), null)); } } public void onCancel() { iUiListener.onCancel(); } })); }
Example #20
Source File: SocialApiIml.java From MiBandDecompiled with Apache License 2.0 | 5 votes |
public void brag(Activity activity, Bundle bundle, IUiListener iuilistener) { b = activity; Intent intent = getAgentIntentWithTarget("com.tencent.open.agent.BragActivity"); bundle.putAll(composeActivityParams()); a(activity, intent, "action_brag", bundle, ServerSetting.getInstance().getEnvUrl(mContext, "http://qzs.qq.com/open/mobile/brag/sdk_brag.html?"), iuilistener); }
Example #21
Source File: BaseApi.java From letv with Apache License 2.0 | 5 votes |
protected void startAssitActivity(Activity activity, IUiListener iUiListener) { AssistActivity.setApiObject(this); int i = sRequestCode; sRequestCode = i + 1; this.mActivityIntent.putExtra("key_request_code", i); this.mTaskList.add(new ApiTask(i, iUiListener)); activity.startActivityForResult(getAssitIntent(activity), Constants.REQUEST_API); }
Example #22
Source File: BaseApi.java From letv with Apache License 2.0 | 5 votes |
protected void startAssitActivity(Fragment fragment, IUiListener iUiListener) { AssistActivity.setApiObject(this); int i = sRequestCode; sRequestCode = i + 1; this.mActivityIntent.putExtra("key_request_code", i); this.mTaskList.add(new ApiTask(i, iUiListener)); fragment.startActivityForResult(getAssitIntent(fragment.getActivity()), Constants.REQUEST_API); }
Example #23
Source File: PKDialog.java From letv with Apache License 2.0 | 5 votes |
public PKDialog(Context context, String str, String str2, IUiListener iUiListener, QQToken qQToken) { super(context, 16973840); this.mWeakContext = new WeakReference(context); this.mUrl = str2; this.mListener = new OnTimeListener(context, str, str2, qQToken.getAppId(), iUiListener); this.mHandler = new THandler(this.mListener, context.getMainLooper()); this.listener = iUiListener; this.mWebviewHeight = Math.round(185.0f * context.getResources().getDisplayMetrics().density); f.e(TAG, "density=" + context.getResources().getDisplayMetrics().density + "; webviewHeight=" + this.mWebviewHeight); }
Example #24
Source File: TencentSDKHelper.java From Jide-Note with MIT License | 5 votes |
public void login(Activity activity, IUiListener listener) { implTencent(); if(!mTencent.isSessionValid()) { mTencent.login(activity, "all", listener); } }
Example #25
Source File: e.java From MiBandDecompiled with Apache License 2.0 | 5 votes |
e(c c1, Dialog dialog, IUiListener iuilistener, Object obj) { c = c1; a = iuilistener; b = obj; super(c1, dialog); }
Example #26
Source File: PKDialog.java From letv with Apache License 2.0 | 5 votes |
public OnTimeListener(Context context, String str, String str2, String str3, IUiListener iUiListener) { this.mWeakCtx = new WeakReference(context); this.mAction = str; this.mUrl = str2; this.mAppid = str3; this.mWeakL = iUiListener; }
Example #27
Source File: SocialApiIml.java From MiBandDecompiled with Apache License 2.0 | 5 votes |
public void challenge(Activity activity, Bundle bundle, IUiListener iuilistener) { b = activity; Intent intent = getAgentIntentWithTarget("com.tencent.open.agent.ChallengeActivity"); bundle.putAll(composeActivityParams()); a(activity, intent, "action_challenge", bundle, ServerSetting.getInstance().getEnvUrl(mContext, "http://qzs.qq.com/open/mobile/brag/sdk_brag.html?"), iuilistener); }
Example #28
Source File: QQShareImpl.java From ChinaShare with MIT License | 5 votes |
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 #29
Source File: UserInfo.java From MiBandDecompiled with Apache License 2.0 | 5 votes |
public void getTenPayAddr(IUiListener iuilistener) { Bundle bundle = composeCGIParams(); bundle.putString("ver", "1"); com.tencent.connect.common.BaseApi.TempRequestListener temprequestlistener = new com.tencent.connect.common.BaseApi.TempRequestListener(this, iuilistener); HttpUtils.requestAsync(mToken, mContext, "cft_info/get_tenpay_addr", bundle, "GET", temprequestlistener); }
Example #30
Source File: Weibo.java From MiBandDecompiled with Apache License 2.0 | 5 votes |
public void nickTips(String s, int i, IUiListener iuilistener) { Bundle bundle = composeCGIParams(); if (s == null) { s = ""; } bundle.putString("match", s); bundle.putString("reqnum", (new StringBuilder()).append(i).append("").toString()); com.tencent.connect.common.BaseApi.TempRequestListener temprequestlistener = new com.tencent.connect.common.BaseApi.TempRequestListener(this, iuilistener); HttpUtils.requestAsync(mToken, mContext, "friends/match_nick_tips_weibo", bundle, "GET", temprequestlistener); }