diff options
Diffstat (limited to 'org_apg/src/org/thialfihar/android/apg/ui/ProgressDialog.java')
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/ui/ProgressDialog.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/org_apg/src/org/thialfihar/android/apg/ui/ProgressDialog.java b/org_apg/src/org/thialfihar/android/apg/ui/ProgressDialog.java new file mode 100644 index 000000000..05bd02cf0 --- /dev/null +++ b/org_apg/src/org/thialfihar/android/apg/ui/ProgressDialog.java @@ -0,0 +1,42 @@ +package org.thialfihar.android.apg.ui; + +import org.thialfihar.android.apg.Constants; +import org.thialfihar.android.apg.Id; + +import android.content.Context; +import android.os.Bundle; +import android.os.Message; + +/** + * Extends the standard ProgressDialog by new methods for setting progress + * + */ +public class ProgressDialog extends android.app.ProgressDialog{ + + Context mContext; + + public ProgressDialog(Context context) { + super(context); + mContext = context; + } + + public void setProgress(int resourceId, int progress, int max) { + setProgress(mContext.getString(resourceId), progress, max); + } + + public void setProgress(int progress, int max) { + this.setP + } + + public void setProgress(String message, int progress, int max) { + Message msg = new Message(); + Bundle data = new Bundle(); + data.putInt(Constants.extras.STATUS, Id.message.progress_update); + data.putString(Constants.extras.MESSAGE, message); + data.putInt(Constants.extras.PROGRESS, progress); + data.putInt(Constants.extras.PROGRESS_MAX, max); + msg.setData(data); + mHandler.sendMessage(msg); + } + +} |