Skip to content

Fix/reminder sheet swap scroll top#6362

Open
SeniorZhai wants to merge 7 commits intomasterfrom
fix/reminder-sheet-swap-scroll-top
Open

Fix/reminder sheet swap scroll top#6362
SeniorZhai wants to merge 7 commits intomasterfrom
fix/reminder-sheet-swap-scroll-top

Conversation

@SeniorZhai
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • selectPreferredFeeOption no longer preserves the currently selected fee option (via selectionKey). Since refreshFee() can be called multiple times and users can explicitly choose a fee in NetworkFeeBottomSheetDialogFragment, this change can unexpectedly reset the user’s selection on refresh. Consider reintroducing a parameter (or otherwise preferring currentFee/currentGaslessFee when still present in options) 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,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants