public abstract class

AbstractEntityCell

extends ViewGroup
implements KeylineProvider
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.sap.cloud.mobile.fiori.object.AbstractEntityCell
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Abstract base class for views to show detail image, headline, subheadline, and description. Subclasses should implement onMeasure and onLayout to fulfill the layout requirement.

Summary

Nested Classes
class AbstractEntityCell.GroupLayoutParams Layout information for child views of AbstractEntityCells. 
@interface AbstractEntityCell.ImageShape  
XML Attributes
Attribute Name Related Method Description
com.sap.cloud.mobile.fiori:asyncRendering setAsyncRendering(boolean) Sets whether the description content will be rendered asynchronously for smooth scrolling. 
com.sap.cloud.mobile.fiori:description setDescription(int) The description associated with the AbstractEntityCell. 
com.sap.cloud.mobile.fiori:descriptionTextAppearance setDescriptionTextAppearance(int) Text color, typeface, size, and style for footnote. 
com.sap.cloud.mobile.fiori:descriptionWidthPercent setDescriptionWidthPercent(float) The width percentage of description of the total width shared by headline and description

May be a floating point value, such as "1.2". 

com.sap.cloud.mobile.fiori:detailImage setDetailImage(int) The detail image. 
com.sap.cloud.mobile.fiori:detailImageCharacter setDetailImageCharacter(CharSequence) The placeholder character for the detail image. 
com.sap.cloud.mobile.fiori:detailImageDescription setDetailImageDescription(CharSequence) A content description string to describe the appearance of the associated detail image. 
com.sap.cloud.mobile.fiori:headline setHeadline(int) The headline associated with the AbstractEntityCell. 
com.sap.cloud.mobile.fiori:headlineLines setHeadlineLines(int) Makes the headline be exactly this many lines tall. 
com.sap.cloud.mobile.fiori:headlineTextAppearance setHeadlineTextAppearance(int) Text color, typeface, size, and style for headline. 
com.sap.cloud.mobile.fiori:lines setLines(int) Total number of lines. 
com.sap.cloud.mobile.fiori:preserveDescriptionSpacing setPreserveDescriptionSpacing(boolean) Whether to preserve description space when no description is given

May be a boolean value, such as "true" or "false". 

com.sap.cloud.mobile.fiori:preserveDetailImageSpacing setPreserveDetailImageSpacing(boolean) Whether to preserve detail image space when image is null

May be a boolean value, such as "true" or "false". 

