I have below layout file. I need to show a Progressbar in the layout.Currently Progressbar is taking up blank space in the middle so it devided my top and bottom view while showing the bar but I am trying to show the progressbar as an overlay over the layout so it will not take up any space. How Can I achieve this
This is the layout file currently I have
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/imgLeftArrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/left_arrow2"></ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/imgGreendot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/green_dot"></ImageView>
<TextView
android:id="@+id/tvStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></TextView>
</LinearLayout>
<ImageView
android:id="@+id/imgBid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></ImageView>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/tvExpected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></TextView>
<TextView
android:id="@+id/tvTotalBid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Total Bids | "
android:textColor="#a9a9a9"
android:textSize="14dp"></TextView>
<TextView
android:id="@+id/tvDeclined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></TextView>
</LinearLayout>
<ProgressBar
android:id="@+id/progressBar5"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="visible" />
<LinearLayout
android:id="@+id/layoutswitch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="1"
android:text="Show Active Drivers Only" />
</LinearLayout>
</LinearLayout>