CardView

Last Updated On 2021-07-16

Version 1MinSDK 7Tutorial Video

A layout with a rounded corner background and shadow.


Properties

You can set the below properties in the UI part of the builder.

  • AlignHorizontal - it's a horizontal alignment value which is set to 1 by default.
  • AlignVertical - it's a vertical alignment value which is set to 1 by default.
  • BackgroundColor - it's a color value which is set to &h00000000 by default.
  • Clickable - it's a boolean value which is set to false by default.
  • ContentPaddingBottom - it's a float value which is set to 5 by default.
  • ContentPaddingLeft - it's a float value which is set to 5 by default.
  • ContentPaddingRight - it's a float value which is set to 5 by default.
  • ContentPaddingTop - it's a float value which is set to 5 by default.
  • CornerOverlap - it's a boolean value which is set to true by default.
  • Elevation - it's a float value which is set to 2 by default.
  • FullClickable - it's a boolean value which is set to false by default.
  • HeihMargin - it's a four value which is set to 0,0,0,0 by default.
  • HeihPadding - it's a four value which is set to 0,0,0,0 by default.
  • Image - it's a asset value which is set to blank by default.
  • LongClickable - it's a boolean value which is set to false by default.
  • MarginBottom - it's a non negative float value which is set to 0 by default.
  • MarginLeft - it's a non negative float value which is set to 0 by default.
  • MarginRight - it's a non negative float value which is set to 0 by default.
  • MarginTop - it's a non negative float value which is set to 0 by default.
  • PaddingBottom - it's a non negative float value which is set to 0 by default.
  • PaddingLeft - it's a non negative float value which is set to 0 by default.
  • PaddingRight - it's a non negative float value which is set to 0 by default.
  • PaddingTop - it's a non negative float value which is set to 0 by default.
  • Radious - it's a float value which is set to 3 by default.
  • Radius - it's a float value which is set to 3 by default.
  • RippleColor - it's a color value which is set to &hffffffff by default.
  • RippleEnabled - it's a boolean value which is set to false by default.
  • Visible - it's a visibility value which is set to true by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

AlignHorizontal

A number that encodes how contents of the NiotronCardView are aligned horizontally. The choices are: 1 = left aligned, 2 = right aligned, 3 = horizontally centered. Alignment has no effect if the arrangement's width is automatic.


AlignVertical

A number that encodes how the contents of the NiotronCardView are aligned vertically. The choices are: 1 = aligned at the top, 2 = vertically centered, 3 = aligned at the bottom. Alignment has no effect if the arrangement's height is automatic.


BackgroundColor

Returns the background color of the NiotronCardView


Clickable

Specifies whether the image should be clickable or not.


ContentPaddingBottom

Sets content padding to bottom of cardview


ContentPaddingLeft

Sets content padding to left of cardview


ContentPaddingRight

Sets content padding to right of cardview


ContentPaddingTop

Sets content padding to top of cardview


CornerOverlap

On pre-Lollipop platforms, CardView does not clip the bounds of the Card for the rounded corners.


Elevation

Sets elevation to cardview


FullClickable

Specifies whether the card should be full clickable or not.


Height

Specifies the vertical height of the NiotronCardView, measured in pixels.


HeightPercent

Specifies the vertical height of the NiotronCardView as a percentage of the height of the Screen.


Image

Returns the path of the background image of the `NiotronCardView`.


LongClickable

Specifies whether the image should be long clickable or not.


MarginBottom

Property for MarginBottom


MarginLeft

Property for MarginLeft


MarginRight

Property for MarginRight


MarginTop

Property for MarginTop


PaddingBottom

Property for PaddingBottom


PaddingLeft

Property for PaddingLeft


PaddingRight

Property for PaddingRight


PaddingTop

Property for PaddingTop


Radious

Sets radius to cardview


Radius

Sets radius to cardview


RippleColor

Sets ripple color


RippleEnabled

Enables/Disables ripple


Visible

Specifies whether the NiotronCardView should be visible on the screen. Value is true if the NiotronCardView is showing and false if hidden.


Width

Specifies the horizontal width of the NiotronCardView, measured in pixels.


WidthPercent

Specifies the horizontal width of the NiotronCardView as a percentage of the width of the Screen.



Events

You can set the below event blocks in the blocks section of the builder.

Click

Triggers when card clicked

LongClick

Triggers when card long clicked