ImageViewZoomExtender implements ZoomableComponent { public void panTo(PointF difference) { Assert.notNull(difference, "The target point"); panTo(difference.x, difference.y); } ImageViewZoomExtender(ImageView imageView); @Override float getZoomLevel(); @Override void restore(ZoomInfo zoomInfo); @Override ZoomInfo save(); void zoomTo(float targetLevel); void zoomTo(float targetLevel, PointF zoomPoint); @Override void zoomTo(float targetLevel, float zoomX, float zoomY); void panTo(PointF difference); @Override void panTo(float dx, float dy); static final int DEFAULT_MATRIX_SIZE; static final int NONE_DEF_STYLE; static final float ORIGINAL_LEVEL; }
@Test public void extenderShouldCheckDrawableExistsWhenExtenderPans() { float dX = 0.0f; float dY = 0.0f; ImageView imageView = mock(ImageView.class); imageView.setImageBitmap(createTestBitmap()); ZoomableComponent extender = new ImageViewZoomExtender(imageView); extender.panTo(dX, dY); verify(imageView).getDrawable(); }