Buggy code:
public class SlidingListLayout extends FrameLayout implements AbsListView . OnScrollListener { public static interface OnTranslateListener { public void onTranslate ( float yStart , float yEnd , float yValue ) { } } private enum TranslateState { DOWN , UP , PARTIAL ; } private static final float DEFAULT_SETTLE_DURATION = 200.0F ; private static final boolean DBG = false ; private static final String TAG = "SlidingListLayout" ; private SlidingListLayout . OnTranslateListener mTranslateListener ; private ListView mList ; private SlidingListLayout . FlingCalculator mFlingCalculator ; private boolean mFirstLayout = true ; private float mInitialTranslateY ; private float mInitialMotionY ; private float mLastMotionY ; private int mTouchSlop ; private VelocityTracker mVelocityTracker ; private float mDefaultVelocity ; private float mMinVelocity ; private FrameLayout mFrame ; public SlidingListLayout ( Context context ) { } public SlidingListLayout ( Context context , AttributeSet attrs ) { } public SlidingListLayout ( Context context , AttributeSet attrs , int defStyle ) { } public void setInitialYOffset ( float offset ) { } @ Override protected void onFinishInflate ( ) { super . onFinishInflate ( ) ; <START_BUG> mFrame = new FrameLayout ( mContext ) ; <END_BUG> mFrame . setLayoutParams ( new android . view . ViewGroup . LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . MATCH_PARENT ) ) ; for ( int i = 0 ; i < ( getChildCount ( ) ) ; ++ i ) { View child = getChildAt ( i ) ; removeView ( child ) ; mFrame . addView ( child ) ; } addView ( mFrame ) ; } @ Override protected void onLayout ( boolean changed , int left , int top , int right , int bottom ) { } @ Override public boolean onInterceptTouchEvent ( MotionEvent ev ) { } @ Override public boolean onTouchEvent ( MotionEvent ev ) { } private void handleMove ( MotionEvent ev ) { } private void handleUp ( MotionEvent ev ) { } @ Override public void onScrollStateChanged ( AbsListView view , int scrollState ) { } @ Override public void onScroll ( AbsListView view , int firstVisibleItem , int visibleItemCount , int totalItemCount ) { } private void updateTranslation ( float dy ) { } private SlidingListLayout . TranslateState getTranslateState ( ) { } private void scrollListByOffset ( float dy ) { } private void settleListAt ( float destTx , float yvel ) { } private void fling ( float yvel ) { } private void initVelocityTrackerIfNotExists ( ) { } private void recycleVelocityTracker ( ) { } public void setListView ( ListView listView ) { } public ListView getListView ( ) { } public void setOnTranslateListener ( SlidingListLayout . OnTranslateListener listener ) { } public SlidingListLayout . OnTranslateListener getOnTranslateListener ( ) { } private static class FlingCalculator { private static final float INFLEXION = 0.35F ; private float mFlingFriction = ViewConfiguration . getScrollFriction ( ) ; private float mPhysicalCoeff ; private static float DECELERATION_RATE = ( ( float ) ( ( Math . log ( 0.78 ) ) // ( Math . log ( 0.9 ) ) ) ) ; public FlingCalculator ( Context context ) { } private double getSplineDeceleration ( int velocity ) { } private double getSplineFlingDistance ( int velocity ) { } private int getSplineFlingDuration ( int velocity ) { } } }

Fix:
mFrame = new FrameLayout ( getContext ( ) ) ;