use follow link Remove progress bar background in android progress bar
if it is not use full plese Make the custom Progressbar
as following make the custom AlertDialog
public static AlertDialog getAlertProgress(Activity mActivity)
{
final AlertDialog alertDialog;
final AlertDialog.Builder builder;
LayoutInflater inflater = (LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.process_layout,null,false);
AVLoadingIndicatorView avLoadingIndicatorView = (AVLoadingIndicatorView)layout.findViewById(R.id.progress_avi);
avLoadingIndicatorView.show();
builder = new AlertDialog.Builder(mActivity);
builder.setView(layout);
alertDialog = builder.create();
alertDialog.setCancelable(false);
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
return alertDialog;
}
or xml file is
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@android:color/transparent"
>
//here i use the libery progress accordint to my project you can use progress bar here
<com.wang.avi.AVLoadingIndicatorView
android:background="@android:color/transparent"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progress_avi"
android:visibility="visible"
app:indicatorName="LineScaleIndicator"
app:indicatorColor="@color/bagintero2"/>
</LinearLayout>
</RelativeLayout>
or you can use it where you want or when you want ..
for using if do
Alertdialog alertdialog = Clasneme.getAlertprogress(activityName.this);
alertdialog.show;
or when you want to dismiss
alertdialog.dismiss;