@Test public void testStraightOffsetting() throws Throwable { ((CurvingLayoutCallback) mWearableLinearLayoutManagerUnderTest.getLayoutCallback()) .setRound( false); final AtomicReference<WearableRecyclerView> wrvReference = new AtomicReference<>(); mActivityRule.runOnUiThread(new Runnable() { @Override public void run() { WearableRecyclerView wrv = (WearableRecyclerView) mActivityRule.getActivity().findViewById(R.id.wrv); wrv.setLayoutManager(mWearableLinearLayoutManagerUnderTest); wrvReference.set(wrv); } }); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); WearableRecyclerView wrv = wrvReference.get(); View child1 = wrv.getChildAt(0); View child2 = wrv.getChildAt(1); View child3 = wrv.getChildAt(2); View child4 = wrv.getChildAt(3); View child5 = wrv.getChildAt(4); assertEquals(0, child1.getLeft()); assertEquals(0.0f, child1.getTranslationY(), 0); assertEquals(0, child2.getLeft()); assertEquals(0.0f, child2.getTranslationY(), 0); assertEquals(0, child3.getLeft()); assertEquals(0.0f, child3.getTranslationY(), 0); assertEquals(0, child4.getLeft()); assertEquals(0.0f, child4.getTranslationY(), 0); if (child5 != null) { assertEquals(0, child5.getLeft()); assertEquals(0.0f, child5.getTranslationY(), 0); } }
@Nullable public LayoutCallback getLayoutCallback() { return mLayoutCallback; }
WearableLinearLayoutManager extends LinearLayoutManager { @Nullable public LayoutCallback getLayoutCallback() { return mLayoutCallback; } }
WearableLinearLayoutManager extends LinearLayoutManager { @Nullable public LayoutCallback getLayoutCallback() { return mLayoutCallback; } WearableLinearLayoutManager(Context context, LayoutCallback layoutCallback);  WearableLinearLayoutManager(Context context); }
WearableLinearLayoutManager extends LinearLayoutManager { @Nullable public LayoutCallback getLayoutCallback() { return mLayoutCallback; } WearableLinearLayoutManager(Context context, LayoutCallback layoutCallback);  WearableLinearLayoutManager(Context context); void setLayoutCallback(@Nullable LayoutCallback layoutCallback); @Nullable LayoutCallback getLayoutCallback(); @Override int scrollVerticallyBy(
            int dy, RecyclerView.Recycler recycler, RecyclerView.State state); @Override void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state); }
WearableLinearLayoutManager extends LinearLayoutManager { @Nullable public LayoutCallback getLayoutCallback() { return mLayoutCallback; } WearableLinearLayoutManager(Context context, LayoutCallback layoutCallback);  WearableLinearLayoutManager(Context context); void setLayoutCallback(@Nullable LayoutCallback layoutCallback); @Nullable LayoutCallback getLayoutCallback(); @Override int scrollVerticallyBy(
            int dy, RecyclerView.Recycler recycler, RecyclerView.State state); @Override void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state);  }