|
|
|
@ -37,6 +37,7 @@ import androidx.activity.result.contract.ActivityResultContract; |
|
|
|
|
import androidx.annotation.NonNull; |
|
|
|
|
import androidx.annotation.Nullable; |
|
|
|
|
|
|
|
|
|
import com.hjq.permissions.OnPermissionCallback; |
|
|
|
|
import com.kongzue.dialogx.dialogs.BottomMenu; |
|
|
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
@ -45,6 +46,7 @@ import java.io.File; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import io.reactivex.Single; |
|
|
|
|
import io.reactivex.SingleOnSubscribe; |
|
|
|
@ -84,6 +86,7 @@ import xyz.fycz.myreader.util.ToastUtils; |
|
|
|
|
import xyz.fycz.myreader.util.utils.AdUtils; |
|
|
|
|
import xyz.fycz.myreader.util.utils.NetworkUtils; |
|
|
|
|
import xyz.fycz.myreader.util.utils.RxUtils; |
|
|
|
|
import xyz.fycz.myreader.util.utils.StoragePermissionUtils; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author fengyue |
|
|
|
@ -206,13 +209,15 @@ public class MineFragment extends BaseFragment { |
|
|
|
|
protected void initClick() { |
|
|
|
|
super.initClick(); |
|
|
|
|
binding.mineRlUser.setOnClickListener(v -> { |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
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) { |
|
|
|
|