| | |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.lcjian.library.dialog.DialogUtil; |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.tencent.mm.opensdk.modelmsg.SendAuth; |
| | |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.XGPush; |
| | |
| | | |
| | | public class LoginActivity extends BaseActivity implements OnClickListener { |
| | | public static final int RESULT_LOGIN = 10; |
| | | private ProgressDialog dialog; |
| | | private LinearLayout ll_login_qq, ll_login_wx; |
| | | private boolean isTouchLogin;// 用户是否点击登录 |
| | | private String uid; |
| | |
| | | } |
| | | }); |
| | | |
| | | dialog = new ProgressDialog(this); |
| | | ll_login_content = (LinearLayout) findViewById(R.id.ll_login_content); |
| | | |
| | | int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); |
| | |
| | | UMAuthListener authListener = new UMAuthListener() { |
| | | @Override |
| | | public void onStart(SHARE_MEDIA platform) { |
| | | dialog.show(); |
| | | DialogUtil.show(loadingDialog); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void onComplete(SHARE_MEDIA platform, int action, final Map<String, String> data) { |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | Log.i("mResult", "返回的数据为----" + data); |
| | | BeibeiVideoAPI.userLogin(LoginActivity.this, uid, |
| | | data.get("name"), data.get("openid"), |
| | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | } |
| | | }); |
| | | } |
| | |
| | | @Override |
| | | public void onError(SHARE_MEDIA platform, int action, Throwable t) { |
| | | lockBack(false); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | Toast.makeText(LoginActivity.this, "失败:" + t.getMessage(), Toast.LENGTH_LONG).show(); |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel(SHARE_MEDIA platform, int action) { |
| | | lockBack(false); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | Toast.makeText(LoginActivity.this, "取消了", Toast.LENGTH_LONG).show(); |
| | | } |
| | | }; |
| | |
| | | } else { |
| | | SingleToast.showToast(LoginActivity.this, "登录失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onStart() { |
| | | super.onStart(); |
| | | DialogUtil.show(loadingDialog); |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | } |
| | | }); |
| | | } catch (JSONException e) { |