use of com.jakewharton.rxbinding4.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();
}
use of com.jakewharton.rxbinding4.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.getView());
assertEquals(1000, event.getScrollX());
assertEquals(0, event.getScrollY());
assertEquals(0, event.getOldScrollX());
assertEquals(0, event.getOldScrollY());
o.dispose();
view.scrollTo(2000, 0);
o.assertNoMoreEvents();
}
Aggregations