Code example for LinearLayout

Methods: getPaddingBottom, getPaddingLeft, getPaddingRight, invalidate, setPadding

0
                }   
                 
                // 更新headView的size    
                if (state == PULL_To_REFRESH) { 
                	int topPadding = (int)((-1 * headContentHeight + (tempY - startY)));
                	headView.setPadding(headView.getPaddingLeft(), topPadding, headView.getPaddingRight(), headView.getPaddingBottom());   
                    headView.invalidate();  
                    //System.out.println("当前-下拉刷新PULL_To_REFRESH-TopPad:"+topPadding); 
                }   
   
                // 更新headView的paddingTop    
                if (state == RELEASE_To_REFRESH) {  
                	int topPadding = (int)((tempY - startY - headContentHeight));
                	headView.setPadding(headView.getPaddingLeft(), topPadding, headView.getPaddingRight(), headView.getPaddingBottom());    
                    headView.invalidate();  
                    //System.out.println("当前-释放刷新RELEASE_To_REFRESH-TopPad:"+topPadding); 
                }   
            }   
            break;   
        }   
        return super.onTouchEvent(event);