com.sap.cloud.mobile.fiori:subheadline setSubheadline(CharSequence) The subheadline associated with the AbstractEntityCell. 
com.sap.cloud.mobile.fiori:subheadlineTextAppearance setSubheadlineTextAppearance(int) Text color, typeface, size, and style for subheadline. 
Constants
int IMAGE_SHAPE_OVAL Oval image shape.
int IMAGE_SHAPE_RECTANGLE Rectangle image shape.
int IMAGE_SHAPE_ROUND_RECT Rounded corner rectangle image shape.
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
Fields
public static final char[] ELLIPSIS_NORMAL
public static final String ELLIPSIS_STRING
protected boolean mAsyncRendering
protected float mDescriptionHeight
protected StaticLayout mDescriptionLayout
protected int mDescriptionTextAppearance
protected StaticLayoutTextView mDescriptionTextView
protected int mDescriptionWidth
protected float mDescriptionWidthPercent
protected CharSequence mDetailImageCharacter
protected CharSequence mDetailImageDescription
protected ImageView mDetailImageView
protected float mFootnoteHeight
protected float mHeadlineHeight
protected StaticLayout mHeadlineLayout
protected int mHeadlineLines
protected int mHeadlinePaddingBottom
protected int mHeadlineTextAppearance
protected StaticLayoutTextView mHeadlineTextView
protected int mHeight
protected int mIconSize
protected int mImageOutlineShape
protected int mImageSize
protected TextView mImageTextView
protected int mImageWidthWithMargin
protected boolean mIsTablet
protected int mLargeMargin
protected int mMediumMargin
protected int mMinTouchSize
protected boolean mPreserveDetailImageSpacing
protected int mSmallIconSize
protected int mSmallMargin
protected int mSmallerMargin
protected float mSubHeadlineHeight
protected int mSubHeadlinePaddingBottom
protected StaticLayout mSubheadlineLayout
protected int mSubheadlineTextAppearance
protected StaticLayoutTextView mSubheadlineTextView
protected int mTinyMargin
protected int mTitleWidth
protected static CharSequence sLoading
protected static ViewOutlineProvider sOvalOutlineProvider
protected static ViewOutlineProvider sRoundRectOutlineProvider
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
AbstractEntityCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
AbstractEntityCell.GroupLayoutParams generateLayoutParams(AttributeSet attrs)
CharSequence getDescription()
Gets the description of the object cell.
float getDescriptionWidthPercent()
Gets description width percentage in the space shared by headline and description.
Drawable getDetailImage()
Return the current detail image drawable.
CharSequence getDetailImageCharacter()
Returns the character as placeholder of the detail image.
CharSequence getDetailImageDescription()
Return the description of the object cell's detail image.
ImageView getDetailImageView()
Gets the detail image view.
CharSequence getHeadline()
Gets the headline of the object cell.
int getHeadlineLines()
Gets the number of lines of headline text view
int getImageOutlineShape()
Returns the detail image outline shape.
int getKeylineStart()
Returns the starting position of the headline text.
int getLines()
Gets the total of lines
boolean getPreserveDescriptionSpacing()
Returns true if to preserve description spacing even when description is null
boolean getPreserveDetailImageSpacing()
Returns true if to preserve detail image space even when image is null
CharSequence getSubheadline()
Gets the subheadline of the object cell.
boolean isAsyncRendering()
Returns whether the description content will be rendered asynchronously.
ImageView prepareDetailImageView()
Gets the detail image view.
void resetCell()
Resets the cell to its initial state (i.e., re-applies all of the styling that was used at the time the cell was constructed).
void setAsyncRendering(boolean asyncRendering)
Sets whether the description content will be rendered asynchronously.
void setDescription(CharSequence description)
Sets the description of the object cell.
void setDescription(int resId)
Sets the description of the object cell.
void setDescriptionTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for description from the specified TextAppearance resource.
void setDescriptionWidthPercent(float descriptionWidthPercent)
Sets the description width percentage in the space shared by headline and description.
void setDetailImage(Drawable drawable)
Sets a detailImage drawable.
void setDetailImage(int resId)
Sets a detail image drawable from a resource id.
void setDetailImageCharacter(CharSequence character)
Sets the character as placeholder of the detail image.
void setDetailImageDescription(int resId)
Set a description of the object cell's detail image.
void setDetailImageDescription(CharSequence description)
Set a description of the object cell's detailImage.
void setHeadline(CharSequence headline)
Sets the headline of the object cell.
void setHeadline(int resId)
Sets the headline of the object cell.
void setHeadlineLines(int headlineLines)
Sets the number of lines of headline text view
void setHeadlineTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for headline from the specified TextAppearance resource.
void setImageOutlineShape(int imageOutlineShape)
Sets the detail image outline shape.
void setLines(int lines)
Sets the total number of lines
void setPreserveDescriptionSpacing(boolean preserveDescriptionSpacing)
Preserves spacing for description
void setPreserveDetailImageSpacing(boolean preserveDetailImageSpacing)
Preserves spacing for detail image
void setSubheadline(int resId)
Set the subheadline of this object cell.
void setSubheadline(CharSequence subheadline)
Sets the subheadline of the object cell.
void setSubheadlineTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for subheadline from the specified TextAppearance resource.
Protected Methods
void addSystemView(View v)
Adds internal child views.
void addViewToGroup(View v, int group)
Adds the view into specified group.
static int adjustMeasureSpec(int childSpec, int constraint)
Converts child measurement into EXACTLY if possible.
int calculateDynamicHeight(int lines)
boolean checkLayoutParams(ViewGroup.LayoutParams p)
void checkTextWidth(int textWidth, int descriptionWidth)
Updates StaticLayoutTextViews if width is changed.
void configureDescriptionLayout()
Configures StaticLayoutTextView for description field.
void configureHeadlineLayout()
Configures headline layout
void configureSubheadlineLayout()
Configures sub headline layout
TextPaint createTextPaint(int resId)
Creates TextPaint from the given resource id
void doSetDescription(CharSequence description)
Sets description.
void ensureDetailImageView()
AbstractEntityCell.GroupLayoutParams generateDefaultLayoutParams()
AbstractEntityCell.GroupLayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
int getDescriptionWidth()
Returns the width for description.
int getHorizontalMargins(View v)
Gets horizontal margin from layout params
int getLayoutLines()
Returns fixed lines or if setLines(0) was used, returns number of lines based on content.
int getMaxLines()
Returns the max number of lines supported by this cell.
int getRemainedDescriptionWidth(int parentWidthSpec, int endWidthUsed)
Calculates how much width is left for headline if description is present
int getRemainedWidth(int parentWidthSpec, int widthUsed)
Calculates how much width is left
Layout.Alignment getTextLayoutAlignment()
Determines how the text should laid out.
int getTitleWidth()
Returns the width for title area, including headline and subheadline.
int getVerticalMargins(View v)
Gets vertical margin from layout params
boolean isChild(View child)
Tests whether the given view is a child view
boolean loadingDescription()
static void measureChildConstrained(View child, int parentWidthSpec, int widthUsed, int widthConstraint, int parentHeightSpec, int heightUsed, int heightConstraint, int hPadding, int vPadding)
Measures child with optional constraint.
void measureChildFixed(View child, int width, int height)
Measures child view with fixed width and height
void measureChildFixed(View child, int width, int height, boolean touchable)
Measures child view with fixed width and height.
void measureTextLayout(StaticLayoutTextView child, int width)
Measures the text view with the given width
StaticLayout obtainStaticLayout(CharSequence text, TextPaint paint, int width, int lines, float lineHeight)
Creates a new StaticLayout based on the parameters
int retrieveLines()
Returns number of lines based on content.
StaticLayoutTextView setTextView(StaticLayoutTextView textView, StaticLayout layout)
Sets the StaticLayout to the view and returns the text view.
boolean shouldLayout(View view)
Returns whether the given view should be laid out, which means it's a child and is visible.
boolean shouldLayout(List<? extends View> views)
Returns true is any item in the given list should be laid out
void updateImageOutlineShape()
[Expand]
Inherited Methods
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.sap.cloud.mobile.fiori.object.KeylineProvider

XML Attributes

com.sap.cloud.mobile.fiori:asyncRendering

Sets whether the description content will be rendered asynchronously for smooth scrolling.

May be a boolean value, such as "true" or "false".

Related Methods

com.sap.cloud.mobile.fiori:description

The description associated with the AbstractEntityCell. Next to headline. Only appears in regular mode(tablet)

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:descriptionTextAppearance

Text color, typeface, size, and style for footnote. Defaults to secondary_text_default_material_light color. Default style: TextAppearance_Fiori_ObjectCell_Description

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

com.sap.cloud.mobile.fiori:descriptionWidthPercent

The width percentage of description of the total width shared by headline and description

May be a floating point value, such as "1.2".

com.sap.cloud.mobile.fiori:detailImage

The detail image.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Related Methods

com.sap.cloud.mobile.fiori:detailImageCharacter

The placeholder character for the detail image. No effect if detailImage is not null.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

com.sap.cloud.mobile.fiori:detailImageDescription

A content description string to describe the appearance of the associated detail image.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

com.sap.cloud.mobile.fiori:headline

The headline associated with the AbstractEntityCell. Mandatory.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:headlineLines

Makes the headline be exactly this many lines tall. Default value is 1 if not specified. When it's 2, footnote will disappear; when it's 3, sub headline will also disappear. This must be equal to or less than "lines".

May be an integer value, such as "100".

Related Methods

com.sap.cloud.mobile.fiori:headlineTextAppearance

Text color, typeface, size, and style for headline. Defaults to material_grey_900 color. Default style: TextAppearance_Fiori_ObjectCell_Headline

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

