|
@@ -35,7 +35,6 @@ public final class PermissionFragment extends Fragment {
|
|
private PermissionDialogInfo info;
|
|
private PermissionDialogInfo info;
|
|
private final int code1 = 0x31;
|
|
private final int code1 = 0x31;
|
|
private final int code2 = 0x32;
|
|
private final int code2 = 0x32;
|
|
- private int permissionCode = 0x30;
|
|
|
|
private boolean isStop = false;
|
|
private boolean isStop = false;
|
|
private boolean isShow = false;
|
|
private boolean isShow = false;
|
|
|
|
|
|
@@ -95,8 +94,8 @@ public final class PermissionFragment extends Fragment {
|
|
if (checkPermission()) {
|
|
if (checkPermission()) {
|
|
if (permissions2 != null && permissions2.length <= 0) {
|
|
if (permissions2 != null && permissions2.length <= 0) {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionSuccess();
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onSuccess();
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -105,8 +104,8 @@ public final class PermissionFragment extends Fragment {
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
} else {
|
|
} else {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionSuccess();
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onSuccess();
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -197,8 +196,8 @@ public final class PermissionFragment extends Fragment {
|
|
negativeClick.onClick(callBack, PermissionFragment.this.oList.toArray(new String[0]));
|
|
negativeClick.onClick(callBack, PermissionFragment.this.oList.toArray(new String[0]));
|
|
} else {
|
|
} else {
|
|
if (callBack != null) {
|
|
if (callBack != null) {
|
|
- callBack.onPermissionFailure(PermissionFragment.this.oList.toArray(new String[0]));
|
|
|
|
- callBack.onPermissionComplete();
|
|
|
|
|
|
+ callBack.onFailure(PermissionFragment.this.oList.toArray(new String[0]));
|
|
|
|
+ callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -227,15 +226,15 @@ public final class PermissionFragment extends Fragment {
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
} else {
|
|
} else {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionSuccess();
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onSuccess();
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionSuccess();
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onSuccess();
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -281,21 +280,21 @@ public final class PermissionFragment extends Fragment {
|
|
if (this.permissions2 != null && this.permissions2.length > 0) {
|
|
if (this.permissions2 != null && this.permissions2.length > 0) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !Environment.isExternalStorageManager()) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !Environment.isExternalStorageManager()) {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionFailure(this.permissions2);
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onFailure(this.permissions2);
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionSuccess();
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onSuccess();
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionSuccess();
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onSuccess();
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -303,8 +302,8 @@ public final class PermissionFragment extends Fragment {
|
|
if (this.isShow) {
|
|
if (this.isShow) {
|
|
showDialog();
|
|
showDialog();
|
|
} else if (this.callBack != null) {
|
|
} else if (this.callBack != null) {
|
|
- this.callBack.onPermissionFailure(this.oList.toArray(new String[0]));
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onFailure(this.oList.toArray(new String[0]));
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -320,8 +319,8 @@ public final class PermissionFragment extends Fragment {
|
|
|
|
|
|
private void setFailure() {
|
|
private void setFailure() {
|
|
if (this.callBack != null) {
|
|
if (this.callBack != null) {
|
|
- this.callBack.onPermissionFailure(this.oList.toArray(new String[0]));
|
|
|
|
- this.callBack.onPermissionComplete();
|
|
|
|
|
|
+ this.callBack.onFailure(this.oList.toArray(new String[0]));
|
|
|
|
+ this.callBack.onComplete();
|
|
PermissionHelper.removeFragment();
|
|
PermissionHelper.removeFragment();
|
|
}
|
|
}
|
|
}
|
|
}
|