Android Programming Press on the image to return to the main documentation page.

CardView

Written by Markus Stipp

List of types:

CardView

CardView


This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Click
LongClick

Members:


  AddView (View As android.view.View, Left As Int, Top As Int, Width As Int, Height As Int)

  BringToFront

  Color As Int [write only]

  CornerRadius As Float

  DesignerCreateView (base As PanelWrapper, label As LabelWrapper, props As Map)

  Elevation As Float

  Enabled As Boolean

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  LoadLayout (LayoutFile As String)

  MaxElevation As Float

  Padding() As Int

  Parent As Object [read only]

  PreventCornerOverlap As Boolean

  RemoveAllViews

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (arg0 As android.graphics.Bitmap)

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetContentPadding (Left As Int, Top As Int, Right As Int, Bottom As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  UseCompatPadding As Boolean

  Visible As Boolean

  Width As Int

Members description:

AddView (View As android.view.View, Left As Int, Top As Int, Width As Int, Height As Int)
Add a View to the CardView object
BringToFront
Color As Int [write only]
Sets the Background Color of the Card.
CornerRadius As Float
Sets or gets the corner radius.
DesignerCreateView (base As PanelWrapper, label As LabelWrapper, props As Map)
This method is only for the B4A Designer. Don't call it directly
Elevation As Float
Sets or gets the Card elevation.
Enabled As Boolean
Height As Int
Gets or sets the view's height
Initialize (EventName As String)
Initializes the object
Invalidate
Invalidate2 (Rect As android.graphics.Rect)
Invalidate a rectangualar part of the object
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidate part of the object
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position
LoadLayout (LayoutFile As String)
MaxElevation As Float
Sets the maximum elevation
Padding() As Int
Parent As Object [read only]
PreventCornerOverlap As Boolean
Set this attribute to true to add padding when your app is running on earlier Android versions (API level 20 and earlier). This setting prevents CardView content from intersecting with the CardView's rounded corners.
RemoveAllViews
Remove all views from the card.
RemoveView
RequestFocus As Boolean
SendToBack
SetBackgroundImage (arg0 As android.graphics.Bitmap)
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Animate the color to a new value
SetContentPadding (Left As Int, Top As Int, Right As Int, Bottom As Int)
Sets the padding for the content.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the View position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.

Duration - duration of the layout change
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Fade the view in or out
Tag As Object
Top As Int
Gets or sets the view's top position
UseCompatPadding As Boolean
Set this attribute to true to add padding when your app is running in versions of Android at or greater than API level 21. If you want to use CardView on pre-Lollipop devices and have it look the same on Lollipop (or later), set this attribute to true. When this attribute is enabled, CardView adds additional padding to draw shadows when it runs on pre-Lollipop devices. This helps to overcome the differences in padding that are introduced when pre-Lollipop programmatic shadow implementations are in effect.
Visible As Boolean
Width As Int
Gets or sets the view's width
Top