305 lines
13 KiB
XML
305 lines
13 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<FrameLayout
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="?attr/colorSurface">
|
|
|
|
<!-- Main content when cards exist -->
|
|
<LinearLayout
|
|
android:id="@+id/contentLayout"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:orientation="vertical"
|
|
android:visibility="gone">
|
|
|
|
<!-- Manage Card button row -->
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="end"
|
|
android:paddingHorizontal="12dp"
|
|
android:paddingTop="4dp">
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnManageCard"
|
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:minWidth="0dp"
|
|
android:minHeight="0dp"
|
|
android:text="@string/card_manage"
|
|
android:textSize="12sp"
|
|
app:icon="@drawable/ic_manage_card"
|
|
app:iconSize="20dp"
|
|
app:iconPadding="4dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
<!-- Top spacer: pushes card to vertical center (hidden in manage mode) -->
|
|
<View
|
|
android:id="@+id/topSpacer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:layout_weight="1" />
|
|
|
|
<!-- Manage mode: selected card with overlays -->
|
|
<include
|
|
android:id="@+id/manageCardView"
|
|
layout="@layout/item_card_stack"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginHorizontal="16dp"
|
|
android:layout_marginTop="8dp"
|
|
android:visibility="gone" />
|
|
|
|
<!-- Horizontal card stack. Width/padding set programmatically for centering + peek. -->
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/rvCards"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:clipToPadding="false"
|
|
android:overScrollMode="never" />
|
|
|
|
<!-- Page indicator dots -->
|
|
<LinearLayout
|
|
android:id="@+id/pageIndicator"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_horizontal"
|
|
android:orientation="horizontal"
|
|
android:paddingTop="12dp"
|
|
android:paddingBottom="2dp" />
|
|
|
|
<!-- Selected card type / product name -->
|
|
<TextView
|
|
android:id="@+id/tvSelectedCardType"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center"
|
|
android:paddingHorizontal="16dp"
|
|
android:paddingTop="6dp"
|
|
android:paddingBottom="2dp"
|
|
android:textAppearance="?attr/textAppearanceLabelLarge"
|
|
android:textColor="?attr/colorOnSurfaceVariant" />
|
|
|
|
<!-- Flexible spacer: absorbs remaining space, pushes buttons to bottom -->
|
|
<View
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:layout_weight="1" />
|
|
|
|
<!-- Divider -->
|
|
<View
|
|
android:id="@+id/divider"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="1dp"
|
|
android:layout_marginHorizontal="24dp"
|
|
android:layout_marginBottom="4dp"
|
|
android:background="?attr/colorOutlineVariant" />
|
|
|
|
<!-- Primary pay actions (normal mode) -->
|
|
<LinearLayout
|
|
android:id="@+id/llPayButtons"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:paddingHorizontal="16dp"
|
|
android:paddingTop="8dp"
|
|
android:paddingBottom="12dp">
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnScanToPay"
|
|
style="@style/Widget.Material3.Button.TonalButton"
|
|
android:layout_width="0dp"
|
|
android:layout_weight="1"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="8dp"
|
|
android:minWidth="0dp"
|
|
android:minHeight="0dp"
|
|
android:paddingTop="14dp"
|
|
android:paddingBottom="14dp"
|
|
android:text="@string/card_pay_qr"
|
|
android:textSize="13sp"
|
|
app:icon="@drawable/ic_qr_scan"
|
|
app:iconSize="22dp"
|
|
app:iconGravity="top"
|
|
app:iconPadding="6dp" />
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnTapToPay"
|
|
style="@style/Widget.Material3.Button.TonalButton"
|
|
android:layout_width="0dp"
|
|
android:layout_weight="1"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="8dp"
|
|
android:minWidth="0dp"
|
|
android:minHeight="0dp"
|
|
android:paddingTop="14dp"
|
|
android:paddingBottom="14dp"
|
|
android:text="@string/card_pay_nfc"
|
|
android:textSize="13sp"
|
|
app:icon="@drawable/ic_nfc"
|
|
app:iconSize="22dp"
|
|
app:iconGravity="top"
|
|
app:iconPadding="6dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
<!-- Default card toggle (manage mode only) -->
|
|
<LinearLayout
|
|
android:id="@+id/llDefaultCardRow"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center_vertical"
|
|
android:paddingHorizontal="20dp"
|
|
android:paddingTop="4dp"
|
|
android:paddingBottom="4dp"
|
|
android:visibility="gone">
|
|
|
|
<TextView
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="@string/card_set_as_default"
|
|
android:textAppearance="?attr/textAppearanceBodyMedium" />
|
|
|
|
<com.google.android.material.materialswitch.MaterialSwitch
|
|
android:id="@+id/switchDefaultCard"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content" />
|
|
|
|
</LinearLayout>
|
|
|
|
<!-- Hide from dashboard toggle (manage mode only) -->
|
|
<LinearLayout
|
|
android:id="@+id/llHideDashboardRow"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center_vertical"
|
|
android:paddingHorizontal="20dp"
|
|
android:paddingTop="4dp"
|
|
android:paddingBottom="4dp"
|
|
android:visibility="gone">
|
|
|
|
<TextView
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="@string/card_hide_from_dashboard"
|
|
android:textAppearance="?attr/textAppearanceBodyMedium" />
|
|
|
|
<com.google.android.material.materialswitch.MaterialSwitch
|
|
android:id="@+id/switchHideFromDashboard"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content" />
|
|
|
|
</LinearLayout>
|
|
|
|
<!-- Card management actions (manage mode only) -->
|
|
<LinearLayout
|
|
android:id="@+id/llManageButtons"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:paddingHorizontal="8dp"
|
|
android:paddingTop="8dp"
|
|
android:paddingBottom="12dp"
|
|
android:visibility="gone">
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnChangePin"
|
|
style="@style/Widget.Material3.Button.TonalButton"
|
|
android:layout_width="0dp"
|
|
android:layout_weight="1"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginHorizontal="4dp"
|
|
android:minWidth="0dp"
|
|
android:minHeight="0dp"
|
|
android:paddingTop="14dp"
|
|
android:paddingBottom="14dp"
|
|
android:text="@string/card_action_change_pin"
|
|
android:textSize="12sp"
|
|
app:icon="@drawable/ic_edit"
|
|
app:iconSize="22dp"
|
|
app:iconGravity="top"
|
|
app:iconPadding="6dp" />
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnFreeze"
|
|
style="@style/Widget.Material3.Button.TonalButton"
|
|
android:layout_width="0dp"
|
|
android:layout_weight="1"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginHorizontal="4dp"
|
|
android:minWidth="0dp"
|
|
android:minHeight="0dp"
|
|
android:paddingTop="14dp"
|
|
android:paddingBottom="14dp"
|
|
android:text="@string/card_action_freeze"
|
|
android:textSize="12sp"
|
|
app:icon="@drawable/ic_freeze"
|
|
app:iconSize="22dp"
|
|
app:iconGravity="top"
|
|
app:iconPadding="6dp" />
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnBlock"
|
|
style="@style/Widget.Material3.Button.TonalButton"
|
|
android:layout_width="0dp"
|
|
android:layout_weight="1"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginHorizontal="4dp"
|
|
android:minWidth="0dp"
|
|
android:minHeight="0dp"
|
|
android:paddingTop="14dp"
|
|
android:paddingBottom="14dp"
|
|
android:text="@string/card_action_block"
|
|
android:textSize="12sp"
|
|
app:icon="@drawable/ic_block"
|
|
app:iconSize="22dp"
|
|
app:iconGravity="top"
|
|
app:iconPadding="6dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
<!-- Tap-to-pay overlay: shown in tap mode, sits above contentLayout -->
|
|
<FrameLayout
|
|
android:id="@+id/flTapMode"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:visibility="gone" />
|
|
|
|
<!-- Loading state -->
|
|
<LinearLayout
|
|
android:id="@+id/loadingView"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:gravity="center"
|
|
android:orientation="vertical"
|
|
android:visibility="gone">
|
|
<ProgressBar
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content" />
|
|
</LinearLayout>
|
|
|
|
<!-- Empty state -->
|
|
<TextView
|
|
android:id="@+id/emptyView"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:gravity="center"
|
|
android:text="@string/cards_empty"
|
|
android:textAppearance="?attr/textAppearanceBodyMedium"
|
|
android:textColor="?attr/colorOnSurfaceVariant"
|
|
android:visibility="gone" />
|
|
|
|
|
|
</FrameLayout>
|