com.sap.cloud.mobile.fiori:lines

Total number of lines.

May be an integer value, such as "100".

Related Methods

com.sap.cloud.mobile.fiori:preserveDescriptionSpacing

Whether to preserve description space when no description is given

May be a boolean value, such as "true" or "false".

com.sap.cloud.mobile.fiori:preserveDetailImageSpacing

Whether to preserve detail image space when image is null

May be a boolean value, such as "true" or "false".

com.sap.cloud.mobile.fiori:subheadline

The subheadline associated with the AbstractEntityCell. Under headline.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

com.sap.cloud.mobile.fiori:subheadlineTextAppearance

Text color, typeface, size, and style for subheadline. Defaults to primary_text_default_material_light color. Default style: TextAppearance_Fiori_ObjectCell_Subheadline

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Constants

public static final int IMAGE_SHAPE_OVAL

Oval image shape. Used for people.

Constant Value: 1 (0x00000001)

public static final int IMAGE_SHAPE_RECTANGLE

Rectangle image shape. Used for objects.

Constant Value: 0 (0x00000000)

public static final int IMAGE_SHAPE_ROUND_RECT

Rounded corner rectangle image shape. Used for objects.

Constant Value: 2 (0x00000002)

Fields

public static final char[] ELLIPSIS_NORMAL

public static final String ELLIPSIS_STRING

protected boolean mAsyncRendering

protected float mDescriptionHeight

protected StaticLayout mDescriptionLayout

protected int mDescriptionTextAppearance

protected StaticLayoutTextView mDescriptionTextView

protected int mDescriptionWidth

protected float mDescriptionWidthPercent

protected CharSequence mDetailImageCharacter

protected CharSequence mDetailImageDescription

protected ImageView mDetailImageView

protected float mFootnoteHeight

protected float mHeadlineHeight

protected StaticLayout mHeadlineLayout

protected int mHeadlineLines

protected int mHeadlinePaddingBottom

protected int mHeadlineTextAppearance

protected StaticLayoutTextView mHeadlineTextView

protected int mHeight

protected int mIconSize

protected int mImageOutlineShape

protected int mImageSize

protected TextView mImageTextView

protected int mImageWidthWithMargin

protected boolean mIsTablet

protected int mLargeMargin

protected int mMediumMargin

protected int mMinTouchSize

protected boolean mPreserveDetailImageSpacing

protected int mSmallIconSize

protected int mSmallMargin

protected int mSmallerMargin

protected float mSubHeadlineHeight

protected int mSubHeadlinePaddingBottom

protected StaticLayout mSubheadlineLayout

protected int mSubheadlineTextAppearance

protected StaticLayoutTextView mSubheadlineTextView

protected int mTinyMargin

protected int mTitleWidth

protected static CharSequence sLoading

protected static ViewOutlineProvider sOvalOutlineProvider

protected static ViewOutlineProvider sRoundRectOutlineProvider

Public Constructors

