public class

FlexibleContentView

extends LinearLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ sofia.view.FlexibleContentView

Class Overview

A view that takes an arbitrary Object and renders it the best way it knows how. The following types are currently supported:

String
Renders the string using a TextView.
Bitmap, Drawable
Renders the object using an ImageView.

Summary

[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
FlexibleContentView(Context context)
FlexibleContentView(Context context, AttributeSet attrs)
Public Methods
int getMaxHeight()
Gets the maximum height of the view.
int getMaxWidth()
Gets the maximum width of the view.
int getTextColor()
Gets the color used to render the view's content when it is text.
float getTextSize()
Gets the text size used to render the view's content when it is text.
void setContent(Object object)
Sets the content that is displayed by this view, changing the type of the internal view to render it correctly.
void setMaxHeight(int maxHeight)
Sets the maximum height of the view.
void setMaxWidth(int maxWidth)
Sets the maximum width of the view.
void setTextColor(int color)
Sets the color used to render the view's content when it is text.
void setTextSize(float size)
Sets the text size used to render the view's content when it is text.
void setTextSize(int unit, float size)
Sets the text size used to render the view's content when it is text.
Protected Methods
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
From class android.widget.LinearLayout
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

Public Constructors

public FlexibleContentView (Context context)

public FlexibleContentView (Context context, AttributeSet attrs)

Public Methods

public int getMaxHeight ()

Gets the maximum height of the view.

Returns
  • the maximum height of the view

public int getMaxWidth ()

Gets the maximum width of the view.

Returns
  • the maximum width of the view

public int getTextColor ()

Gets the color used to render the view's content when it is text.

Returns
  • the color used to render the view's content when it is text

public float getTextSize ()

Gets the text size used to render the view's content when it is text.

Returns
  • the text size used to render the view's content when it is text

public void setContent (Object object)

Sets the content that is displayed by this view, changing the type of the internal view to render it correctly.

Parameters
object the content displayed in the view

public void setMaxHeight (int maxHeight)

Sets the maximum height of the view.

public void setMaxWidth (int maxWidth)

Sets the maximum width of the view.

Parameters
maxWidth the new maximum width of the view

public void setTextColor (int color)

Sets the color used to render the view's content when it is text.

Parameters
color the color used to render the view's content when it is text

public void setTextSize (float size)

Sets the text size used to render the view's content when it is text.

Parameters
size the text size used to render the view's content when it is text

public void setTextSize (int unit, float size)

Sets the text size used to render the view's content when it is text.

Parameters
unit the desired dimensional unit
size the text size used to render the view's content when it is text

Protected Methods

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)