Closed JamesSmartCell closed 2 years ago
Task Update Jan 17, Monday:
Migrated to ViewPager2 in HomeActivity.
Current implementation uses custom ViewPager
called ScrollControlViewPager
which does 2 additional things:
lockPages(true)
. I think this is to disable user Touch input or swiping across pages. loadingFinished()
on adding last Page of homescreen. Page No = WalletPage().values.length
. I replicated the above 2 as follows:
viewPager2.setUserInputEnabled(false);
. Disables swiping. loadingFinished()
after that. Note: According to documentation, Its mandatory to create fragments in adapter instead of returning already existing instance. So instead of getItem()
updated code has createFragment()
.
ERC1155Activity
WIP
Task Update Jan 18, Tuesday:
Migrated to Viewpager2 in ERC20DetailActivity
and ERC1155Activity
.
Tested ERC20DetailActivity
.
Don't know how to test ERC1155Activity
but should work fine.
calling loadingfinished()
in adapter will cause crash if last fragment was settings. Moved loadingFinished()
to fragment attach listener when attached fragment is Settings fragment as its the last one to be added.
ImportWalletActivity
is crashing on migrating to ViewPager2 because fragments are not able to initialize the views.
Task Update Jan 19, Wednesday:
getView().findViewById()
instead of getActivity().findViewById()
in fragments. @JamesSmartCell, could you please go through the comments and let me know if the approach I used needs modifications? Also I apologize but I also migrated other usages. It got out of my mind that we just need to migrate main page. Should I revert others except main page?.
Migrate main page adapter (Wallet, Activities, DappBrowser, Settings) in HomeActivity to use ViewPager2, as ViewPager has been deprecated.
See the examples here:
https://developer.android.com/training/animation/screen-slide-2 https://www.geeksforgeeks.org/viewpager2-in-android-with-example/