|
@@ -57,32 +57,9 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
|
|
|
|
|
|
binding.clFaceBook.setOnClickListener(object : NoDoubleClickListener() {
|
|
|
override fun onClick() {
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
|
|
|
- PermissionX.init(this@LoginActivity)
|
|
|
- .permissions(
|
|
|
- Manifest.permission.READ_MEDIA_IMAGES,
|
|
|
- Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED
|
|
|
- )
|
|
|
- .request { allGranted, grantedList, deniedList ->
|
|
|
- if (allGranted) {
|
|
|
- FBLogin.login(this@LoginActivity)
|
|
|
- } else {
|
|
|
- FBLogin.login(this@LoginActivity)
|
|
|
- }
|
|
|
- }
|
|
|
- }else if (SwagoShareUtils.isInstall(this@LoginActivity,FACEBOOK)){
|
|
|
+ if (SwagoShareUtils.isInstall(this@LoginActivity,FACEBOOK)){
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
|
|
|
- PermissionX.init(this@LoginActivity)
|
|
|
- .permissions(
|
|
|
- Manifest.permission.READ_MEDIA_IMAGES
|
|
|
- )
|
|
|
- .request { allGranted, grantedList, deniedList ->
|
|
|
- if (allGranted) {
|
|
|
- FBLogin.login(this@LoginActivity)
|
|
|
- } else {
|
|
|
- FBLogin.login(this@LoginActivity)
|
|
|
- }
|
|
|
- }
|
|
|
+ FBLogin.login(this@LoginActivity)
|
|
|
}else{
|
|
|
PermissionX.init(this@LoginActivity)
|
|
|
.permissions(
|
|
@@ -104,32 +81,9 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
|
|
|
|
|
|
binding.clGoogle.setOnClickListener(object : NoDoubleClickListener() {
|
|
|
override fun onClick() {
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
|
|
|
- PermissionX.init(this@LoginActivity)
|
|
|
- .permissions(
|
|
|
- Manifest.permission.READ_MEDIA_IMAGES,
|
|
|
- Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED
|
|
|
- )
|
|
|
- .request { allGranted, grantedList, deniedList ->
|
|
|
- if (allGranted) {
|
|
|
- GoogleLogin.login(this@LoginActivity)
|
|
|
- } else {
|
|
|
- GoogleLogin.login(this@LoginActivity)
|
|
|
- }
|
|
|
- }
|
|
|
- }else if (SwagoShareUtils.isInstall(this@LoginActivity,GOOGLE)) {
|
|
|
+ if (SwagoShareUtils.isInstall(this@LoginActivity,GOOGLE)) {
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
|
|
|
- PermissionX.init(this@LoginActivity)
|
|
|
- .permissions(
|
|
|
- Manifest.permission.READ_MEDIA_IMAGES
|
|
|
- )
|
|
|
- .request { allGranted, grantedList, deniedList ->
|
|
|
- if (allGranted) {
|
|
|
- GoogleLogin.login(this@LoginActivity)
|
|
|
- } else {
|
|
|
- GoogleLogin.login(this@LoginActivity)
|
|
|
- }
|
|
|
- }
|
|
|
+ GoogleLogin.login(this@LoginActivity)
|
|
|
}else{
|
|
|
PermissionX.init(this@LoginActivity)
|
|
|
.permissions(
|
|
@@ -189,43 +143,11 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
|
|
|
|
|
|
binding.ivAccountLogin.setOnClickListener(object:NoDoubleClickListener(){
|
|
|
override fun onClick() {
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
|
|
|
- PermissionX.init(this@LoginActivity)
|
|
|
- .permissions(
|
|
|
- Manifest.permission.READ_MEDIA_IMAGES,
|
|
|
- Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED
|
|
|
- )
|
|
|
- .request { allGranted, grantedList, deniedList ->
|
|
|
- if (allGranted) {
|
|
|
- SwagoLoading.showLoadingDialog(this@LoginActivity)
|
|
|
- val account = binding.etAccount.text.toString()
|
|
|
- val secret = binding.etSecret.text.toString()
|
|
|
- loginVm.loginByAccount(account, secret)
|
|
|
- } else {
|
|
|
- SwagoLoading.showLoadingDialog(this@LoginActivity)
|
|
|
- val account = binding.etAccount.text.toString()
|
|
|
- val secret = binding.etSecret.text.toString()
|
|
|
- loginVm.loginByAccount(account, secret)
|
|
|
- }
|
|
|
- }
|
|
|
- }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
|
|
|
- PermissionX.init(this@LoginActivity)
|
|
|
- .permissions(
|
|
|
- Manifest.permission.READ_MEDIA_IMAGES
|
|
|
- )
|
|
|
- .request { allGranted, grantedList, deniedList ->
|
|
|
- if (allGranted) {
|
|
|
- SwagoLoading.showLoadingDialog(this@LoginActivity)
|
|
|
- val account = binding.etAccount.text.toString()
|
|
|
- val secret = binding.etSecret.text.toString()
|
|
|
- loginVm.loginByAccount(account, secret)
|
|
|
- } else {
|
|
|
- SwagoLoading.showLoadingDialog(this@LoginActivity)
|
|
|
- val account = binding.etAccount.text.toString()
|
|
|
- val secret = binding.etSecret.text.toString()
|
|
|
- loginVm.loginByAccount(account, secret)
|
|
|
- }
|
|
|
- }
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
|
|
|
+ SwagoLoading.showLoadingDialog(this@LoginActivity)
|
|
|
+ val account = binding.etAccount.text.toString()
|
|
|
+ val secret = binding.etSecret.text.toString()
|
|
|
+ loginVm.loginByAccount(account, secret)
|
|
|
}else{
|
|
|
PermissionX.init(this@LoginActivity)
|
|
|
.permissions(
|