Code example for TypedArray

Methods: getBoolean, getDimensionPixelSize, getDrawable, getInt, recycle

0
	public IcsLinearLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
 
        TypedArray a = context.obtainStyledAttributes(attrs, /*com.android.internal.R.styleable.*/R_styleable_LinearLayout);
 
        setDividerDrawable(a.getDrawable(/*com.android.internal.R.styleable.*/LinearLayout_divider));
        mShowDividers = a.getInt(/*com.android.internal.R.styleable.*/LinearLayout_showDividers, SHOW_DIVIDER_NONE);
        mDividerPadding = a.getDimensionPixelSize(/*com.android.internal.R.styleable.*/LinearLayout_dividerPadding, 0);
        mUseLargestChild = a.getBoolean(/*com.android.internal.R.styleable.*/LinearLayout_measureWithLargestChild, false);
 
        a.recycle();
    } 
 
    /** 
     * Set how dividers should be shown between items in this layout 
     * 
     * @param showDividers One or more of {@link #SHOW_DIVIDER_BEGINNING}, 
     *                     {@link #SHOW_DIVIDER_MIDDLE}, or {@link #SHOW_DIVIDER_END}, 
     *                     or {@link #SHOW_DIVIDER_NONE} to show no dividers. 
     */ 
    public void setShowDividers(int showDividers) {