Skip to content

Conversation

@JosephSanjaya
Copy link
Contributor

📱 Description

This PR refines the Bento main screen's interaction model, integrates the Send screen into a bottom-sheet workflow, enhances balance and currency handling, and restructures several components for clearer state management and modularity. It also introduces a flexible override mechanism for the Send screen’s close action.

Platform

  • Android
  • iOS
  • Games-Unity
  • DevOps (AWS)
  • Website
  • C/Golang

🎯 Type of Change

  • ✨ New feature
  • 🔧 Refactoring
  • 🎨 UI/UX improvement
  • 🐛 Bug fix
  • 📚 Documentation update
  • ⚡ Performance improvement
  • 🧪 Test addition or improvement

📋 Changes

✨ Send Screen Integration & Bottom Sheet Improvements

  • Integrated FragmentSend into the Bento experience via a ModalBottomSheet.
  • Replaced full-screen navigation with bottom-sheet presentation.
  • Updated BentoActivity to extend FragmentActivity to support fragment-backed bottom sheets.
  • Introduced SheetType enum (DISMISSED, RECEIVE, SEND) in BentoMainScreenState to manage sheet state and content switching.
  • Removed legacy animation logic (slide-in, dim) from FragmentSend; relies on standard bottom-sheet behaviors.
  • Updated the Send screen’s close button to use onBackPressed() via the activity's handler.

✨ Balance Toggle Between LTC and Fiat

  • Implemented tap-to-toggle behavior for the main balance display.
  • Allows switching between LTC and selected fiat currency.
  • Removed navigation-related click handling from BalanceBentoGrid; now handled at a higher level.
  • Introduced CurrentCurrencyStateFlow to observe and react to currency selection changes.

🔧 Price Ticker Refactor & State Improvements

  • Extracted ticker logic into PriceTickerStateFlow and PriceTickerStateFlowImpl, providing real exchange rate data.
  • Added PriceTickerGridUiState for dedicated UI state management.
  • Updated PriceTickerGrid to display only the ticker for the currently selected currency (no more pager of multiple pairs).
  • Moved PriceTickerGrid and TransactionHistoryGrid plus their state classes into dedicated sub-packages for clearer structure.

✨ FragmentSend Close Behavior Override

  • Added overrideOnCloseClicked to allow parent components to supply a custom close action.
  • Utilized by BentoMainScreen to correctly dismiss the bottom sheet when Send is opened inside it.

🔗 Related Issues

  • Fixes #
  • Related to #

🧪 Tests Status

  • Tests ran successfully locally
  • Added more tests
  • Code coverage percentage of the codebase: __%

🎯 Reviewers

@kcw-grunt, @josikie

This commit introduces several key changes to the Bento main screen and related components:

- **Integrates `FragmentSend`**: The "Send" functionality is now displayed within a `ModalBottomSheet` on the Bento main screen, replacing the previous full-screen fragment navigation. `BentoActivity` now extends `FragmentActivity` to support this.
- **Improves `BentoMainScreenState`**: A `SheetType` enum (`DISMISSED`, `RECEIVE`, `SEND`) is introduced to manage the state of the bottom sheet, allowing it to display different content (Send, Receive) or be dismissed.
- **Refactors Price Ticker**:
    - The price ticker logic is extracted into a `PriceTickerStateFlow` and its implementation, `PriceTickerStateFlowImpl`. This provides real exchange rate data instead of hardcoded values.
    - `PriceTickerGrid` now uses a dedicated `PriceTickerGridUiState` to manage its state, consuming data from the new flow.
- **Removes old animation logic**: The custom slide and dim animations in `FragmentSend` have been removed in favor of the standard `ModalBottomSheet` behavior. The close button now uses the activity's back press handler.
This commit introduces the ability for users to tap on their balance to toggle the display between Litecoin (LTC) and their selected fiat currency.

Key changes:
*   The main balance display is now clickable, allowing users to switch between the LTC and fiat currency values.
*   The `BalanceBentoGrid` no longer handles navigation clicks; this responsibility is now managed at a higher level.
*   A new `CurrentCurrencyStateFlow` has been introduced to observe changes in the user's selected currency.
*   The `PriceTickerGrid` has been updated to display the price ticker that corresponds to the currently selected currency, instead of showing a pager for all available pairs.
*   The `PriceTickerGrid` and `TransactionHistoryGrid` components and their associated state management have been moved into their own sub-packages for better organization.
This change introduces the ability to override the default "close" button action in the `FragmentSend` screen.

Previously, the close button was hardcoded to trigger `onBackPressed()`. Now, a new `overrideOnCloseClicked` function allows parent components, like the `BentoMainScreen`, to provide a custom callback. This is used to correctly dismiss the bottom sheet when the send fragment is presented within it.
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