Add storage permission check

master^2
fengyuecanzhu 2 years ago
parent ab67ab6f10
commit a8cf25d6f2
No known key found for this signature in database
GPG Key ID: 04B78AD06A9D6E6C
  1. 20
      app/src/main/java/xyz/fycz/myreader/ui/fragment/MineFragment.java

@ -208,17 +208,15 @@ public class MineFragment extends BaseFragment {
@Override
protected void initClick() {
super.initClick();
binding.mineRlUser.setOnClickListener(v -> {
StoragePermissionUtils.request(this, (permissions, all) -> {
if (isLogin) {
Intent intent = new Intent(getActivity(), UserInfoActivity.class);
startActivityForResult(intent, APPCONST.REQUEST_LOGOUT);
} else {
Intent intent = new Intent(getActivity(), LoginActivity.class);
getActivity().startActivityForResult(intent, APPCONST.REQUEST_LOGIN);
}
});
});
binding.mineRlUser.setOnClickListener(v -> StoragePermissionUtils.request(this, (permissions, all) -> {
if (isLogin) {
Intent intent = new Intent(getActivity(), UserInfoActivity.class);
startActivityForResult(intent, APPCONST.REQUEST_LOGOUT);
} else {
Intent intent = new Intent(getActivity(), LoginActivity.class);
getActivity().startActivityForResult(intent, APPCONST.REQUEST_LOGIN);
}
}));
binding.mineRlSyn.setOnClickListener(v -> {
if (!isLogin) {
ToastUtils.showWarring("请先登录!");

Loading…
Cancel
Save