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

TitleView

public class TitleView extends android.widget.FrameLayout
Title view for a leanback fragment.
hide

Fields Summary
private android.widget.ImageView
mBadgeView
private android.widget.TextView
mTextView
private SearchOrbView
mSearchOrbView
Constructors Summary
public TitleView(android.content.Context context)

        this(context, null);
    
public TitleView(android.content.Context context, android.util.AttributeSet attrs)

        this(context, attrs, R.attr.browseTitleViewStyle);
    
public TitleView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)

        super(context, attrs, defStyleAttr);

        LayoutInflater inflater = LayoutInflater.from(context);
        View rootView = inflater.inflate(R.layout.lb_title_view, this);

        mBadgeView = (ImageView) rootView.findViewById(R.id.browse_badge);
        mTextView = (TextView) rootView.findViewById(R.id.browse_title);
        mSearchOrbView = (SearchOrbView) rootView.findViewById(R.id.browse_orb);

        setClipToPadding(false);
        setClipChildren(false);
    
Methods Summary
public voidenableAnimation(boolean enable)
Enables or disables any view animations.

        mSearchOrbView.enableOrbColorAnimation(enable && mSearchOrbView.hasFocus());
    
public android.graphics.drawable.DrawablegetBadgeDrawable()
Returns the badge drawable.

        return mBadgeView.getDrawable();
    
public SearchOrbView.ColorsgetSearchAffordanceColors()
Returns the {@link SearchOrbView.Colors} used to draw the search affordance.

        return mSearchOrbView.getOrbColors();
    
public android.view.ViewgetSearchAffordanceView()
Returns the view for the search affordance.

        return mSearchOrbView;
    
public java.lang.CharSequencegetTitle()
Returns the title text.

        return mTextView.getText();
    
public voidsetBadgeDrawable(android.graphics.drawable.Drawable drawable)
Sets the badge drawable. If non-null, the drawable is displayed instead of the title text.

        mBadgeView.setImageDrawable(drawable);
        if (drawable != null) {
            mBadgeView.setVisibility(View.VISIBLE);
            mTextView.setVisibility(View.GONE);
        } else {
            mBadgeView.setVisibility(View.GONE);
            mTextView.setVisibility(View.VISIBLE);
        }
    
public voidsetOnSearchClickedListener(View.OnClickListener listener)
Sets the listener to be called when the search affordance is clicked.

        mSearchOrbView.setOnOrbClickedListener(listener);
    
public voidsetSearchAffordanceColors(SearchOrbView.Colors colors)
Sets the {@link SearchOrbView.Colors} used to draw the search affordance.

        mSearchOrbView.setOrbColors(colors);
    
public voidsetTitle(java.lang.String titleText)
Sets the title text.

        mTextView.setText(titleText);