public AbstractEntityCell (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public AbstractEntityCell.GroupLayoutParams generateLayoutParams (AttributeSet attrs)

public CharSequence getDescription ()

Gets the description of the object cell.

Returns
  • The description.

public float getDescriptionWidthPercent ()

Gets description width percentage in the space shared by headline and description.

Returns
  • The description width percentage.

public Drawable getDetailImage ()

Return the current detail image drawable.

Returns
  • The current detail image drawable

public CharSequence getDetailImageCharacter ()

Returns the character as placeholder of the detail image.

public CharSequence getDetailImageDescription ()

Return the description of the object cell's detail image.

Returns
  • A description of the detail image

public ImageView getDetailImageView ()

Gets the detail image view.

Returns
  • detail image view, could be null

public CharSequence getHeadline ()

Gets the headline of the object cell.

Related XML Attributes
Returns
  • The headline.

public int getHeadlineLines ()

Gets the number of lines of headline text view

public int getImageOutlineShape ()

Returns the detail image outline shape.

public int getKeylineStart ()

Returns the starting position of the headline text. This can be used as key line to determine divider line position, etc.

Returns
  • start (left/right) position of headline text based on layout direction.

public int getLines ()

Gets the total of lines

Related XML Attributes

public boolean getPreserveDescriptionSpacing ()

Returns true if to preserve description spacing even when description is null

public boolean getPreserveDetailImageSpacing ()

Returns true if to preserve detail image space even when image is null

public CharSequence getSubheadline ()

Gets the subheadline of the object cell.

Returns
  • The subheadline.

public boolean isAsyncRendering ()

Returns whether the description content will be rendered asynchronously.

public ImageView prepareDetailImageView ()

Gets the detail image view. Creates it if necessary. This can be used together with libraries like Glide.

Returns
  • detail image view

public void resetCell ()

Resets the cell to its initial state (i.e., re-applies all of the styling that was used at the time the cell was constructed).

public void setAsyncRendering (boolean asyncRendering)

Sets whether the description content will be rendered asynchronously. Long text rendering is expensive, so for a smooth scroll this mode should be set to true.

public void setDescription (CharSequence description)

Sets the description of the object cell. Only visible in regular mode. Ignores input on a phone.

Description is typically a longer string of text.

Parameters
description The description.

public void setDescription (int resId)

Sets the description of the object cell. Only visible in regular mode.

Description is typically a longer string of text.

Parameters
resId String resource ID

public void setDescriptionTextAppearance (int resId)

Sets the text color, size, style, hint color, and highlight color for description from the specified TextAppearance resource.

public void setDescriptionWidthPercent (float descriptionWidthPercent)

Sets the description width percentage in the space shared by headline and description. Only used when in regular( tablet) mode and description is available.

Parameters
descriptionWidthPercent The description width percentage.

public void setDetailImage (Drawable drawable)

Sets a detailImage drawable.

This drawable takes the place before headline. The detail image cannot be clicked. Apps using a detail image should also supply a description using setDetailImageDescription(int).

Parameters
drawable Drawable to use as a detail image

public void setDetailImage (int resId)

Sets a detail image drawable from a resource id.

This drawable takes the place before headline. The detail image cannot be clicked. Apps using a detail image should also supply a description using setDetailImageDescription(int).

Parameters
resId ID of a drawable resource

public void setDetailImageCharacter (CharSequence character)

Sets the character as placeholder of the detail image.

Parameters
character character to display. One character is recommended.

public void setDetailImageDescription (int resId)

Set a description of the object cell's detail image.

This description will be used for accessibility or other similar descriptions of the UI.

Parameters
resId String resource id

public void setDetailImageDescription (CharSequence description)

Set a description of the object cell's detailImage.

This description will be used for accessibility or other similar descriptions of the UI.

Parameters
description Description to set

public void setHeadline (CharSequence headline)

Sets the headline of the object cell. The headline is always shown.

A headline should be used as the anchor for a section of content. It should describe or name the content being viewed.

Related XML Attributes
Parameters
headline The headline.

public void setHeadline (int resId)

Sets the headline of the object cell. The headline is always shown.

A headline should be used as the anchor for a section of content. It should describe or name the content being viewed.

Related XML Attributes
Parameters
resId Resource ID of a string to set as the headline

public void setHeadlineLines (int headlineLines)

Sets the number of lines of headline text view

Parameters
headlineLines line number, must be 1, 2 or 3 and less than getLines()

public void setHeadlineTextAppearance (int resId)

Sets the text color, size, style, hint color, and highlight color for headline from the specified TextAppearance resource.

public void setImageOutlineShape (int imageOutlineShape)

Sets the detail image outline shape.

public void setLines (int lines)

Sets the total number of lines

Related XML Attributes
Parameters
lines cell lines, could be 1 to getMaxLines() for fixed number or 0 for dynamic layout

public void setPreserveDescriptionSpacing (boolean preserveDescriptionSpacing)

Preserves spacing for description

public void setPreserveDetailImageSpacing (boolean preserveDetailImageSpacing)

Preserves spacing for detail image

public void setSubheadline (int resId)

Set the subheadline of this object cell.

Subheadline should express extended information about the current content.

Parameters
resId String resource ID

public void setSubheadline (CharSequence subheadline)

Sets the subheadline of the object cell.

Subheadline should express extended information about the current content.

Parameters
subheadline The subheadline.

public void setSubheadlineTextAppearance (int resId)

Sets the text color, size, style, hint color, and highlight color for subheadline from the specified TextAppearance resource.

Protected Methods

protected void addSystemView (View v)

Adds internal child views. Always sets layout param's layout_group to LAYOUT_GROUP_INTERNAL

Parameters
v view to be added

protected void addViewToGroup (View v, int group)

Adds the view into specified group.

Parameters
v view
group group

protected static int adjustMeasureSpec (int childSpec, int constraint)

Converts child measurement into EXACTLY if possible.

protected int calculateDynamicHeight (int lines)

protected boolean checkLayoutParams (ViewGroup.LayoutParams p)

protected void checkTextWidth (int textWidth, int descriptionWidth)

Updates StaticLayoutTextViews if width is changed. Important! Don't call requestLayout() here since it's called from onMeasure. Otherwise it would cause repeated onMeasure calls and even Espresso wouldn't be able to locate the root view because of constant layout requests.

Parameters
textWidth whole text width
descriptionWidth width that COULD be used by description

protected void configureDescriptionLayout ()

Configures StaticLayoutTextView for description field. Sets up asynchronous rendering when necessary.

protected void configureHeadlineLayout ()

Configures headline layout

protected void configureSubheadlineLayout ()

Configures sub headline layout

protected TextPaint createTextPaint (int resId)

Creates TextPaint from the given resource id

protected void doSetDescription (CharSequence description)

Sets description. Subclass can call this directly to work around the restriction imposed by AbstractEntityCell.

protected void ensureDetailImageView ()

protected AbstractEntityCell.GroupLayoutParams generateDefaultLayoutParams ()

protected int getDescriptionWidth ()

Returns the width for description.

protected int getHorizontalMargins (View v)

Gets horizontal margin from layout params

protected int getLayoutLines ()

Returns fixed lines or if setLines(0) was used, returns number of lines based on content.

protected int getMaxLines ()

Returns the max number of lines supported by this cell.

protected int getRemainedDescriptionWidth (int parentWidthSpec, int endWidthUsed)

Calculates how much width is left for headline if description is present

protected int getRemainedWidth (int parentWidthSpec, int widthUsed)

Calculates how much width is left

protected Layout.Alignment getTextLayoutAlignment ()

Determines how the text should laid out.

protected int getTitleWidth ()

Returns the width for title area, including headline and subheadline.

protected int getVerticalMargins (View v)

Gets vertical margin from layout params

protected boolean isChild (View child)

Tests whether the given view is a child view

protected boolean loadingDescription ()

protected static void measureChildConstrained (View child, int parentWidthSpec, int widthUsed, int widthConstraint, int parentHeightSpec, int heightUsed, int heightConstraint, int hPadding, int vPadding)

Measures child with optional constraint.

protected void measureChildFixed (View child, int width, int height)

Measures child view with fixed width and height

protected void measureChildFixed (View child, int width, int height, boolean touchable)

Measures child view with fixed width and height. If touchable is true, add padding if necessary.

protected void measureTextLayout (StaticLayoutTextView child, int width)

Measures the text view with the given width

protected StaticLayout obtainStaticLayout (CharSequence text, TextPaint paint, int width, int lines, float lineHeight)

Creates a new StaticLayout based on the parameters

Parameters
text text to render
paint how to render
width width of the layout
lines max lines of the layout
lineHeight the height between base lines
Returns
  • the created StaticLayout

protected int retrieveLines ()

Returns number of lines based on content. To be overwritten by subclasses.

protected StaticLayoutTextView setTextView (StaticLayoutTextView textView, StaticLayout layout)

Sets the StaticLayout to the view and returns the text view.

Parameters
textView the text view
layout the new layout
Returns
  • the original text view

protected boolean shouldLayout (View view)

Returns whether the given view should be laid out, which means it's a child and is visible.

protected boolean shouldLayout (List<? extends View> views)

Returns true is any item in the given list should be laid out

Parameters
views list of views

protected void updateImageOutlineShape ()