Code example for FrameLayout

Methods: getHeight

0
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { 
            View topChild = view.getChildAt(0); 
            if (topChild == null) { 
                onNewScroll(0); 
            } else if (topChild != mMarginView) { 
                onNewScroll(mHeaderContainer.getHeight()); 
            } else { 
                onNewScroll(-topChild.getTop()); 
            } 
        } 
 
        @Override 
        public void onScrollStateChanged(AbsListView view, int scrollState) { 
        } 
    }; 
    private int mLastScrollPosition;
 
    private void onNewScroll(int scrollPosition) {
        if (mActionBar == null) {
            return; 
        } 
 
        int currentHeaderHeight = mHeaderContainer.getHeight();
        if (currentHeaderHeight != mLastHeaderHeight) {
            updateHeaderHeight(currentHeaderHeight);
        } 
 
        int headerHeight = currentHeaderHeight - mActionBar.getHeight();