|
|
@@ -0,0 +1,460 @@
|
|
|
+package com.sheep.gamegroup.module.login.fragments;
|
|
|
+
|
|
|
+
|
|
|
+import android.graphics.drawable.BitmapDrawable;
|
|
|
+import android.support.annotation.NonNull;
|
|
|
+import android.support.design.widget.Snackbar;
|
|
|
+import android.support.v4.app.Fragment;
|
|
|
+import android.support.v7.widget.LinearLayoutManager;
|
|
|
+import android.support.v7.widget.RecyclerView;
|
|
|
+import android.text.TextUtils;
|
|
|
+import android.view.LayoutInflater;
|
|
|
+import android.view.View;
|
|
|
+import android.view.ViewGroup;
|
|
|
+import android.widget.EditText;
|
|
|
+import android.widget.ImageView;
|
|
|
+import android.widget.PopupWindow;
|
|
|
+import android.widget.TextView;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.sheep.gamegroup.greendao.DDProviderHelper;
|
|
|
+import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
+import com.sheep.gamegroup.model.entity.LoginEntity;
|
|
|
+import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
+import com.sheep.gamegroup.module.login.controller.LoginController;
|
|
|
+import com.sheep.gamegroup.module.login.model.Account;
|
|
|
+import com.sheep.gamegroup.util.ChannelContent;
|
|
|
+import com.sheep.gamegroup.util.DataUtil;
|
|
|
+import com.sheep.gamegroup.util.FastJsonUtils;
|
|
|
+import com.sheep.gamegroup.util.GlideImageLoader;
|
|
|
+import com.sheep.gamegroup.util.PreferenceUtils;
|
|
|
+import com.sheep.gamegroup.util.StringUtils;
|
|
|
+import com.sheep.gamegroup.util.TestUtil;
|
|
|
+import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
+import com.sheep.gamegroup.view.customview.CountDownButton;
|
|
|
+import com.sheep.jiuyan.samllsheep.R;
|
|
|
+import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
+import com.umeng.socialize.UMAuthListener;
|
|
|
+import com.umeng.socialize.UMShareAPI;
|
|
|
+import com.umeng.socialize.bean.SHARE_MEDIA;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import butterknife.BindView;
|
|
|
+import butterknife.OnClick;
|
|
|
+import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
+import io.reactivex.schedulers.Schedulers;
|
|
|
+
|
|
|
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_QQ;
|
|
|
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_WX;
|
|
|
+
|
|
|
+/**
|
|
|
+ * A simple {@link Fragment} subclass.
|
|
|
+ */
|
|
|
+public class SignInFgt extends BaseFragment {
|
|
|
+
|
|
|
+ private LoginController mController;
|
|
|
+
|
|
|
+ @BindView(R.id.for_account_pwd_container)
|
|
|
+ View forAccountPwdContainer;
|
|
|
+ @BindView(R.id.for_phone_container)
|
|
|
+ View forPhoneContainer;
|
|
|
+ @BindView(R.id.user_name_box)
|
|
|
+ EditText userNameBox;
|
|
|
+ @BindView(R.id.password_box)
|
|
|
+ EditText passwordBox;
|
|
|
+ @BindView(R.id.phone_number_box)
|
|
|
+ EditText phoneNumberBox;
|
|
|
+ @BindView(R.id.captcha_box)
|
|
|
+ EditText captchaBox;
|
|
|
+ @BindView(R.id.login_type_toggle)
|
|
|
+ View loginTypeToggle;
|
|
|
+ @BindView(R.id.login_type_toggle_icon)
|
|
|
+ ImageView loginTypeToggleIcon;
|
|
|
+ @BindView(R.id.login_type_toggle_text)
|
|
|
+ TextView loginTypeToggleText;
|
|
|
+ @BindView(R.id.send_captcha_btn)
|
|
|
+ CountDownButton countDownButton;
|
|
|
+ @BindView(R.id.account_menu_btn)
|
|
|
+ ImageView accountMenuBtn;
|
|
|
+
|
|
|
+ @BindView(R.id.test_change)
|
|
|
+ TextView testChange;
|
|
|
+ @BindView(R.id.test_change_user)
|
|
|
+ TextView testChangeUser;
|
|
|
+
|
|
|
+ public SignInFgt() {
|
|
|
+ // Required empty public constructor
|
|
|
+ }
|
|
|
+
|
|
|
+ public static SignInFgt newInstance(LoginController controller) {
|
|
|
+ SignInFgt fragment = new SignInFgt();
|
|
|
+ fragment.mController = controller;
|
|
|
+ return fragment;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getLayoutId() {
|
|
|
+ return R.layout.fragment_sign_in;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onViewCreated() {
|
|
|
+ TestUtil.testChange(getActivity(), testChange);
|
|
|
+ TestUtil.testChangeUser(getActivity(), testChangeUser);
|
|
|
+ forAccountPwdContainer.setVisibility(View.GONE);
|
|
|
+ forPhoneContainer.setVisibility(View.VISIBLE);
|
|
|
+ loginTypeToggle.setSelected(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.login_btn)
|
|
|
+ public void doLogin(View v) {
|
|
|
+ showProgress();
|
|
|
+ if (loginTypeToggle.isSelected()) {
|
|
|
+ phoneLogin();
|
|
|
+ } else {
|
|
|
+ accountLogin();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean validateAccountPwd() {
|
|
|
+ String username = userNameBox.getText().toString().trim();
|
|
|
+ String password = passwordBox.getText().toString().trim();
|
|
|
+ if (TextUtils.isEmpty(username)) {
|
|
|
+ G.showToast("请输入用户名");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(password)) {
|
|
|
+ G.showToast("密码不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!StringUtils.isUserName(username)) {
|
|
|
+ G.showToast("用户名只能包含英文、数字、._-@符号");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!StringUtils.isPassword(password)) {
|
|
|
+ G.showToast("用户名只能包含英文、数字、_.-@$!*%符号");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void accountLogin() {
|
|
|
+ if (!validateAccountPwd()) return;
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("user_name", userNameBox.getText().toString().trim());
|
|
|
+ jsonObject.put("password", passwordBox.getText().toString().trim());
|
|
|
+// jsonObject.put("invitation_code", scope);
|
|
|
+ PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().loginByUserName(jsonObject)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ hideProgress();
|
|
|
+ G.showToast(baseMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ hideProgress();
|
|
|
+ if (baseMessage == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ LoginEntity loginEty = null;
|
|
|
+ try {
|
|
|
+ loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ if (loginEty != null) {
|
|
|
+ SpUtils.saveToken(getActivity(), loginEty.getToken());
|
|
|
+ DataUtil.getInstance().initUserEntity(loginEty.getUser());
|
|
|
+ mController.whenLoginSuccess(LoginController.PLATFORM_ACCOUNT, loginEty);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean validatePhoneCaptcha() {
|
|
|
+ String etCode = captchaBox.getText().toString().trim();
|
|
|
+ if (TextUtils.isEmpty(etCode)) {
|
|
|
+ G.showToast(getString(R.string.input_your_captcha));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (etCode.length() != 6) {
|
|
|
+ G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void phoneLogin() {
|
|
|
+ if (!validatePhoneCaptcha()) return;
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("account", phoneNumberBox.getText().toString().trim());
|
|
|
+ jsonObject.put("sec_code", captchaBox.getText().toString().trim());
|
|
|
+// jsonObject.put("invitation_code", scope);
|
|
|
+ PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().loginByCaptcha(jsonObject)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ hideProgress();
|
|
|
+ G.showToast(baseMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ hideProgress();
|
|
|
+ if (baseMessage == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ LoginEntity loginEty = null;
|
|
|
+ try {
|
|
|
+ loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ if (loginEty != null) {
|
|
|
+ SpUtils.saveToken(getActivity(), loginEty.getToken());
|
|
|
+ DataUtil.getInstance().initUserEntity(loginEty.getUser());
|
|
|
+ mController.whenLoginSuccess(LoginController.PLATFORM_PHONE, loginEty);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.send_captcha_btn)
|
|
|
+ public void doSendCaptcha(View v) {
|
|
|
+ String phoneNum = phoneNumberBox.getText().toString().trim();
|
|
|
+ if (TextUtils.isEmpty(phoneNum)) {
|
|
|
+ G.showToast("请输入手机号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!StringUtils.isMobile(phoneNum)) {
|
|
|
+ G.showToast("手机号有误");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("account", phoneNum);
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().getCaptcha(jsonObject)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ Snackbar.make(v, "验证码已发送", Snackbar.LENGTH_SHORT).show();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ Snackbar.make(v, "发生错误", Snackbar.LENGTH_SHORT).show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.login_type_toggle)
|
|
|
+ public void doToggleLoginType(View v) {
|
|
|
+ loginTypeToggle.setSelected(!loginTypeToggle.isSelected());
|
|
|
+ loginTypeToggleText.setText(loginTypeToggle.isSelected() ? "账号登录" : "一键登录");
|
|
|
+ loginTypeToggleIcon.setImageResource(loginTypeToggle.isSelected() ? R.mipmap.login_account : R.mipmap.login_phone);
|
|
|
+ forPhoneContainer.setVisibility(v.isSelected() ? View.VISIBLE : View.GONE);
|
|
|
+ forAccountPwdContainer.setVisibility(!v.isSelected() ? View.VISIBLE : View.GONE);
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.register_btn)
|
|
|
+ public void doRegister(View v) {
|
|
|
+ mController.whenToRegister();
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.trouble_btn)
|
|
|
+ public void doTrouble(View v) {
|
|
|
+ mController.whenGoFindAccount();
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.wx_login_btn)
|
|
|
+ public void doWxLogin(View v) {
|
|
|
+ LOGIN_WX.onEvent();
|
|
|
+ UMShareAPI.get(SheepApp.getInstance()).doOauthVerify(getActivity(), SHARE_MEDIA.WEIXIN, new ThirdpartAuthListener("微信") {
|
|
|
+ @Override
|
|
|
+ public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
|
|
|
+ JSONObject j = new JSONObject();
|
|
|
+ j.put("code", data.get("access_token"));
|
|
|
+ j.put("username", data.get("openid"));
|
|
|
+ j.put("scope", ChannelContent.getInstance().getChannel_name());
|
|
|
+ PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.WECHAT);
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService()
|
|
|
+ .LoginByWX(j)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ G.showToast("微信登录失败 请检查网络是否正常");
|
|
|
+ hideProgress();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ hideProgress();
|
|
|
+ if (baseMessage != null) {
|
|
|
+ LoginEntity loginEty = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
|
|
|
+ SpUtils.saveToken(SheepApp.getInstance(), loginEty.getToken());
|
|
|
+ DataUtil.getInstance().initUserEntity(loginEty.getUser());
|
|
|
+ mController.whenLoginSuccess(LoginController.PLATFORM_WX, loginEty);
|
|
|
+ TestUtil.saveUser(loginEty);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.qq_login_btn)
|
|
|
+ public void doQQLogin(View v) {
|
|
|
+ LOGIN_QQ.onEvent();
|
|
|
+ UMShareAPI.get(SheepApp.getInstance()).doOauthVerify(getActivity(), SHARE_MEDIA.QQ, new ThirdpartAuthListener("QQ") {
|
|
|
+ public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
|
|
|
+ JSONObject j = new JSONObject();
|
|
|
+ j.put("code", data.get("access_token"));
|
|
|
+ j.put("username", data.get("openid"));
|
|
|
+ j.put("scope", ChannelContent.getInstance().getChannel_name());
|
|
|
+ PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.QQ);
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService()
|
|
|
+ .LoginByQQ(j)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ G.showToast("QQ登录失败 请检查网络是否正常");
|
|
|
+ hideProgress();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ hideProgress();
|
|
|
+ if (baseMessage != null) {
|
|
|
+ LoginEntity loginEty = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
|
|
|
+ SpUtils.saveToken(SheepApp.getInstance(), loginEty.getToken());
|
|
|
+ DataUtil.getInstance().initUserEntity(loginEty.getUser());
|
|
|
+ mController.whenLoginSuccess(LoginController.PLATFORM_QQ, loginEty);
|
|
|
+ TestUtil.saveUser(loginEty);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @OnClick(R.id.account_menu_btn)
|
|
|
+ public void doSelectAccount(View v) {
|
|
|
+ final List<Account> listData = DDProviderHelper.getInstance().getAccountList();
|
|
|
+ View flagView = mView.findViewById(R.id.login_btn);
|
|
|
+ RecyclerView listView = new RecyclerView(getContext());
|
|
|
+ listView.setBackgroundResource(R.drawable.screenshot_panel);
|
|
|
+ listView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
+ final PopupWindow popupWindow = new PopupWindow(listView,
|
|
|
+ flagView.getMeasuredWidth(),
|
|
|
+ ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
|
+ listView.setAdapter(new RecyclerView.Adapter() {
|
|
|
+ @NonNull
|
|
|
+ @Override
|
|
|
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
|
|
+ View itemView = LayoutInflater.from(getContext()).inflate(R.layout.account_select_item, viewGroup, false);
|
|
|
+ return new RecyclerView.ViewHolder(itemView) {
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i) {
|
|
|
+ Account account = listData.get(i);
|
|
|
+ ImageView accountAvatar = viewHolder.itemView.findViewById(R.id.account_avatar_view);
|
|
|
+ TextView accountName = viewHolder.itemView.findViewById(R.id.account_name_view);
|
|
|
+ View accountDelete = viewHolder.itemView.findViewById(R.id.account_delete_btn);
|
|
|
+ if (!TextUtils.isEmpty(account.getAvatar())) {
|
|
|
+ GlideImageLoader.setAvatar(accountAvatar, account.getAvatar());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(account.getLoginname())) {
|
|
|
+ accountName.setText(account.getLoginname());
|
|
|
+ }
|
|
|
+ accountDelete.setOnClickListener(v -> {
|
|
|
+ listData.remove(account);
|
|
|
+ notifyDataSetChanged();
|
|
|
+ DDProviderHelper.getInstance().deleteAccount(account);
|
|
|
+ });
|
|
|
+ viewHolder.itemView.setOnClickListener(v -> {
|
|
|
+ if (loginTypeToggle.isSelected()) {
|
|
|
+ phoneNumberBox.setText(account.getLoginname());
|
|
|
+ } else {
|
|
|
+ userNameBox.setText(account.getLoginname());
|
|
|
+ }
|
|
|
+ popupWindow.dismiss();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getItemCount() {
|
|
|
+ return listData.size();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ popupWindow.setFocusable(true);
|
|
|
+ popupWindow.setOutsideTouchable(true);
|
|
|
+ popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
+ if (loginTypeToggle.isSelected()) {
|
|
|
+ popupWindow.showAsDropDown(phoneNumberBox, 0, 5);
|
|
|
+ } else {
|
|
|
+ popupWindow.showAsDropDown(userNameBox, 0, 5);
|
|
|
+ }
|
|
|
+ popupWindow.setOnDismissListener(() -> {
|
|
|
+ accountMenuBtn.setRotation(0);
|
|
|
+ });
|
|
|
+ accountMenuBtn.setRotation(180);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onDestroy() {
|
|
|
+ if (countDownButton != null) {
|
|
|
+ countDownButton.onDestroy();
|
|
|
+ }
|
|
|
+ super.onDestroy();
|
|
|
+ }
|
|
|
+
|
|
|
+ private abstract class ThirdpartAuthListener implements UMAuthListener {
|
|
|
+
|
|
|
+ private String platformName;
|
|
|
+
|
|
|
+ public ThirdpartAuthListener(String platformName) {
|
|
|
+ this.platformName = platformName;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onStart(SHARE_MEDIA platform) {
|
|
|
+ showProgress();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(SHARE_MEDIA platform, int action, Throwable t) {
|
|
|
+ G.showToast(platformName + "授权失败 请检查网络是否正常");
|
|
|
+ hideProgress();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onCancel(SHARE_MEDIA platform, int action) {
|
|
|
+ hideProgress();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|