title: Match parent for width of ImageView in snackbar with custom view in Android is not working
body: <p>I am developing an Android app. In my app, I am using snackbar with custom view. My custom view has only child view. That is an image view. Showing custom view with snack bar is OK. But the problem is with the sizing the ImageView in the snack bar. I want to set it match parent for with. But width is not match to the width of snackbar.</p>
  
  <p>This is my custom view layout for snack bar</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ImageView
          android:scaleType="centerCrop"
          android:id="@+id/snackbar_ad_image"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is how I show snack bar in activity</p>
  
  <pre><code> private void showSnackbarAd(View view,Ad ad)
      {
          final Snackbar snackbar = Snackbar.make(view,"",Snackbar.LENGTH_LONG);
          Snackbar.SnackbarLayout layout = (Snackbar.SnackbarLayout)snackbar.getView();
          TextView textView = (TextView) layout.findViewById(android.support.design.R.id.snackbar_text);
          textView.setVisibility(View.INVISIBLE);
          View snackView = getLayoutInflater().inflate(R.layout.snack_bar_ad,null);
          ImageView imageView = (ImageView)snackView.findViewById(R.id.snackbar_ad_image);
          Picasso.with(getBaseContext()).load(ad.getImageUrl()).into(imageView);
          layout.addView(snackView, 0);
          snackbar.show();
  }
  </code></pre>
  
  <p>What I want is I want ImageView same width width snack bar. But my code is not working.</p>
  
  <p>This is what I got.</p>
  
  <p><a href="https://i.stack.imgur.com/apmRR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/apmRR.png" alt="enter image description here"></a></p>
  
  <p>How can I make that ImageView as the same width with Snackbar and fit in snackbar?</p>