Package com.naver.ads.ui
Class RoundCornerViewDecorator
-
- All Implemented Interfaces:
-
com.naver.ads.ui.RoundCornerDecorator
public final class RoundCornerViewDecorator extends ViewDecorator implements RoundCornerDecorator
Decorator implementations for applying rounded corner to the given view.
-
-
Constructor Summary
Constructors Constructor Description RoundCornerViewDecorator(View view, ViewDecorator.SuperDrawDispatcher superDrawDispatcher, ViewDecorator.SuperDispatchDrawDispatcher superDispatchDrawDispatcher)Creates a RoundCornerViewDecorator instance.
-
Method Summary
Modifier and Type Method Description UnitsetCornerRadius(Float cornerRadius)Sets the radius for each corner. UnitsetCornerRadius(Float topLeft, Float topRight, Float bottomRight, Float bottomLeft)Sets different radius for each corners. UnitsetBorderColor(Integer borderColor)Sets the color to be used for the border line. UnitsetBorderWidth(Float borderWidth)Sets the width that will be used for the border line. Unitdraw(Canvas canvas)Called when the android.view.View.draw method is called on the given view. UnitdispatchDraw(Canvas canvas)Called when the android.view.View.dispatchDraw method is called on the given view. UnitonSizeChanged(Integer w, Integer h, Integer oldw, Integer oldh)Called when the android.view.View.onSizeChanged method is called on the given view. final UnitupdateClipPath(Integer w, Integer h)Updates clip path for applying rounded corner clip and border. -
-
Constructor Detail
-
RoundCornerViewDecorator
RoundCornerViewDecorator(View view, ViewDecorator.SuperDrawDispatcher superDrawDispatcher, ViewDecorator.SuperDispatchDrawDispatcher superDispatchDrawDispatcher)
Creates a RoundCornerViewDecorator instance.- Parameters:
view- the view which rounded corner clip and border line will be applied.
-
-
Method Detail
-
setCornerRadius
Unit setCornerRadius(Float cornerRadius)
Sets the radius for each corner.
- Parameters:
cornerRadius- the radius for each corner to set.
-
setCornerRadius
Unit setCornerRadius(Float topLeft, Float topRight, Float bottomRight, Float bottomLeft)
Sets different radius for each corners.
- Parameters:
topLeft- the radius of top-left cornertopRight- the radius of top-right cornerbottomRight- the radius of bottom-right cornerbottomLeft- the radius of bottom-left corner
-
setBorderColor
Unit setBorderColor(Integer borderColor)
Sets the color to be used for the border line. By default
Color.Transparentis used.- Parameters:
borderColor- the color to be used for the border line.
-
setBorderWidth
Unit setBorderWidth(Float borderWidth)
Sets the width that will be used for the border line. By default 0 is used.
-
draw
Unit draw(Canvas canvas)
Called when the android.view.View.draw method is called on the given view.
- Parameters:
canvas- the canvas to draw into
-
dispatchDraw
Unit dispatchDraw(Canvas canvas)
Called when the android.view.View.dispatchDraw method is called on the given view.
- Parameters:
canvas- the canvas to draw into
-
onSizeChanged
Unit onSizeChanged(Integer w, Integer h, Integer oldw, Integer oldh)
Called when the android.view.View.onSizeChanged method is called on the given view.
- Parameters:
w- the current width of the given view.h- the current height of the given view.oldw- the old width of the given view.oldh- the old height of the given view.
-
updateClipPath
final Unit updateClipPath(Integer w, Integer h)
Updates clip path for applying rounded corner clip and border.
- Parameters:
w- the width of the given view.h- the height of the given view.
-
-
-
-