1 package org.robolectric.shadows; 2 3 import static org.robolectric.shadow.api.Shadow.directlyOn; 4 5 import android.widget.BaseAdapter; 6 import org.robolectric.annotation.Implementation; 7 import org.robolectric.annotation.Implements; 8 import org.robolectric.annotation.RealObject; 9 10 @SuppressWarnings({"UnusedDeclaration"}) 11 @Implements(BaseAdapter.class) 12 public class ShadowBaseAdapter { 13 @RealObject private BaseAdapter realBaseAdapter; 14 private boolean wasNotifyDataSetChangedCalled; 15 16 @Implementation notifyDataSetChanged()17 protected void notifyDataSetChanged() { 18 wasNotifyDataSetChangedCalled = true; 19 directlyOn(realBaseAdapter, BaseAdapter.class, "notifyDataSetChanged"); 20 } 21 clearWasDataSetChangedCalledFlag()22 public void clearWasDataSetChangedCalledFlag() { 23 wasNotifyDataSetChangedCalled = false; 24 } 25 wasNotifyDataSetChangedCalled()26 public boolean wasNotifyDataSetChangedCalled() { 27 return wasNotifyDataSetChangedCalled; 28 } 29 } 30