Sofia API Reference

  • Package Index
  • Class Index
  • Packages
  • sofia.app
  • sofia.content
  • sofia.data
  • sofia.graphics
  • sofia.util
  • sofia.view
    • Interfaces
    • RotateGestureDetector.OnRotateGestureListener
    • Classes
    • FlexibleContentView
    • RotateGestureDetector
    • RotateGestureDetector.SimpleOnRotateGestureListener
  • sofia.widget

public class
FlexibleContentView

extends LinearLayout

Inheritance

  • java.lang.Object
    • 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

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)
Methods inherited from class java.lang.Object
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait()
final void wait(long arg0, int arg1)
final void wait(long arg0)

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)