Mercurial > dwindows
comparison android/DWindows.kt @ 2669:2ad924c6493d
Android: Still need to call setCurrentItem() on ViewPager2.
RecyclerView.scrollToPosition() doesn't update currentItem...
causing OutOfBounds exceptions when accessing the lists.
Need to implement the DW_SIGNAL_DELETE callback.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 17 Oct 2021 20:14:51 +0000 |
parents | 917f2d1f9cae |
children | e3a95940c18f |
comparison
equal
deleted
inserted
replaced
2668:917f2d1f9cae | 2669:2ad924c6493d |
---|---|
1419 // Switch the visible view in the pager | 1419 // Switch the visible view in the pager |
1420 if(adapter.recyclerView != null) { | 1420 if(adapter.recyclerView != null) { |
1421 adapter.recyclerView!!.scrollToPosition(index) | 1421 adapter.recyclerView!!.scrollToPosition(index) |
1422 } | 1422 } |
1423 // This is how I prefered to do it, but it doesn't work... | 1423 // This is how I prefered to do it, but it doesn't work... |
1424 // So using he RecyclerView.scrollToPosition() instead | 1424 // So using RecyclerView.scrollToPosition() also |
1425 //windowLayout!!.setCurrentItem(index, true) | 1425 windowLayout!!.setCurrentItem(index, true) |
1426 | 1426 |
1427 // If the new view has a default item, focus it | 1427 // If the new view has a default item, focus it |
1428 if(windowDefault[index] != null) { | 1428 if(windowDefault[index] != null) { |
1429 windowDefault[index]?.requestFocus() | 1429 windowDefault[index]?.requestFocus() |
1430 } | 1430 } |