use of org.robolectric.shadows.ShadowView in project RoboBinding by RoboBinding.
the class ViewAddOnForViewTest method shouldSupportMultipleOnFocusChangeListeners.
@Test
public void shouldSupportMultipleOnFocusChangeListeners() {
MockOnFocusChangeListener listener1 = new MockOnFocusChangeListener();
MockOnFocusChangeListener listener2 = new MockOnFocusChangeListener();
viewAddOn.addOnFocusChangeListener(listener1);
viewAddOn.addOnFocusChangeListener(listener2);
ShadowView shadowView = Shadows.shadowOf(view);
shadowView.setViewFocus(!view.isFocused());
assertTrue(listener1.focusChangeEventFired);
assertTrue(listener2.focusChangeEventFired);
}
use of org.robolectric.shadows.ShadowView in project RoboBinding by RoboBinding.
the class OnFocusAttributeTest method setViewFocus.
private void setViewFocus() {
ShadowView shadowView = Shadows.shadowOf(view);
shadowView.setViewFocus(true);
}
use of org.robolectric.shadows.ShadowView in project RoboBinding by RoboBinding.
the class OnFocusLostAttributeTest method clearViewFocus.
private void clearViewFocus() {
ShadowView shadowView = Shadows.shadowOf(view);
shadowView.setViewFocus(false);
}
use of org.robolectric.shadows.ShadowView in project glide by bumptech.
the class ViewTargetTest method setUp.
@Before
public void setUp() {
view = new View(RuntimeEnvironment.application);
target = new TestViewTarget(view);
shadowView = (SizedShadowView) ShadowExtractor.extract(view);
shadowObserver = (PreDrawShadowViewTreeObserver) ShadowExtractor.extract(view.getViewTreeObserver());
}
use of org.robolectric.shadows.ShadowView in project RoboBinding by RoboBinding.
the class OnFocusChangeAttributeTest method changeViewFocus.
private void changeViewFocus() {
ShadowView shadowView = Shadows.shadowOf(view);
shadowView.setViewFocus(RandomValues.trueOrFalse());
}
Aggregations