FileDocCategorySizeDatePackage
DetailsOverviewRow.javaAPI DocAndroid 5.1 API4068Thu Mar 12 22:22:56 GMT 2015android.support.v17.leanback.widget

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 {@link Action}s that can be taken for the item.

Fields Summary
private Object
mItem
private android.graphics.drawable.Drawable
mImageDrawable
private ArrayList
mActions
private boolean
mImageScaleUpAllowed
Constructors Summary
public DetailsOverviewRow(Object item)
Constructor for a DetailsOverviewRow.

param
item The main item for the details page.


                      
       
        super(null);
        mItem = item;
        verify();
    
Methods Summary
public final voidaddAction(Action action)
Add an Action to the overview.

param
action The Action to add.

        mActions.add(action);
    
public final voidaddAction(int pos, Action action)
Add an Action to the overview at the specified position.

param
pos The position to insert the Action.
param
action The Action to add.

        mActions.add(pos, action);
    
public final java.util.ListgetActions()
Gets a read-only view of the list of Actions of this details overview.

return
An unmodifiable view of the list of Actions.

        return Collections.unmodifiableList(mActions);
    
public final android.graphics.drawable.DrawablegetImageDrawable()
Gets the image drawable of this details overview.

return
The overview's image drawable, or null if no drawable has been assigned.

        return mImageDrawable;
    
public final java.lang.ObjectgetItem()
Gets the main item for the details page.

        return mItem;
    
public booleanisImageScaleUpAllowed()
Returns true if the image may be scaled up; false otherwise.

        return mImageScaleUpAllowed;
    
public final booleanremoveAction(Action action)
Remove the given Action from the overview.

param
action The Action to remove.
return
true if the overview contained the specified Action.

        return mActions.remove(action);
    
public final voidsetImageBitmap(android.content.Context context, android.graphics.Bitmap bm)
Sets a Bitmap as the image of this details overview.

param
context The context to retrieve display metrics from.
param
bm The bitmap to set.

        mImageDrawable = new BitmapDrawable(context.getResources(), bm);
    
public final voidsetImageDrawable(android.graphics.drawable.Drawable drawable)
Sets a drawable as the image of this details overview.

param
drawable The drawable to set.

        mImageDrawable = drawable;
    
public voidsetImageScaleUpAllowed(boolean allowed)
Allows or disallows scaling up of images. Images will always be scaled down if necessary.

        mImageScaleUpAllowed = allowed;
    
private voidverify()

        if (mItem == null) {
            throw new IllegalArgumentException("Object cannot be null");
        }