ImageCardView
public
class
ImageCardView
extends BaseCardView
A subclass of BaseCardView with an ImageView as its main region. The
ImageCardView is highly customizable and can be used for various use-cases by adjusting
the ImageViewCard's type to any combination of Title, Content, Badge or ImageOnly.
Styling
There are two different ways to style the ImageCardView.
No matter what way you use, all your styles applied to an ImageCardView have to extend the style
R.style.Widget_Leanback_ImageCardViewStyle.
Example:
<style name="CustomImageCardViewStyle" parent="Widget.Leanback.ImageCardViewStyle">
<item name="cardBackground">#F0F</item>
<item name="lbImageCardViewType">Title|Content</item>
</style>
<style name="CustomImageCardTheme" parent="Theme.Leanback">
<item name="imageCardViewStyle">@style/CustomImageCardViewStyle</item>
<item name="imageCardViewInfoAreaStyle">@style/ImageCardViewColoredInfoArea</item>
<item name="imageCardViewTitleStyle">@style/ImageCardViewColoredTitle</item>
</style>
The first possibility is to set custom Styles in the Leanback Theme's attributes
imageCardViewStyle, imageCardViewTitleStyle etc. The styles set here,
is the default style for all ImageCardViews.
The second possibility allows you to style a particular ImageCardView. This is useful if you
want to create multiple types of cards. E.g. you might want to display a card with only a title
and another one with title and content. Thus you need to define two different
ImageCardViewStyles and two different themes and apply them to the ImageCardViews.
You can do this by using a the ImageCardView(Context) constructor and passing a
ContextThemeWrapper with the custom ImageCardView theme id.
Example (using constructor):
new ImageCardView(new ContextThemeWrapper(context, R.style.CustomImageCardTheme));
You can style all ImageCardView's components such as the title, content, badge, infoArea and the
image itself by extending the corresponding style and overriding the specific attribute in your
custom ImageCardView theme.
Components
The ImageCardView contains three components which can be combined in any
combination:
- Title: The card's title
- Content: A short description
- Badge: An icon which can be displayed on the right or left side of the card.
In order to choose the components you want to use in your ImageCardView, you have to specify them
in the
lbImageCardViewType attribute of your custom
ImageCardViewStyle.
You can combine the following values:
Title, Content, IconOnRight, IconOnLeft, ImageOnly.
Examples:
<style name="CustomImageCardViewStyle" parent="Widget.Leanback.ImageCardViewStyle">
...
<item name="lbImageCardViewType">Title|Content|IconOnLeft</item>
...
</style>
<style name="CustomImageCardViewStyle" parent="Widget.Leanback.ImageCardViewStyle">
...
<item name="lbImageCardViewType">ImageOnly</item>
...
</style>
R.attr.imageCardViewStyle
R.attr.lbImageCardViewType
R.attr.imageCardViewTitleStyle
R.attr.imageCardViewContentStyle
R.attr.imageCardViewBadgeStyle
R.attr.imageCardViewImageStyle
R.attr.imageCardViewInfoAreaStyle
Summary
Inherited constants |
|
|
From class
android.view.ViewGroup
int |
CLIP_TO_PADDING_MASK
|
int |
FOCUS_AFTER_DESCENDANTS
|
int |
FOCUS_BEFORE_DESCENDANTS
|
int |
FOCUS_BLOCK_DESCENDANTS
|
int |
LAYOUT_MODE_CLIP_BOUNDS
|
int |
LAYOUT_MODE_OPTICAL_BOUNDS
|
int |
PERSISTENT_ALL_CACHES
|
int |
PERSISTENT_ANIMATION_CACHE
|
int |
PERSISTENT_NO_CACHE
|
int |
PERSISTENT_SCROLLING_CACHE
|
|
From class
android.view.View
int |
ACCESSIBILITY_LIVE_REGION_ASSERTIVE
|
int |
ACCESSIBILITY_LIVE_REGION_NONE
|
int |
ACCESSIBILITY_LIVE_REGION_POLITE
|
int |
AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
|
String |
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE
|
String |
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY
|
String |
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH
|
String |
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR
|
String |
AUTOFILL_HINT_CREDIT_CARD_NUMBER
|
String |
AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE
|
String |
AUTOFILL_HINT_EMAIL_ADDRESS
|
String |
AUTOFILL_HINT_NAME
|
String |
AUTOFILL_HINT_PASSWORD
|
String |
AUTOFILL_HINT_PHONE
|
String |
AUTOFILL_HINT_POSTAL_ADDRESS
|
String |
AUTOFILL_HINT_POSTAL_CODE
|
String |
AUTOFILL_HINT_USERNAME
|
int |
AUTOFILL_TYPE_DATE
|
int |
AUTOFILL_TYPE_LIST
|
int |
AUTOFILL_TYPE_NONE
|
int |
AUTOFILL_TYPE_TEXT
|
int |
AUTOFILL_TYPE_TOGGLE
|
int |
DRAG_FLAG_GLOBAL
|
int |
DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION
|
int |
DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION
|
int |
DRAG_FLAG_GLOBAL_URI_READ
|
int |
DRAG_FLAG_GLOBAL_URI_WRITE
|
int |
DRAG_FLAG_OPAQUE
|
int |
DRAWING_CACHE_QUALITY_AUTO
|
int |
DRAWING_CACHE_QUALITY_HIGH
|
int |
DRAWING_CACHE_QUALITY_LOW
|
int |
FIND_VIEWS_WITH_CONTENT_DESCRIPTION
|
int |
FIND_VIEWS_WITH_TEXT
|
int |
FOCUSABLE
|
int |
FOCUSABLES_ALL
|
int |
FOCUSABLES_TOUCH_MODE
|
int |
FOCUSABLE_AUTO
|
int |
FOCUS_BACKWARD
|
int |
FOCUS_DOWN
|
int |
FOCUS_FORWARD
|
int |
FOCUS_LEFT
|
int |
FOCUS_RIGHT
|
int |
FOCUS_UP
|
int |
GONE
|
int |
HAPTIC_FEEDBACK_ENABLED
|
int |
IMPORTANT_FOR_ACCESSIBILITY_AUTO
|
int |
IMPORTANT_FOR_ACCESSIBILITY_NO
|
int |
IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
|
int |
IMPORTANT_FOR_ACCESSIBILITY_YES
|
int |
IMPORTANT_FOR_AUTOFILL_AUTO
|
int |
IMPORTANT_FOR_AUTOFILL_NO
|
int |
IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
|
int |
IMPORTANT_FOR_AUTOFILL_YES
|
int |
IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS
|
int |
IMPORTANT_FOR_CONTENT_CAPTURE_AUTO
|
int |
IMPORTANT_FOR_CONTENT_CAPTURE_NO
|
int |
IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS
|
int |
IMPORTANT_FOR_CONTENT_CAPTURE_YES
|
int |
IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS
|
int |
INVISIBLE
|
int |
KEEP_SCREEN_ON
|
int |
LAYER_TYPE_HARDWARE
|
int |
LAYER_TYPE_NONE
|
int |
LAYER_TYPE_SOFTWARE
|
int |
LAYOUT_DIRECTION_INHERIT
|
int |
LAYOUT_DIRECTION_LOCALE
|
int |
LAYOUT_DIRECTION_LTR
|
int |
LAYOUT_DIRECTION_RTL
|
int |
MEASURED_HEIGHT_STATE_SHIFT
|
int |
MEASURED_SIZE_MASK
|
int |
MEASURED_STATE_MASK
|
int |
MEASURED_STATE_TOO_SMALL
|
int |
NOT_FOCUSABLE
|
int |
NO_ID
|
int |
OVER_SCROLL_ALWAYS
|
int |
OVER_SCROLL_IF_CONTENT_SCROLLS
|
int |
OVER_SCROLL_NEVER
|
int |
SCREEN_STATE_OFF
|
int |
SCREEN_STATE_ON
|
int |
SCROLLBARS_INSIDE_INSET
|
int |
SCROLLBARS_INSIDE_OVERLAY
|
int |
SCROLLBARS_OUTSIDE_INSET
|
int |
SCROLLBARS_OUTSIDE_OVERLAY
|
int |
SCROLLBAR_POSITION_DEFAULT
|
int |
SCROLLBAR_POSITION_LEFT
|
int |
SCROLLBAR_POSITION_RIGHT
|
int |
SCROLL_AXIS_HORIZONTAL
|
int |
SCROLL_AXIS_NONE
|
int |
SCROLL_AXIS_VERTICAL
|
int |
SCROLL_CAPTURE_HINT_AUTO
|
int |
SCROLL_CAPTURE_HINT_EXCLUDE
|
int |
SCROLL_CAPTURE_HINT_EXCLUDE_DESCENDANTS
|
int |
SCROLL_CAPTURE_HINT_INCLUDE
|
int |
SCROLL_INDICATOR_BOTTOM
|
int |
SCROLL_INDICATOR_END
|
int |
SCROLL_INDICATOR_LEFT
|
int |
SCROLL_INDICATOR_RIGHT
|
int |
SCROLL_INDICATOR_START
|
int |
SCROLL_INDICATOR_TOP
|
int |
SOUND_EFFECTS_ENABLED
|
int |
STATUS_BAR_HIDDEN
|
int |
STATUS_BAR_VISIBLE
|
int |
SYSTEM_UI_FLAG_FULLSCREEN
|
int |
SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
int |
SYSTEM_UI_FLAG_IMMERSIVE
|
int |
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
int |
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
int |
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
int |
SYSTEM_UI_FLAG_LAYOUT_STABLE
|
int |
SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
int |
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
int |
SYSTEM_UI_FLAG_LOW_PROFILE
|
int |
SYSTEM_UI_FLAG_VISIBLE
|
int |
SYSTEM_UI_LAYOUT_FLAGS
|
int |
TEXT_ALIGNMENT_CENTER
|
int |
TEXT_ALIGNMENT_GRAVITY
|
int |
TEXT_ALIGNMENT_INHERIT
|
int |
TEXT_ALIGNMENT_TEXT_END
|
int |
TEXT_ALIGNMENT_TEXT_START
|
int |
TEXT_ALIGNMENT_VIEW_END
|
int |
TEXT_ALIGNMENT_VIEW_START
|
int |
TEXT_DIRECTION_ANY_RTL
|
int |
TEXT_DIRECTION_FIRST_STRONG
|
int |
TEXT_DIRECTION_FIRST_STRONG_LTR
|
int |
TEXT_DIRECTION_FIRST_STRONG_RTL
|
int |
TEXT_DIRECTION_INHERIT
|
int |
TEXT_DIRECTION_LOCALE
|
int |
TEXT_DIRECTION_LTR
|
int |
TEXT_DIRECTION_RTL
|
String |
VIEW_LOG_TAG
|
int |
VISIBLE
|
|
Inherited fields |
From class
android.view.View
public
static
final
Property<View, Float> |
ALPHA
|
protected
static
final
int[] |
EMPTY_STATE_SET
|
protected
static
final
int[] |
ENABLED_FOCUSED_SELECTED_STATE_SET
|
protected
static
final
int[] |
ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
ENABLED_FOCUSED_STATE_SET
|
protected
static
final
int[] |
ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
ENABLED_SELECTED_STATE_SET
|
protected
static
final
int[] |
ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
ENABLED_STATE_SET
|
protected
static
final
int[] |
ENABLED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
FOCUSED_SELECTED_STATE_SET
|
protected
static
final
int[] |
FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
FOCUSED_STATE_SET
|
protected
static
final
int[] |
FOCUSED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_SELECTED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_STATE_SET
|
protected
static
final
int[] |
PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_FOCUSED_SELECTED_STATE_SET
|
protected
static
final
int[] |
PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_SELECTED_STATE_SET
|
protected
static
final
int[] |
PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_STATE_SET
|
protected
static
final
int[] |
PRESSED_WINDOW_FOCUSED_STATE_SET
|
public
static
final
Property<View, Float> |
ROTATION
|
public
static
final
Property<View, Float> |
ROTATION_X
|
public
static
final
Property<View, Float> |
ROTATION_Y
|
public
static
final
Property<View, Float> |
SCALE_X
|
public
static
final
Property<View, Float> |
SCALE_Y
|
protected
static
final
int[] |
SELECTED_STATE_SET
|
protected
static
final
int[] |
SELECTED_WINDOW_FOCUSED_STATE_SET
|
public
static
final
Property<<a href="http
| |