Package com.naver.ads.ui
Class AspectRatioViewDecorator
-
- All Implemented Interfaces:
-
com.naver.ads.ui.AspectRatioDecorator
public final class AspectRatioViewDecorator extends ViewDecorator implements AspectRatioDecorator
Decorator for applying the desired aspect ratio to the given view.
-
-
Constructor Summary
Constructors Constructor Description AspectRatioViewDecorator(View view, ViewDecorator.SuperOnMeasureDispatcher superOnMeasureDispatcher)Creates a AspectRatioViewDecorator instance.
-
Method Summary
Modifier and Type Method Description UnitsetAspectRatio(Float aspectRatio)Sets the aspect ratio that this view should satisfy. UnitsetAspectRatioListener(AspectRatioDecorator.AspectRatioListener aspectRatioListener)Sets the AspectRatioListener. UnitsetResizeMode(AspectRatioDecorator.ResizeMode resizeMode)Sets the ResizeMode. UnitonMeasure(Integer widthMeasureSpec, Integer heightMeasureSpec)Called when the android.view.View.onMeasure method is called on the given view. -
-
Constructor Detail
-
AspectRatioViewDecorator
AspectRatioViewDecorator(View view, ViewDecorator.SuperOnMeasureDispatcher superOnMeasureDispatcher)
Creates a AspectRatioViewDecorator instance.- Parameters:
view- the view which aspect ratio will be applied.
-
-
Method Detail
-
setAspectRatio
Unit setAspectRatio(Float aspectRatio)
Sets the aspect ratio that this view should satisfy.
- Parameters:
aspectRatio- the with to height ratio.
-
setAspectRatioListener
Unit setAspectRatioListener(AspectRatioDecorator.AspectRatioListener aspectRatioListener)
Sets the AspectRatioListener.
- Parameters:
aspectRatioListener- the listener to be notified about aspect ratios changes, or null to clear a listener that was previously set.
-
setResizeMode
Unit setResizeMode(AspectRatioDecorator.ResizeMode resizeMode)
Sets the ResizeMode.
- Parameters:
resizeMode- the ResizeMode.
-
onMeasure
Unit onMeasure(Integer widthMeasureSpec, Integer heightMeasureSpec)
Called when the android.view.View.onMeasure method is called on the given view.
- Parameters:
widthMeasureSpec- horizontal space requirements as imposed by the parent.heightMeasureSpec- vertical space requirements as imposed by the parent.
-
-
-
-