Good day, faced with problem, that I can't remove white background behind the ProgressDialog
. I'm trying to use background=#00FFFFFF
for RelativeLayout
but no result. How to remove this background or make it transparent ?
My code for ProgressDialog
:
public class Loading {
private Context context;
private ProgressDialog dialog;
public Loading(Context context) {
this.context = context;
}
public void show() {
getDialog().show();
getDialog().setContentView(R.layout.dialog_spinner);
}
public void dismiss() {
if (dialog != null) {
dialog.dismiss();
}
}
public void error() {
dismiss();
}
public void success() {
dismiss();
}
public void error(RetrofitError error) {
EventBus.getDefault().post(error);
}
public ProgressDialog getDialog() {
if (dialog == null) {
dialog = new ProgressDialog(context);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(false);
}
return dialog;
}
}
dialog_spinner layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/dialog_progress_background">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Loading..."
android:textColor="#FFFFFF" />
</LinearLayout>
</RelativeLayout>
And dialog_progress_background shape:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<solid android:color="#80000000" />
</shape>