Home | History | Annotate | Download | only in shadows
      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
     17   public void notifyDataSetChanged() {
     18     wasNotifyDataSetChangedCalled = true;
     19     directlyOn(realBaseAdapter, BaseAdapter.class, "notifyDataSetChanged");
     20   }
     21 
     22   public void clearWasDataSetChangedCalledFlag() {
     23     wasNotifyDataSetChangedCalled = false;
     24   }
     25 
     26   public boolean wasNotifyDataSetChangedCalled() {
     27     return wasNotifyDataSetChangedCalled;
     28   }
     29 }
     30