All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robolectric.shadows.LooperShadowPicker Maven / Gradle / Ivy

There is a newer version: 4.14
Show newest version
package org.robolectric.shadows;

import org.robolectric.annotation.LooperMode;
import org.robolectric.shadow.api.ShadowPicker;

public class LooperShadowPicker implements ShadowPicker {

  private Class legacyShadowClass;
  private Class pausedShadowClass;

  public LooperShadowPicker(
      Class legacyShadowClass, Class pausedShadowClass) {
    this.legacyShadowClass = legacyShadowClass;
    this.pausedShadowClass = pausedShadowClass;
  }

  @Override
  public Class pickShadowClass() {
    if (ShadowLooper.looperMode() == LooperMode.Mode.PAUSED) {
      return pausedShadowClass;
    } else {
      return legacyShadowClass;
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy