title: hide the content of fragment when progress bar is visible
body: <p>My fragment contains lots of different views. Some views are already in the XML files like <code>imageview</code>,drawables, etc. and other views get filled with data after a successful response from Retrofit. The XML file also contains a toolbar and <code>progressbar</code>.</p>
  <p>When data is coming from the server I want only toolbar and Progressbar to be shown and other content hidden. but the problem is I can't hide the whole view because it contains a toolbar and progress bar itself.</p>
  <p>What should I do?</p>
  <p><a href="https://i.stack.imgur.com/IOmKs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IOmKs.jpg" alt="Output I want" /></a>
  <a href="https://i.stack.imgur.com/ceRWE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ceRWE.jpg" alt="Output I am getting" /></a></p>
  <pre><code>&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
  &lt;androidx.appcompat.widget.Toolbar...&gt;
  
   &lt;androidx.swiperefreshlayout.widget.SwipeRefreshLayout
          android:id=&quot;@+id/swiperefresh_open_post&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_above=&quot;@id/bottom_sec&quot;&gt;
  
   &lt;!-- this contains all Content I want to hide this --&gt;
      &lt;ScrollView...&gt;
  
  &lt;/androidx.swiperefreshlayout.widget.SwipeRefreshLayout&gt;
  
  
   &lt;!-- this contains content which is fixed at the bottom I also want to hide this --&gt;
  &lt;FrameLayout...&gt;
  
  &lt;include layout=&quot;@layout/progressbar_item&quot; /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>