title: Android Studio: Can you display a view just for preview?
body: <p>My app has a lot of views that are containers for fragments (which load an image and other views) and depend on an API to fetch images. To make the development of the design easier, I like to add a sample of that image in my xml. Right now, I'm adding a RelativeLayout with the FragmentContainer and a dummy ImageView using different visibility values for <code>android:visibility</code> and <code>tools:visibility</code>. </p>
  
  <p>Is there a better way to show images just for preview purposes ? I'd like to have the preview Views not compiled in the release version. </p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;ImageView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:visibility="gone"
          tools:adjustViewBounds="true"
          tools:src="@drawable/image"
          tools:visibility="visible" /&gt;
  
      &lt;RelativeLayout
          android:id="@+id/FragmentContainer"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>