Saturday, 1 September 2018

WearableRecyclerView .scrollToPosition not working for wear?

I have a set of items which should be populated in the list, for that I have used WearableRecyclerView. In some cases I want particular items to be in focus for selection. I am using scrollToPosition() method of WearableLinearLayoutManager but watch list do not scroll to the desired position, But the same thing on a mobile phone using RecyclerView and scrollToPosition() of LinearLayoutManager which is set to the RecyclerView working and scrolling to the desired position.

My code for wear watch:

    WearableRecyclerView slots_rv = findViewById(R.id.slots_rv);
 .....


        WearableLinearLayoutManager wearableLinearLayoutManager =
                new WearableLinearLayoutManager(this, customScrollingLayoutCallback);
        slots_rv.setLayoutManager(
                new WearableLinearLayoutManager(this, customScrollingLayoutCallback));
        slots_rv.setCircularScrollingGestureEnabled(true);
        wearableLinearLayoutManager.scrollToPosition(slotsAdapter.getPositionToFocus());
        slots_rv.setAdapter(slotsAdapter);

What may go wrong here?



from WearableRecyclerView .scrollToPosition not working for wear?

No comments:

Post a Comment