Code example for LinearLayout

Methods: getPaddingBottom, getPaddingLeft, getPaddingRight, setPadding

0
     * 
     * @param ev 
     */ 
    private void applyHeaderPadding(MotionEvent ev) {
        int topPadding = (int) (((ev.getY() - mLastMotionY) - mRefreshViewHeight) * 0.3f);
        mRefreshView.setPadding(mRefreshView.getPaddingLeft(), topPadding, mRefreshView.getPaddingRight(), mRefreshView.getPaddingBottom());
    } 
 
    /** 
     * フッタを伸縮する処理 
     * 
     * @param ev 
     */ 
    private void applyFooterPadding(MotionEvent ev) {
 
        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);
    }