DetailsOverviewRow
public
class
DetailsOverviewRow
extends Row
An overview Row for a details fragment. This row consists of an image, a
description view, and optionally a series of Actions that can be taken for
the item.
Actions
Application uses
setActionsAdapter(ObjectAdapter) to set actions on the overview
row.
SparseArrayObjectAdapter is recommended for easily updating actions while
maintaining the order. The application can add or remove actions on the UI thread after the
row is bound to a view.
Updating main item
After the row is bound to a view, the application may call
setItem(Object)
on UI thread and the view will be updated.
Updating image
After the row is bound to view, the application may change the image by calling
setImageBitmap(Context, Bitmap) or
setImageDrawable(Drawable) on the UI thread,
and the view will be updated.
Summary
Nested classes |
class |
DetailsOverviewRow.Listener
Listener for changes of DetailsOverviewRow.
|
Inherited methods |
|
|
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(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
DetailsOverviewRow
public DetailsOverviewRow (Object item)
Constructor for a DetailsOverviewRow.
| Parameters |
item |
Object: The main item for the details page.
|
Public methods
public final void addAction (int pos,
Action action)
This method is deprecated.
Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()
Adds an Action to the overview at the specified position. It will throw ClassCastException if
current actions adapter is not an instance of fArrayObjectAdapter. Must be called
on the UI thread.
| Parameters |
pos |
int: The position to insert the Action. |
action |
Action: The Action to add. |
getActionForKeyCode
public Action getActionForKeyCode (int keyCode)
Returns the Action associated with the given keycode, or null if no associated action exists.
getImageDrawable
public final Drawable getImageDrawable ()
Returns the image drawable of this details overview.
| Returns |
Drawable |
The overview's image drawable, or null if no drawable has been
assigned.
|
getItem
public final Object getItem ()
Returns the main item for the details page.
isImageScaleUpAllowed
public boolean isImageScaleUpAllowed ()
Returns true if the image may be scaled up; false otherwise.
public final boolean removeAction (Action action)
This method is deprecated.
Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()
Removes the given Action from the overview. It will throw ClassCastException if current
actions adapter is not ArrayObjectAdapter. Must be called on UI thread.
| Parameters |
action |
Action: The Action to remove. |
| Returns |
boolean |
true if the overview contained the specified Action. |
public final void setActionsAdapter (ObjectAdapter adapter)
Sets the ObjectAdapter for actions. A default PresenterSelector will be
attached to the adapter if it doesn't have one.
| Parameters |
adapter |
ObjectAdapter: Adapter for actions.
|
setImageBitmap
public final void setImageBitmap (Context context,
Bitmap bm)
Sets a Bitmap as the image of this details overview. Must be called on UI thread
after row is bound to view.
| Parameters |
context |
Context: The context to retrieve display metrics from. |
bm |
Bitmap: The bitmap to set.
|
setImageDrawable
public final void setImageDrawable (Drawable drawable)
Sets a drawable as the image of this details overview. Must be called on UI thread
after row is bound to view.
| Parameters |
drawable |
Drawable: The drawable to set.
|
setImageScaleUpAllowed
public void setImageScaleUpAllowed (boolean allowed)
Allows or disallows scaling up of images.
Images will always be scaled down if necessary. Must be called on UI thread
after row is bound to view.
| Parameters |
allowed |
boolean |
setItem
public final void setItem (Object item)
Sets the main item for the details page. Must be called on UI thread after
row is bound to view.
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.