AlphaWallet / alpha-wallet-android

An advanced Ethereum mobile wallet
https://www.alphawallet.com
MIT License
597 stars 529 forks source link

Migrate Paging to ViewPager2 #2218

Closed JamesSmartCell closed 2 years ago

JamesSmartCell commented 2 years ago

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/

asif-finimble commented 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:

I replicated the above 2 as follows:

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

asif-finimble commented 2 years ago

Task Update Jan 18, Tuesday:
Migrated to Viewpager2 in ERC20DetailActivity and ERC1155Activity.

asif-finimble commented 2 years ago

Task Update Jan 19, Wednesday:

@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?.