use of com.jakewharton.rxbinding2.view.ViewScrollChangeEvent in project RxBinding by JakeWharton.
the class RxNestedScrollViewTest method scrollChangeEvents.
@Test
@UiThreadTest
public void scrollChangeEvents() {
RecordingObserver<ViewScrollChangeEvent> o = new RecordingObserver<>();
RxNestedScrollView.scrollChangeEvents(view).subscribe(o);
o.assertNoMoreEvents();
view.scrollTo(1000, 0);
ViewScrollChangeEvent event = o.takeNext();
assertSame(view, event.view());
assertEquals(1000, event.scrollX());
assertEquals(0, event.scrollY());
assertEquals(0, event.oldScrollX());
assertEquals(0, event.oldScrollY());
o.dispose();
view.scrollTo(2000, 0);
o.assertNoMoreEvents();
}
Aggregations