Program: 33432
Project: 33432
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  View view=getView();
  listView=(ListView)view.findViewById(R.id.list);
  LayoutInflater inflater=LayoutInflater.from(view.getContext());
  final View header=inflater.inflate(R.layout.view_flip_header,listView,false);
  final View footer=inflater.inflate(R.layout.view_flip_footer,listView,false);
  final ImageView largeView=(ImageView)view.findViewById(R.id.large);
  ImageButton createButton=(ImageButton)view.findViewById(R.id.create_button);
  listView.addHeaderView(header);
  listView.addFooterView(footer);
  listView.setAdapter(flipAdapter);
  bind(demo.getFlipVmm().get(flipId)).subscribe(flipAdapter);
  final PublishSubject<ImageViewModel> largeSource=PublishSubject.create();
  bind(largeSource.distinctUntilChanged().subscribe(new ImageView.Updater(largeView)));
  createButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      ((FlipActivity)getActivity()).startRecording();
    }
  }
);
  listView.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
    @Override public void onLayoutChange(    View v,    int left,    int top,    int right,    int bottom,    int oldLeft,    int oldTop,    int oldRight,    int oldBottom){
      targetHeight=bottom - top;
      if (targetHeight != header.getLayoutParams().height) {
        header.getLayoutParams().height=targetHeight;
        header.invalidate();
      }
      if (targetHeight != footer.getLayoutParams().height) {
        footer.getLayoutParams().height=targetHeight;
        footer.invalidate();
      }
    }
  }
);
  listView.setOnScrollListener(new AbsListView.OnScrollListener(){
    int scrollState=SCROLL_STATE_IDLE;
    boolean visible=false;
    int publishIndex=-1;
    void show(){
      if (!visible) {
        visible=true;
        largeView.setVisibility(View.VISIBLE);
      }
    }
    void hide(){
      if (visible) {
        visible=false;
        largeView.setVisibility(View.INVISIBLE);
      }
    }
    @Override public void onScrollStateChanged(    AbsListView view,    int scrollState){
      this.scrollState=scrollState;
    }
    @Override public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      if (publishLarge(firstVisibleItem,visibleItemCount)) {
        show();
      }
 else {
        hide();
      }
    }
    boolean publishLarge(    int firstVisibleItem,    int visibleItemCount){
      int index=indexOf(firstVisibleItem);
      if (0 <= index && 0 <= indexOf(firstVisibleItem + visibleItemCount - 1)) {
        publishLarge(index);
        return true;
      }
 else {
        return false;
      }
    }
    int indexOf(    int position){
      int index=position - listView.getHeaderViewsCount();
      if (index < 0 || flipAdapter.getCount() <= index) {
        return -1;
      }
      return index;
    }
    void publishLarge(    int index){
      if (publishIndex != index) {
        publishIndex=index;
        Id frameId=flipAdapter.getItem(index);
        largeSource.onNext(flipAdapter.flipVm.getFrameVm(frameId).imageVm);
      }
    }
  }
);
  updateHeaderIndefinitely(header,bind(demo.getFlipInfoVmm().get(flipId)));
  scrollToEnd();
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  View view=getView();
  listView=(ListView)view.findViewById(R.id.list);
  LayoutInflater inflater=LayoutInflater.from(view.getContext());
  final View header=inflater.inflate(R.layout.view_flip_header,listView,false);
  final View footer=inflater.inflate(R.layout.view_flip_footer,listView,false);
  final ImageView largeView=(ImageView)view.findViewById(R.id.large);
  ImageButton createButton=(ImageButton)view.findViewById(R.id.create_button);
  listView.addHeaderView(header);
  listView.addFooterView(footer);
  listView.setAdapter(flipAdapter);
  bind(demo.getFlipVmm().get(flipId)).subscribe(flipAdapter);
  final PublishSubject<ImageViewModel> largeSource=PublishSubject.create();
  bind(largeSource).distinctUntilChanged().subscribe(new ImageView.Updater(largeView));
  createButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      ((FlipActivity)getActivity()).startRecording();
    }
  }
);
  listView.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
    @Override public void onLayoutChange(    View v,    int left,    int top,    int right,    int bottom,    int oldLeft,    int oldTop,    int oldRight,    int oldBottom){
      targetHeight=bottom - top;
      if (targetHeight != header.getLayoutParams().height) {
        header.getLayoutParams().height=targetHeight;
        header.invalidate();
      }
      if (targetHeight != footer.getLayoutParams().height) {
        footer.getLayoutParams().height=targetHeight;
        footer.invalidate();
      }
    }
  }
);
  listView.setOnScrollListener(new AbsListView.OnScrollListener(){
    int scrollState=SCROLL_STATE_IDLE;
    boolean visible=false;
    int publishIndex=-1;
    void show(){
      if (!visible) {
        visible=true;
        largeView.setVisibility(View.VISIBLE);
      }
    }
    void hide(){
      if (visible) {
        visible=false;
        largeView.setVisibility(View.INVISIBLE);
      }
    }
    @Override public void onScrollStateChanged(    AbsListView view,    int scrollState){
      this.scrollState=scrollState;
    }
    @Override public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      if (publishLarge(firstVisibleItem,visibleItemCount)) {
        show();
      }
 else {
        hide();
      }
    }
    boolean publishLarge(    int firstVisibleItem,    int visibleItemCount){
      int index=indexOf(firstVisibleItem);
      if (0 <= index && 0 <= indexOf(firstVisibleItem + visibleItemCount - 1)) {
        publishLarge(index);
        return true;
      }
 else {
        return false;
      }
    }
    int indexOf(    int position){
      int index=position - listView.getHeaderViewsCount();
      if (index < 0 || flipAdapter.getCount() <= index) {
        return -1;
      }
      return index;
    }
    void publishLarge(    int index){
      if (publishIndex != index) {
        publishIndex=index;
        Id frameId=flipAdapter.getItem(index);
        largeSource.onNext(flipAdapter.flipVm.getFrameVm(frameId).imageVm);
      }
    }
  }
);
  updateHeaderIndefinitely(header,bind(demo.getFlipInfoVmm().get(flipId)));
  scrollToEnd();
}