Package eltos.simpledialogfragment
Class SimpleProgressTask<Params,Progress,Result>
java.lang.Object
android.os.AsyncTask<Params,Progress,Result>
eltos.simpledialogfragment.SimpleProgressTask<Params,Progress,Result>
public abstract class SimpleProgressTask<Params,Progress,Result>
extends android.os.AsyncTask<Params,Progress,Result>
An
AsyncTask
for use with SimpleProgressDialog
Automatically reflects the task's states in the dialog.
Created by eltos on 27.05.21.
-
Nested Class Summary
Nested classes/interfaces inherited from class android.os.AsyncTask
android.os.AsyncTask.Status
-
Field Summary
FieldsFields inherited from class android.os.AsyncTask
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
onPostExecute
(Result result) protected void
protected void
onProgressUpdate
(Progress... values) Updates the progress dialog by trying to guess the meaning of the supplied parameter(s):protected void
registerDialog
(SimpleProgressDialog dialog) Methods inherited from class android.os.AsyncTask
cancel, doInBackground, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, publishProgress
-
Field Details
-
mDialog
-
-
Constructor Details
-
SimpleProgressTask
public SimpleProgressTask()
-
-
Method Details
-
registerDialog
-
onPreExecute
@CallSuper protected void onPreExecute() -
onPostExecute
-
onProgressUpdate
Updates the progress dialog by trying to guess the meaning of the supplied parameter(s):- if values is of numeric type - if values[0] < 0, then progress is indeterminate - if values[0] >= 0, then (int) values[0] is set as progress - if values[1] > 0, then (int) values[1] is set as max, otherwise max defaults to 100 - if values[2] >= 0, then (int) values[2] is set as secondary progress - if values is of CharSequence type, then values[0] is set as info text and progress to indeterminate - if values is a
Pair
of aNumber
and aString
, the above is applied to either value of the pair
-