I am trying to use an image as the background for my loading dialog. The dialog is supposed to be full screen, but all I get is this...
How can I make the dialog fill the screen so I don't have that white border?
Heres my layout xml...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/locating"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/kumalocating">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="LOCATING OFFERS IN YOUR AREA"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@android:color/white"
android:textSize="30sp"
android:textStyle="bold" />
</RelativeLayout>
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/loader_1" />
</RelativeLayout>
and my class...
public class SpinnerDialog extends DialogFragment {
private static String message;
public SpinnerDialog() {
// use empty constructors. If something is needed use onCreate's
message = null;
}
public static SpinnerDialog spinnerWithCustomMessage(String msg) {
SpinnerDialog d = new SpinnerDialog();
message = msg;
return d;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fill_dialog, container);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
Code to show:
spinnerDialog = SpinnerDialog.spinnerWithCustomMessage(getString(R.string.loading_message));
spinnerDialog.show(getFragmentManager(), null);