FileDocCategorySizeDatePackage
UserDetailItemView.javaAPI DocAndroid 5.1 API4500Thu Mar 12 22:22:42 GMT 2015com.android.systemui.qs.tiles

UserDetailItemView

public class UserDetailItemView extends android.widget.LinearLayout
Displays one user in the {@link UserDetailView} view.

Fields Summary
private com.android.systemui.statusbar.phone.UserAvatarView
mAvatar
private android.widget.TextView
mName
private android.graphics.Typeface
mRegularTypeface
private android.graphics.Typeface
mActivatedTypeface
Constructors Summary
public UserDetailItemView(android.content.Context context)

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

        this(context, attrs, 0);
    
public UserDetailItemView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)

        this(context, attrs, defStyleAttr, 0);
    
public UserDetailItemView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)

        super(context, attrs, defStyleAttr, defStyleRes);
        final TypedArray a = context.obtainStyledAttributes(
                attrs, R.styleable.UserDetailItemView, defStyleAttr, defStyleRes);
        final int N = a.getIndexCount();
        for (int i = 0; i < N; i++) {
            int attr = a.getIndex(i);
            switch (attr) {
                case R.styleable.UserDetailItemView_regularFontFamily:
                    mRegularTypeface = Typeface.create(a.getString(attr), 0 /* style */);
                    break;
                case R.styleable.UserDetailItemView_activatedFontFamily:
                    mActivatedTypeface = Typeface.create(a.getString(attr), 0 /* style */);
                    break;
            }
        }
        a.recycle();
    
Methods Summary
public voidbind(java.lang.String name, android.graphics.Bitmap picture)

        mName.setText(name);
        mAvatar.setBitmap(picture);
    
public voidbind(java.lang.String name, android.graphics.drawable.Drawable picture)

        mName.setText(name);
        mAvatar.setDrawable(picture);
    
public static com.android.systemui.qs.tiles.UserDetailItemViewconvertOrInflate(android.content.Context context, android.view.View convertView, android.view.ViewGroup root)

        if (!(convertView instanceof UserDetailItemView)) {
            convertView = LayoutInflater.from(context).inflate(
                    R.layout.qs_user_detail_item, root, false);
        }
        return (UserDetailItemView) convertView;
    
protected voiddrawableStateChanged()

        super.drawableStateChanged();
        updateTypeface();
    
public booleanhasOverlappingRendering()

        return false;
    
protected voidonConfigurationChanged(android.content.res.Configuration newConfig)

        super.onConfigurationChanged(newConfig);
        FontSizeUtils.updateFontSize(mName, R.dimen.qs_detail_item_secondary_text_size);
    
protected voidonFinishInflate()

        mAvatar = (UserAvatarView) findViewById(R.id.user_picture);
        mName = (TextView) findViewById(R.id.user_name);
        if (mRegularTypeface == null) {
            mRegularTypeface = mName.getTypeface();
        }
        if (mActivatedTypeface == null) {
            mActivatedTypeface = mName.getTypeface();
        }
        updateTypeface();
    
private voidupdateTypeface()

        boolean activated = ArrayUtils.contains(getDrawableState(), android.R.attr.state_activated);
        mName.setTypeface(activated ? mActivatedTypeface : mRegularTypeface);