/** * Map the attributes to use with DraggerView * * @param attrs Attributes to be mapped. */ public void initializeAttributes(AttributeSet attrs) { attributes = getContext().obtainStyledAttributes(attrs, R.styleable.dragger_layout); if (attributes != null) { draggerLimit = attributes.getFloat(R.styleable.dragger_layout_drag_limit, DEFAULT_DRAG_LIMIT); draggerPosition = attributes.getInt(R.styleable.dragger_layout_drag_position, DEFAULT_DRAG_POSITION); } }
/** * Apply all the custom view configuration and inflate the main view. The view won't be * visible if this method is not called. */ public void initializeView(int layoutId) { inflate(getContext(), layoutId, this); dragView = (FrameLayout) findViewById(R.id.drag_view); shadowView = (FrameLayout) findViewById(R.id.shadow_view); }