Fix/reminder sheet swap scroll top#6362
Open
SeniorZhai wants to merge 7 commits intomasterfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates several bottom-sheet and list UIs to improve scroll/height behavior, adds a debug trigger for the “new version” reminder, and standardizes some perps price displays to show USD-formatted prices.
Changes:
- Added “new update reminder” preview/debug hooks (strings + debug screen + reminder bottom sheet debug flag).
- Improved scroll-to-top behavior for the swap token list after filtering/loading.
- Adjusted reminder bottom-sheet layout to support a sticky footer and updated perps price formatting toward USD display.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Adds English debug strings for new update reminder preview/toast. |
| app/src/main/res/values-zh-rCN/strings.xml | Adds Simplified Chinese debug strings for new update reminder preview/toast. |
| app/src/main/res/layout/fragment_log_debug.xml | Wraps debug options in a scroll container and adds a “preview new update reminder” row. |
| app/src/main/java/one/mixin/android/web3/swap/SwapTokenListBottomSheetDialogFragment.kt | Adds a helper to reliably scroll the token list to the top after updates. |
| app/src/main/java/one/mixin/android/ui/wallet/TransactionInterface.kt | Clamps pending confirmation counts before plural formatting. |
| app/src/main/java/one/mixin/android/ui/wallet/InputFragment.kt | Changes preferred fee selection logic for network fees. |
| app/src/main/java/one/mixin/android/ui/wallet/adapter/SnapshotHolder.kt | Clamps pending confirmation counts for list items and progress display. |
| app/src/main/java/one/mixin/android/ui/setting/LogAndDebugFragment.kt | Adds click handler to trigger “new update reminder” debug show-once. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/PositionDetailPage.kt | Updates entry/close price display to use USD formatting helper. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/PerpsPositionShareActivity.kt | Updates displayed price formatting to USD symbol without fiat conversion. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/PerpsMarketListAdapter.kt | Shows market last price with USD symbol and without fiat conversion. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/PerpsMarketItem.kt | Shows market last price with USD symbol and adjusts volume symbol usage. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/PerpsMarketDetailPage.kt | Updates displayed market price and entry price formatting toward USD. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/PerpsFormat.kt | Introduces PERPS_USD_SYMBOL and USD-format helpers. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/PerpsConfirmBottomSheetDialogFragment.kt | Updates entry/liquidation formatting toward USD symbol without fiat conversion. |
| app/src/main/java/one/mixin/android/ui/home/web3/trade/perps/OpenPositionPage.kt | Updates “current price” and liquidation formatting to USD helpers and simplifies function signatures. |
| app/src/main/java/one/mixin/android/ui/home/reminder/VerifyMobileReminderBottomSheetDialogFragment.kt | Changes bottom sheet height calculation to use the measured view height. |
| app/src/main/java/one/mixin/android/ui/home/reminder/ReminderPage.kt | Refactors layout to support optional sticky footer behavior with scrollable content. |
| app/src/main/java/one/mixin/android/ui/home/reminder/ReminderBottomSheetDialogFragment.kt | Adds debug show-once preference for new version reminder and enables sticky footer mode. |
Comments suppressed due to low confidence (1)
app/src/main/java/one/mixin/android/ui/wallet/InputFragment.kt:1058
selectPreferredFeeOptionno longer preserves the currently selected fee option (viaselectionKey). SincerefreshFee()can be called multiple times and users can explicitly choose a fee inNetworkFeeBottomSheetDialogFragment, this change can unexpectedly reset the user’s selection on refresh. Consider reintroducing a parameter (or otherwise preferringcurrentFee/currentGaslessFeewhen still present inoptions) and only falling back to the first affordable option when the prior selection is unavailable.
private fun selectPreferredFeeOption(
options: List<NetworkFee>,
): NetworkFee? {
if (options.isEmpty()) return null
return options.firstOrNull { option ->
val balance = option.token.balance.toBigDecimalOrNull() ?: BigDecimal.ZERO
val feeAmount = option.fee.toBigDecimalOrNull() ?: BigDecimal.ZERO
balance >= feeAmount
} ?: options.first()
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+361
to
+367
| binding.assetRv.post { | ||
| binding.assetRv.stopScroll() | ||
| val layoutManager = binding.assetRv.layoutManager as? LinearLayoutManager | ||
| if (layoutManager != null) { | ||
| layoutManager.scrollToPositionWithOffset(0, 0) | ||
| } else { | ||
| binding.assetRv.scrollToPosition(0) |
| android:gravity="center_vertical" | ||
| android:paddingStart="@dimen/activity_horizontal_margin" | ||
| android:paddingEnd="@dimen/activity_horizontal_margin" | ||
| android:text="Safe" |
Comment on lines
812
to
816
| Text( | ||
| text = "${fiatSymbol}${entryPrice.multiply(fiatRate).priceFormat()}", | ||
| text = "$PERPS_USD_SYMBOL${entryPrice.priceFormat()}", | ||
| fontSize = 14.sp, | ||
| lineHeight = 17.sp, | ||
| style = compactTextStyle, |
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.