Code example for LinearLayout

Methods: getPaddingLeft, getPaddingRight, getPaddingTop, setPadding

0
 
        int bottomPadding = (int) ((-(ev.getY() - mLastMotionY) - mRefreshViewFTHeight) * 0.3f);
//        Log.d("junapp2", "bottomPadding:" + bottomPadding); 
//        Log.d("junapp2", "getY:" + ev.getY()); 
//        Log.d("junapp2", "lastY:" + mLastMotionY); 
        mRefreshViewFT.setPadding(mRefreshViewFT.getPaddingLeft(), mRefreshViewFT.getPaddingTop(), mRefreshViewFT.getPaddingRight(), bottomPadding);
    } 
 
    /** 
     * ヘッダのPadding値を初期状態に戻します。 
     */ 
    private void resetHeaderPadding() { 
        mRefreshView.setPadding(mRefreshView.getPaddingLeft(), mRefreshOriginalTopPadding, mRefreshView.getPaddingRight(), mRefreshOriginalBottomPadding);
    } 
 
    /** 
     * フッタのPadding値を初期状態に戻します。 
     */ 
    private void resetFooterPadding() { 
        mRefreshViewFT.setPadding(mRefreshViewFT.getPaddingLeft(), mRefreshFTOriginalTopPadding, mRefreshViewFT.getPaddingRight(), mRefreshFTOriginalBottomPadding);
    }