@@ -0,0 +1,1917 @@
+package im.delight.android.commons;%0A%0A/*%0A * Copyright (c) delight.im %3Cinfo@delight.im%3E%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Aimport android.graphics.Color;%0Aimport android.app.Dialog;%0Aimport android.content.Context;%0Aimport android.view.ViewGroup.LayoutParams;%0Aimport android.widget.ProgressBar;%0A%0A/**%0A * Effective progress dialog that grays out the %60Activity%60 behind it and displays an indeterminate spinner%0A *%0A * Showing the dialog:%0A *%0A * %60SimpleProgressDialog progressDialog = SimpleProgressDialog.show(this);%60%0A *%0A * Hiding the dialog again:%0A *%0A * %60progressDialog.dismiss();%60%0A */%0Apublic final class SimpleProgressDialog extends Dialog %7B%0A%0A%09private SimpleProgressDialog(final Context context) %7B%0A%09%09super(context, android.R.style.Theme_Dialog);%0A%0A%09%09getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);%0A%09%7D%0A%0A%09/**%0A%09 * Creates and displays a new progress dialog%0A%09 *%0A%09 * @param context a context reference%0A%09 * @return the dialog instance that can later be cancelled by calling %60dismiss%60%0A%09 */%0A%09public static SimpleProgressDialog show(final Context context) %7B%0A%09%09final SimpleProgressDialog dialog = new SimpleProgressDialog(context);%0A%0A%09%09dialog.setTitle(null);%0A%09%09dialog.setCancelable(false);%0A%09%09dialog.setOnCancelListener(null);%0A%0A%09%09dialog.addContentView(new ProgressBar(context), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));%0A%09%09dialog.show();%0A%0A%09%09return dialog;%0A%09%7D%0A%0A%7D%0A

Add 'SimpleProgressDialog' class for effective progress dialogs