use of com.comcast.freeflow.layouts.FreeFlowLayout in project FreeFlow by Comcast.
the class FreeFlowContainerTest method testAllViewsAreGeneratedByFirstLayout.
/**
* Tests that all items are generated by the time predraw kicks in
*
* @throws InterruptedException
*/
public void testAllViewsAreGeneratedByFirstLayout() throws InterruptedException {
final CountDownLatch lock = new CountDownLatch(1);
main.runOnUiThread(new Runnable() {
@Override
public void run() {
final FreeFlowContainer container = new FreeFlowContainer(main);
DefaultSectionAdapter adapter = new DefaultSectionAdapter(main, 1, 2);
container.setAdapter(adapter);
VLayout vLayout = new VLayout();
vLayout.setLayoutParams(new VLayout.LayoutParams(300, 200, 10));
container.setLayout(vLayout);
container.addFreeFlowEventListener(new FreeFlowEventListener() {
@Override
public void onLayoutChanging(FreeFlowLayout oldLayout, FreeFlowLayout newLayout) {
}
@Override
public void layoutComputed() {
}
@Override
public void layoutComplete(boolean areTransitionAnimationsPlaying) {
assertEquals("Correct number of children were not created", 3, container.getChildCount());
}
@Override
public void dataChanged() {
}
@Override
public void animationsStarted() {
}
@Override
public void layoutChangeAnimationsComplete() {
}
});
main.setContentView(container);
}
});
lock.await(5000, TimeUnit.MILLISECONDS);
}
Aggregations