org.robolectric.shadows.LooperShadowPicker 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.
package org.robolectric.shadows;
import org.robolectric.annotation.LooperMode;
import org.robolectric.shadow.api.ShadowPicker;
public class LooperShadowPicker implements ShadowPicker {
private Class extends T> legacyShadowClass;
private Class extends T> pausedShadowClass;
public LooperShadowPicker(
Class extends T> legacyShadowClass, Class extends T> pausedShadowClass) {
this.legacyShadowClass = legacyShadowClass;
this.pausedShadowClass = pausedShadowClass;
}
@Override
public Class extends T> pickShadowClass() {
if (ShadowLooper.looperMode() == LooperMode.Mode.PAUSED) {
return pausedShadowClass;
} else {
return legacyShadowClass;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy