// Path: library/src/main/java/com/oasisfeng/android/util/Consumer.java
// public interface Consumer<T> {
// 
// 	/**
// 	 * Performs this operation on the given argument.
// 	 *
// 	 * @param t the input argument
// 	 */
// 	void accept(T t);
// }
// 
// Path: library/src/main/java/com/oasisfeng/android/util/Supplier.java
// public interface Supplier<T> {
// 
// 	/**
// 	 * Gets a result.
// 	 *
// 	 * @return a result
// 	 */
// 	T get();
// }


import android.os.AsyncTask;
import com.oasisfeng.android.util.Consumer;
import com.oasisfeng.android.util.Supplier;
import java.util.concurrent.Callable;
import androidx.annotation.MainThread;
import androidx.annotation.WorkerThread;
package com.oasisfeng.android.os;





/**
 * Simplify the basic usage of {@link AsyncTask}.
 *
 * Created by Oasis on 2016/11/6.
 */
public abstract class SimpleAsyncTask extends AsyncTask<Void, Void, Void> {

	@MainThread public static void execute(final Runnable do_in_background, final Runnable on_post_execute) {
		new SimpleAsyncTask() {
			@Override protected void doInBackground() { do_in_background.run(); }
			@Override protected void onPostExecute() { on_post_execute.run(); }
		}.execute();
	}

	/** Execute background task and deal with the result in post-execute procedure */
// Path: library/src/main/java/com/oasisfeng/android/util/Consumer.java
// public interface Consumer<T> {
// 
// 	/**
// 	 * Performs this operation on the given argument.
// 	 *
// 	 * @param t the input argument
// 	 */
// 	void accept(T t);
// }
// 
// Path: library/src/main/java/com/oasisfeng/android/util/Supplier.java
// public interface Supplier<T> {
// 
// 	/**
// 	 * Gets a result.
// 	 *
// 	 * @return a result
// 	 */
// 	T get();
// }


// Path: library/src/main/java/com/oasisfeng/android/os/SimpleAsyncTask.java
import android.os.AsyncTask;
import com.oasisfeng.android.util.Consumer;
import com.oasisfeng.android.util.Supplier;
import java.util.concurrent.Callable;
import androidx.annotation.MainThread;
import androidx.annotation.WorkerThread;

package com.oasisfeng.android.os;





/**
 * Simplify the basic usage of {@link AsyncTask}.
 *
 * Created by Oasis on 2016/11/6.
 */
public abstract class SimpleAsyncTask extends AsyncTask<Void, Void, Void> {

	@MainThread public static void execute(final Runnable do_in_background, final Runnable on_post_execute) {
		new SimpleAsyncTask() {
			@Override protected void doInBackground() { do_in_background.run(); }
			@Override protected void onPostExecute() { on_post_execute.run(); }
		}.execute();
	}

	/** Execute background task and deal with the result in post-execute procedure */
	@MainThread public static <T> void execute(final Supplier<T> do_in_background, final Consumer<T> on_post_execute) {