
org.robolectric.shadows.ShadowBaseAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shadows-framework Show documentation
Show all versions of shadows-framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import static org.robolectric.util.reflector.Reflector.reflector;
import android.widget.BaseAdapter;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;
import org.robolectric.util.reflector.Direct;
import org.robolectric.util.reflector.ForType;
@SuppressWarnings({"UnusedDeclaration"})
@Implements(BaseAdapter.class)
public class ShadowBaseAdapter {
@RealObject private BaseAdapter realBaseAdapter;
private boolean wasNotifyDataSetChangedCalled;
@Implementation
protected void notifyDataSetChanged() {
wasNotifyDataSetChangedCalled = true;
reflector(BaseAdapterReflector.class, realBaseAdapter).notifyDataSetChanged();
}
public void clearWasDataSetChangedCalledFlag() {
wasNotifyDataSetChangedCalled = false;
}
public boolean wasNotifyDataSetChangedCalled() {
return wasNotifyDataSetChangedCalled;
}
@ForType(BaseAdapter.class)
interface BaseAdapterReflector {
@Direct
void notifyDataSetChanged();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy