Search in sources :

Example 1 with DefaultItemAnimator

use of carbon.internal.DefaultItemAnimator in project Carbon by ZieIony.

the class ExpandableRecyclerView method initRecycler.

private void initRecycler(AttributeSet attrs, int defStyleAttr) {
    TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.RecyclerView, defStyleAttr, R.style.carbon_RecyclerView);
    for (int i = 0; i < a.getIndexCount(); i++) {
        int attr = a.getIndex(i);
        if (attr == R.styleable.RecyclerView_carbon_overScroll) {
            setOverScrollMode(a.getInt(attr, ViewCompat.OVER_SCROLL_ALWAYS));
        } else if (attr == R.styleable.RecyclerView_carbon_headerTint) {
            setHeaderTint(a.getColor(attr, 0));
        } else if (attr == R.styleable.RecyclerView_carbon_headerMinHeight) {
            setHeaderMinHeight((int) a.getDimension(attr, 0.0f));
        } else if (attr == R.styleable.RecyclerView_carbon_headerParallax) {
            setHeaderParallax(a.getFloat(attr, 0.0f));
        } else if (attr == R.styleable.RecyclerView_android_divider) {
            Drawable drawable = a.getDrawable(attr);
            float height = a.getDimension(R.styleable.RecyclerView_android_dividerHeight, 0);
            if (drawable != null && height > 0)
                setDivider(drawable, (int) height);
        }
    }
    Carbon.initTint(this, a, tintIds);
    a.recycle();
    setClipToPadding(false);
    setItemAnimator(new DefaultItemAnimator());
    setWillNotDraw(false);
}
Also used : TypedArray(android.content.res.TypedArray) Drawable(android.graphics.drawable.Drawable) RippleDrawable(carbon.drawable.ripple.RippleDrawable) Paint(android.graphics.Paint) DefaultItemAnimator(carbon.internal.DefaultItemAnimator)

Aggregations

TypedArray (android.content.res.TypedArray)1 Paint (android.graphics.Paint)1 Drawable (android.graphics.drawable.Drawable)1 RippleDrawable (carbon.drawable.ripple.RippleDrawable)1 DefaultItemAnimator (carbon.internal.DefaultItemAnimator)1