
org.robolectric.shadows.ShadowCompoundButton Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import android.graphics.drawable.Drawable;
import android.widget.CompoundButton;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;
import static org.robolectric.shadow.api.Shadow.*;
import static org.robolectric.util.ReflectionHelpers.ClassParameter.*;
@SuppressWarnings({"UnusedDeclaration"})
@Implements(CompoundButton.class)
public class ShadowCompoundButton extends ShadowTextView {
@RealObject CompoundButton realObject;
private int buttonDrawableId;
private Drawable buttonDrawable;
@Implementation
public void setButtonDrawable(int buttonDrawableId) {
this.buttonDrawableId = buttonDrawableId;
directlyOn(realObject, CompoundButton.class, "setButtonDrawable", from(int.class, buttonDrawableId));
}
@Implementation
public void setButtonDrawable(Drawable buttonDrawable) {
this.buttonDrawable = buttonDrawable;
directlyOn(realObject, CompoundButton.class, "setButtonDrawable", from(Drawable.class, buttonDrawable));
}
public int getButtonDrawableId() {
return buttonDrawableId;
}
public Drawable getButtonDrawable() {
return buttonDrawable;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy