Skip to content

Consolidate ChartScreen#51

Open
gemdev111 wants to merge 9 commits intomainfrom
charts-android
Open

Consolidate ChartScreen#51
gemdev111 wants to merge 9 commits intomainfrom
charts-android

Conversation

@gemdev111
Copy link
Copy Markdown
Contributor

@gemdev111 gemdev111 commented Apr 1, 2026

closes #27

  • Replace VICO chart library with custom GemLineChart + PulsingDot — scrubbing, area gradient, haptics, and
    optimized point reduction
  • Add ChartUIModel.from factory to build renderable chart points, min/max labels, and percentage logic
  • Revamp AssetChartScene composable with ChartHeader,GemLineChart, and updated loading/empty states
  • Update PeriodsPanel to use clickable chips with animated background + new ChipBadge composable
  • Add Asset.formatSupply (returns ∞ SYMBOL for zero supply)
  • Add periodic market sync (every 60s) in AssetChartViewModel
  • Switch market info list builders to listOfNotNull, add TradingVolume field
  • Add ChartMock test fixtures and update unit tests

images:

image image

Remove VICO-based chart implementation and introduce a custom GemLineChart + PulsingDot with scrubbing/selection, area gradient, haptics and optimized point reduction. Add ChartUIModel.from factory to build renderable ChartPoint list, min/max labels and percentage logic; update ChartViewModel to use the new factory and fix currency rate multiplication/casting. Revamp Chart composable to use ChartHeader, GemLineChart and updated loading/empty states. Update PeriodsPanel UI to use clickable chips with animated background. Add test fixtures (ChartMock) and update unit tests to cover new behavior (render points, min/max labels, percentage handling).
Replace mutable list builders with immutable listOfNotNull for marketItems, supplyItems and allTime to simplify construction and avoid mutation. Add TradingVolume to MarketInfoUIModel and include the trading volume item in market properties. Also move the contract item into marketItems and adjust badge formatting for market cap rank. These changes tidy up list creation and expose trading volume in the UI model.
Replace one-off sync flow with a continuous polling loop that syncs market info every minute. Asset ID flow is now filtered/mapped to non-null AssetId, and the sync flow emits Unit in a repeating coroutine using delay(DateUtils.MINUTE_IN_MILLIS). Updated imports (DateUtils, delay) and adjusted flowOn/stateIn initial value to Unit. This ensures regular background refresh of market data instead of a single sync.
Introduce a new ChipBadge composable (android/ui/src/main/kotlin/.../ChipBadge.kt) that displays a rounded, padded label using Material3 color/typography tokens. Update AssetChartScene to import and use ChipBadge in place of the previous Badge, and add necessary Material3/Text imports. This swaps the badge visual to the new chip-style presentation.
@gemdev111 gemdev111 self-assigned this Apr 1, 2026
Extract chartFrameHeight and dateRowHeight into a private ChartSceneMetrics object and update Chart to reference ChartSceneMetrics.frameHeight and .dateRowHeight. In PropertyItem, switch Arrangement.spacedBy from paddingMiddle to space4 and add the required import. These changes centralize chart layout metrics and align list item spacing with the UI theme.
@gemdev111 gemdev111 changed the title Charts android Consolidate ChartScreen Apr 1, 2026
Introduce Asset.formatSupply(value) which returns '∞ SYMBOL' for a zero supply and otherwise uses compactFormatter. Update AssetChartScene to use asset.compactFormatter for circulating/total supply and asset.formatSupply for max supply. Add unit tests (TestFormat.testFormatSupply) to verify infinity and numeric formatting.
@gemdev111 gemdev111 marked this pull request as ready for review April 2, 2026 12:33
@gemcoder21
Copy link
Copy Markdown
Contributor

Add periodic market sync (every 60s) in AssetChartViewModel

is no longer needed, because whenever there is a change in price it will trigger update by itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate charts screen with iOS

2 participants