title: ImageView image not resizing with ImageView
body: <p>I have a TableLayout with cells of <code>ImageView</code>s. What I am trying to do is create a zooming effect by incrementing the size of the <code>ImageView</code>s in the tabel. This works perfectly for zooming out( the picture resizes with the <code>ImageView</code>) but, the problem is with zooming in. The picture does not resize when the <code>ImageView</code> is made bigger.</p>
  
  <p>Here is an example:
  <img src="https://i.stack.imgur.com/u5nas.png" alt="enter image description here"></p>
  
  <p>I want the image to be the same size as the ImageView(each black square is an ImageView)</p>
  
  <p>Here is my code for the zooming ( any tips on better implementation would be appreciated, don't want to use pinch zoom ).</p>
  
  <pre><code>zoomIndex ranges from -2, 2. (only allow them to zoom twice in each direction)
  zoomInThreshold = 2, zoomOutThreshold = -2. 
  defaultSize = 50, zoomIncrement = 15;
  
  
                  if(zoomIndex &lt; zoomInThreshold)
                      defaultSize += zoomIncrement;
  
  
                  for(int i = 0; i &lt; table.getChildCount(); ++i)
                  {
                      TableRow row = (TableRow)table.getChildAt(i);
                      for(int r = 0; r &lt; row.getChildCount(); ++r)
                      {
                          ImageView img = (ImageView)row.getChildAt(r);
  
                          if(zoomIndex  &lt; zoomInThreshold)
                          {
                              TableRow.LayoutParams imgLayoutParams = new TableRow.LayoutParams(
                                      defaultSize,
                                      defaultSize
                              );
                              img.setLayoutParams(imgLayoutParams);
  
                              if(img.getDrawable() != null)
                              {
                                  img.setAdjustViewBounds(true);
                                  img.setMaxHeight(defaultSize);
                                  img.setMaxWidth(defaultSize);
                                  img.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
                              }
                          }
                      }
                  }
                  if(zoomIndex &lt; zoomInThreshold)
                      zoomIndex++;
  </code></pre>