mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-26 14:35:42 +00:00
b51e2ecf58
Tapping Swap on the Bridge screen previously gave zero feedback afterward - the same countdown/success UX already used for swap execution didn't exist here, so a user had no way to tell whether anything was happening. Moved ExecutionTimerView (+ its layout) from feature-swap-impl to common, since it was already fully self-contained (no swap-specific coupling, all its resources already lived in common) - both features now share the one component instead of duplicating it. Wired into BridgeViewModel: after a swap is submitted, actively observe the destination balance (walletInteractor.assetFlow) for a real increase within a bounded window, showing the countdown while watching and Success only on a confirmed balance delta - never a cosmetic timer that "completes" regardless of whether funds arrived. If the window elapses without confirmation, it says so plainly (may need manual 3-of-5 review) rather than showing a false success or a false error.
68 lines
3.0 KiB
XML
68 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:clipChildren="false"
|
|
tools:background="@color/secondary_screen_background"
|
|
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
|
|
|
<View
|
|
android:id="@+id/executionBackground"
|
|
android:layout_width="64dp"
|
|
android:layout_height="64dp"
|
|
android:background="@drawable/bg_container_with_border_circle"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
|
<ImageView
|
|
android:id="@+id/executionProgress"
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
android:src="@drawable/ic_container_timer_animated"
|
|
app:layout_constraintBottom_toBottomOf="@+id/executionBackground"
|
|
app:layout_constraintEnd_toEndOf="@+id/executionBackground"
|
|
app:layout_constraintStart_toStartOf="@+id/executionBackground"
|
|
app:layout_constraintTop_toTopOf="@+id/executionBackground" />
|
|
|
|
<ImageView
|
|
android:id="@+id/executionResult"
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
android:src="@drawable/ic_execution_result_success"
|
|
android:visibility="gone"
|
|
app:layout_constraintBottom_toBottomOf="@+id/executionBackground"
|
|
app:layout_constraintEnd_toEndOf="@+id/executionBackground"
|
|
app:layout_constraintStart_toStartOf="@+id/executionBackground"
|
|
app:layout_constraintTop_toTopOf="@+id/executionBackground" />
|
|
|
|
<TextSwitcher
|
|
android:id="@+id/executionTimeSwitcher"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:minHeight="20dp"
|
|
android:textColor="@color/text_primary"
|
|
app:layout_constraintBottom_toTopOf="@+id/executionTimeSeconds"
|
|
app:layout_constraintEnd_toEndOf="@+id/executionProgress"
|
|
app:layout_constraintStart_toStartOf="@+id/executionProgress"
|
|
app:layout_constraintTop_toTopOf="@+id/executionProgress"
|
|
app:layout_constraintVertical_chainStyle="packed" />
|
|
|
|
<TextView
|
|
android:id="@+id/executionTimeSeconds"
|
|
style="@style/TextAppearance.NovaFoundation.Regular.Caption1"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:includeFontPadding="false"
|
|
android:text="@string/common_sec"
|
|
android:textColor="@color/text_secondary"
|
|
app:layout_constraintBottom_toBottomOf="@+id/executionProgress"
|
|
app:layout_constraintEnd_toEndOf="@+id/executionProgress"
|
|
app:layout_constraintStart_toStartOf="@+id/executionProgress"
|
|
app:layout_constraintTop_toBottomOf="@+id/executionTimeSwitcher" />
|
|
|
|
</merge>
|