-
public class ImageViewUtilsA collection of view utility functions for resolving absolute positions, clipping bounds, and other useful data for image views operations.
-
-
Field Summary
Fields Modifier and Type Field Description public final static ImageViewUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final RectresolveParentRectAbsPosition(View view, Boolean cropToPadding)Resolves the absolute position on the screen of the given View. final RectcalculateClipping(Rect parentRect, Rect childRect, Float density)Calculates the clipping Rect of the given child Rect using its parent Rect and the screen density. final RectresolveContentRectWithScaling(ImageView imageView, Drawable drawable, ImageView.ScaleType customScaleType)Resolves the Drawable content Rect using the given ImageView scale type. -
-
Method Detail
-
resolveParentRectAbsPosition
final Rect resolveParentRectAbsPosition(View view, Boolean cropToPadding)
Resolves the absolute position on the screen of the given View.
- Parameters:
view- the View.cropToPadding- if the view has cropToPadding as true.
-
calculateClipping
final Rect calculateClipping(Rect parentRect, Rect childRect, Float density)
-
resolveContentRectWithScaling
final Rect resolveContentRectWithScaling(ImageView imageView, Drawable drawable, ImageView.ScaleType customScaleType)
- Parameters:
imageView- the ImageView.drawable- the Drawable.customScaleType- optional custom ImageView.ScaleType.
-
-
-
-