Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove WaitDialog #647

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public PermissionRequest permission(@NonNull String[]... groups) {
public void start() {
mPermissions = filterPermissions(mPermissions);

new TaskExecutor<List<String>>(mSource.getContext()) {
new TaskExecutor<List<String>>() {
@Override
protected List<String> doInBackground(Void... voids) {
return getDeniedPermissions(STRICT_CHECKER, mSource, mPermissions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void cancel() {

@Override
public void onCallback() {
new TaskExecutor<List<String>>(mSource.getContext()) {
new TaskExecutor<List<String>>() {
@Override
protected List<String> doInBackground(Void... voids) {
return getDeniedPermissions(DOUBLE_CHECKER, mSource, mPermissions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package com.yanzhenjie.permission.task;

import android.app.Dialog;
import android.content.Context;
import android.os.AsyncTask;

import java.util.concurrent.Executor;
Expand All @@ -27,27 +25,19 @@
*/
public abstract class TaskExecutor<T> extends AsyncTask<Void, Void, T> {

private static Executor sExecutor = Executors.newSingleThreadExecutor();
private static final Executor sExecutor = Executors.newSingleThreadExecutor();

private Dialog mDialog;

public TaskExecutor(Context context) {
this.mDialog = new WaitDialog(context);
this.mDialog.setCancelable(false);
public TaskExecutor() {

}

@Override
protected final void onPreExecute() {
if (!mDialog.isShowing()) {
mDialog.show();
}

}

@Override
protected final void onPostExecute(T t) {
if (mDialog.isShowing()) {
mDialog.dismiss();
}
onFinish(t);
}

Expand Down

This file was deleted.

41 changes: 0 additions & 41 deletions permission/src/main/res/layout/permission_dialog_wait.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public void onAction(List<String> data) {
}

private void writeApkForInstallPackage() {
new TaskExecutor<File>(MainActivity.this) {
new TaskExecutor<File>() {
@Override
protected File doInBackground(Void... voids) {
try {
Expand Down