I Want Show Custom Dialog Like Iphone Hud Progress Bar
I want to show custom dialog like iphone hud progress Bar Style.but,i am no idea for creating custom dialog like hud progress bar like iphone on android. I want custom dialog like
Solution 1:
I have created a sample Android application and a ProgressHUD class which you can use for this purpose. You can find it here: https://github.com/anupamdhanuka/AndroidProgressHUD
Solution 2:
Just look at this(my) library. IOSDialog/Spinner library
It is very easy to use and solves your problem. With it, you can easily create and use spinner like in IOS. The example of code:
finalIOSDialogdialog1=newIOSDialog.Builder(IOSDialogActivity.this)
.setOnCancelListener(newDialogInterface.OnCancelListener() {
@OverridepublicvoidonCancel(DialogInterface dialog) {
dialog0.show();
}
})
.setDimAmount(3)
.setSpinnerColorRes(R.color.colorGreen)
.setMessageColorRes(R.color.colorAccent)
.setTitle(R.string.standard_title)
.setTitleColorRes(R.color.colorPrimary)
.setMessageContent("My message")
.setCancelable(true)
.setMessageContentGravity(Gravity.END)
.build();
finalIOSDialogdialog0=newIOSDialog.Builder(IOSDialogActivity.this)
.setTitle("Default IOS bar")
.setTitleColorRes(R.color.gray)
.build();
Result: standard IOS Dialog
Solution 3:
privateclassloadassyncextends
AsyncTask<String, Void, Void> {
privatefinal ProgressDialog dialog = new ProgressDialog(
classname.this);
protected void onPreExecute() {
this.dialog.setMessage("loading.....");
this.dialog.show();
}
protectedVoid doInBackground(final String... args) {
//add the logic while loading
}
protected void onPostExecute(finalVoid unused) {
try {
//add the logic after loading
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (this.dialog.isShowing()) {
this.dialog.dismiss();
}
}
}
to execute assynctask
LoadassyncmAssyn1=newLoadAssync();
mAssyn1.execute();
Post a Comment for "I Want Show Custom Dialog Like Iphone Hud Progress Bar"