feat(wallet): revamp wallet home UI and support interactions#6426
Open
SeniorZhai wants to merge 66 commits into
Open
feat(wallet): revamp wallet home UI and support interactions#6426SeniorZhai wants to merge 66 commits into
SeniorZhai wants to merge 66 commits into
Conversation
792a29b to
a509f59
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR revamps the wallet home experience by introducing a Compose-based “card” layout (balance, banners, tokens, transactions, positions/top movers, referral, support) and adding an “All Tokens” page, alongside data plumbing (DAO/repository/view-model methods) and localized strings/assets needed for the new UI.
Changes:
- Add Compose wallet home framework (state, builder, card components, RecyclerView interop) and integrate it into Privacy and Classic wallet fragments with lightweight caching.
- Add a dedicated “All Tokens” screen + navigation/activity destinations for privacy and web3 wallets.
- Extend repositories/DAOs/view-models to support preview-limited token/transaction queries and referral status checks; add new localized strings and drawable assets.
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/test/java/one/mixin/android/ui/wallet/home/WalletHomeBuilderTest.kt | Adds unit tests for wallet home card ordering and preview limits. |
| app/src/main/res/values/strings.xml | Adds wallet-home UI strings (EN) and help-center URL. |
| app/src/main/res/values-zh-rTW/strings.xml | Adds wallet-home UI strings (zh-TW) and help-center URL. |
| app/src/main/res/values-zh-rCN/strings.xml | Adds wallet-home UI strings (zh-CN) and help-center URL. |
| app/src/main/res/navigation/nav_wallet.xml | Adds navigation destination for the “All Tokens” fragment. |
| app/src/main/res/layout/item_wallet_asset.xml | Updates wallet asset row sizing/alignment for new layouts. |
| app/src/main/res/layout/fragment_wallet_home_all_tokens.xml | New layout hosting a title bar and ComposeView for All Tokens. |
| app/src/main/res/layout/fragment_privacy_wallet.xml | Wraps existing RecyclerView and adds ComposeView for new home UI. |
| app/src/main/res/drawable/ic_wallet_home_referral.xml | New referral icon asset for wallet home. |
| app/src/main/res/drawable/ic_wallet_home_referral_gift.xml | Adds additional referral-related icon asset. |
| app/src/main/res/drawable/ic_wallet_home_help_center.xml | Adds help-center icon asset. |
| app/src/main/res/drawable/ic_wallet_home_fund.xml | Adds empty-state “fund wallet” icon asset. |
| app/src/main/res/drawable/ic_wallet_home_external_link.xml | Adds external-link icon asset for support/help items. |
| app/src/main/res/drawable/ic_wallet_home_buy.xml | Adds buy/cashback banner icon asset. |
| app/src/main/res/drawable/ic_wallet_home_add.xml | Adds add-wallet banner icon asset. |
| app/src/main/res/drawable/ic_wallet_close.xml | Adds close icon used by banners. |
| app/src/main/res/drawable/ic_wallet_arrow_right.xml | Adjusts arrow tint to match updated UI palette. |
| app/src/main/res/drawable/bg_wallet_reffal.xml | Adds referral banner background art. |
| app/src/main/java/one/mixin/android/vo/SnapshotItem.kt | Fixes serialized name mapping for collection_hash. |
| app/src/main/java/one/mixin/android/ui/wallet/WalletViewModel.kt | Adds referral check + preview-limited token/snapshot methods for home UI. |
| app/src/main/java/one/mixin/android/ui/wallet/WalletHomeAllTokensFragment.kt | New fragment implementing All Tokens UI + actions for privacy/web3. |
| app/src/main/java/one/mixin/android/ui/wallet/WalletActivity.kt | Adds destinations and intent wiring for All Tokens screens. |
| app/src/main/java/one/mixin/android/ui/wallet/PrivacyWalletFragment.kt | Integrates Compose wallet home, caching, and new section data sources. |
| app/src/main/java/one/mixin/android/ui/wallet/home/WalletHomeState.kt | Introduces wallet home state model + callback interface for Compose UI. |
| app/src/main/java/one/mixin/android/ui/wallet/home/WalletHomeSection.kt | Adds preview count/“has more” helpers and limits. |
| app/src/main/java/one/mixin/android/ui/wallet/home/WalletHomeRecyclerInterop.kt | Adds RecyclerView interop composables for token/tx/position lists. |
| app/src/main/java/one/mixin/android/ui/wallet/home/WalletHomePage.kt | Adds top-level Compose page renderer for wallet home cards. |
| app/src/main/java/one/mixin/android/ui/wallet/home/WalletHomeItem.kt | Adds enums for wallet home types and card types. |
| app/src/main/java/one/mixin/android/ui/wallet/home/WalletHomeCache.kt | Adds shared-preferences cache for quick wallet home initial rendering. |
| app/src/main/java/one/mixin/android/ui/wallet/home/WalletHomeBuilder.kt | Adds card ordering builder logic used by wallet home and cache. |
| app/src/main/java/one/mixin/android/ui/wallet/home/components/WalletHomeCard.kt | Implements per-card rendering and section wrappers. |
| app/src/main/java/one/mixin/android/ui/wallet/home/components/WalletHomeAllTokensPage.kt | Implements Compose All Tokens page (balance header + full list). |
| app/src/main/java/one/mixin/android/ui/wallet/home/components/SupportAndFooter.kt | Implements support card + import-safety footer content. |
| app/src/main/java/one/mixin/android/ui/wallet/home/components/SectionCard.kt | Implements reusable section header + “view all” row. |
| app/src/main/java/one/mixin/android/ui/wallet/home/components/BannerCards.kt | Implements banner pager and referral banner card UI. |
| app/src/main/java/one/mixin/android/ui/wallet/home/components/BalanceCard.kt | Implements balance card and empty guide UI/actions. |
| app/src/main/java/one/mixin/android/ui/wallet/ClassicWalletFragment.kt | Integrates Compose wallet home for web3/classic wallet, caching, and previews. |
| app/src/main/java/one/mixin/android/ui/home/web3/Web3ViewModel.kt | Adds referral check + preview-limited token/transaction accessors. |
| app/src/main/java/one/mixin/android/ui/home/MainActivity.kt | Makes handlerCode public (visibility change). |
| app/src/main/java/one/mixin/android/repository/Web3Repository.kt | Adds top tokens + recent transactions loader with token symbol enrichment. |
| app/src/main/java/one/mixin/android/repository/TokenRepository.kt | Adds recent snapshots and top token queries for wallet home previews. |
| app/src/main/java/one/mixin/android/repository/ReferralRepository.kt | Adds API call to determine whether user has been invited (for referral banner). |
| app/src/main/java/one/mixin/android/db/web3/Web3TransactionDao.kt | Adds DAO query for recent web3 transactions (limited). |
| app/src/main/java/one/mixin/android/db/web3/Web3TokenDao.kt | Adds DAO query for top web3 tokens (limited). |
| app/src/main/java/one/mixin/android/db/TokenDao.kt | Adds DAO query for top non-hidden tokens (limited). |
| app/src/main/java/one/mixin/android/db/SafeSnapshotDao.kt | Adds DAO query for recent snapshots across assets (limited). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| private val walletId by lazy { requireArguments().getString(ARGS_WALLET_ID).orEmpty() } | ||
| private val _walletId = MutableLiveData<String>() | ||
| private val homeState = MutableStateFlow(WalletHomeState(walletType = WalletHomeType.PRIVACY)) |
Comment on lines
+162
to
+165
| <fragment | ||
| android:id="@+id/wallet_home_all_tokens_fragment" | ||
| android:name="one.mixin.android.ui.wallet.WalletHomeAllTokensFragment" | ||
| tools:layout="@layout/fragment_compose" /> |
Comment on lines
7
to
11
| <RelativeLayout | ||
| android:id="@+id/background_rl" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="84dp" | ||
| android:layout_height="match_parent" | ||
| android:background="@color/wallet_green"> |
Comment on lines
+186
to
+188
| Image( | ||
| painter = painterResource(id = R.drawable.bg_wallet_reffal), | ||
| contentDescription = null, |
Comment on lines
+38
to
+43
| Column( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
| .background(MixinAppTheme.colors.backgroundWindow) | ||
| .verticalScroll(rememberScrollState()), | ||
| ) { |
Comment on lines
+62
to
+72
| private fun WalletHomeCache.toState(): WalletHomeState { | ||
| val cards = WalletHomeBuilder.build( | ||
| walletType = walletType, | ||
| hasAssetValue = true, | ||
| showBanner = false, | ||
| showReferral = false, | ||
| hasPositions = false, | ||
| hasTopMovers = false, | ||
| hasTransactions = totalTransactionCount > 0, | ||
| isLoading = false, | ||
| ) |
9faae78 to
91da276
Compare
91da276 to
c209609
Compare
…t/wallet-home-revamp
11401b3 to
4994d39
Compare
e9f5a2a to
15b1670
Compare
ca5b26e to
f27ca40
Compare
2e12716 to
0528cac
Compare
1a523f3 to
0cd9cdc
Compare
Render the all-tokens list with a LazyColumn so only visible rows compose instead of eagerly composing the entire token list, and drop the redundant one-shot raw query on entry, relying on the LiveData observer to avoid a duplicate full-table join and sort.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.