Commit 72735bd1 by YKai

feat:代码优化

parent 6bbf1bf3
package com.yidianling.user.mine;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
......@@ -12,6 +13,7 @@ import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.ydl.course.api.ICourseService;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
......@@ -354,16 +356,21 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
}
}
/**
* 跳转到登录
*
* 请求获取设备权限并跳转到登录
*/
private void startLogin(){
if (OneKeyLoginHelp.INSTANCE.getMIsOpenOneKeyLogin()) {
OneKeyLoginHelp.INSTANCE.getLoginToken(true);
}else {
RegisterAndLoginActivity.Companion.start(getActivity());
}
@SuppressLint("CheckResult")
private void startLogin() {
new RxPermissions(getActivity())
.request(Manifest.permission.READ_PHONE_STATE)
.subscribe(permission -> {
if (OneKeyLoginHelp.INSTANCE.getMIsOpenOneKeyLogin()) {
OneKeyLoginHelp.INSTANCE.getLoginToken(true);
} else {
RegisterAndLoginActivity.Companion.start(getActivity());
}
});
}
......
......@@ -84,7 +84,7 @@ object OneKeyLoginHelp {
}
}
// 获取渠道
val channel = WalleChannelReader.getChannel(activity)
val channel = WalleChannelReader.getChannel(activity.applicationContext)
checkBoxHidden = !(channel == "huawei" || channel == "vivo")
LogUtil.e("checkBoxHidde:$checkBoxHidden")
if (!checkBoxHidden){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment