Code example for RelativeLayout

Methods: getPaddingBottom, getPaddingLeft, getPaddingRight, setPadding

0
 
    /** 
     * Sets the header padding back to original size. 
     */ 
    private void resetHeaderPadding() { 
        mRefreshView.setPadding(mRefreshView.getPaddingLeft(), mRefreshOriginalTopPadding,
                mRefreshView.getPaddingRight(), mRefreshView.getPaddingBottom());
    } 
 
    /** 
     * Resets the header to the original state. 
     */ 
    private void resetHeader() { 
        if (mRefreshState != TAP_TO_REFRESH) {
            mRefreshState = TAP_TO_REFRESH;
 
            resetHeaderPadding(); 
 
            // Set refresh view text to the pull label 
            mRefreshViewText.setText(R.string.pull_to_refresh_tap_label);
            // Replace refresh drawable with arrow drawable