adding input amount transaction
This commit is contained in:
parent
f48e3e64a4
commit
f4e5e03077
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- app/src/main/res/layout/activity_credit_card.xml -->
|
||||
<!-- SUPER MINIMAL VERSION - GUARANTEED TO WORK -->
|
||||
<!-- Enhanced layout with amount input and keypad -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:padding="16dp"
|
||||
android:background="#F5F5F5">
|
||||
|
||||
<!-- Toolbar -->
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary" />
|
||||
android:background="?attr/colorPrimary"
|
||||
android:titleTextColor="@android:color/white" />
|
||||
|
||||
<!-- Toggle EMV Mode Button -->
|
||||
<Button
|
||||
@ -20,7 +22,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="Toggle EMV Mode" />
|
||||
android:text="Toggle EMV Mode"
|
||||
android:background="#2196F3"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<!-- Mode Indicator -->
|
||||
<TextView
|
||||
@ -31,52 +35,333 @@
|
||||
android:text="Current Mode: Simple Mode"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:background="#EEEEEE" />
|
||||
android:background="#EEEEEE"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<!-- Scrollable Result Area -->
|
||||
<ScrollView
|
||||
<!-- Amount Input Layout -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_amount_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="16dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<!-- Header -->
|
||||
<TextView
|
||||
android:id="@+id/tv_result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:text="Ready to scan card..."
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="monospace"
|
||||
android:textIsSelectable="true"
|
||||
android:background="@android:color/white" />
|
||||
android:text="TOTAL PEMBAYARAN"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:background="#2196F3"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
</ScrollView>
|
||||
<!-- Amount Display Card -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="20dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:elevation="4dp">
|
||||
|
||||
<!-- Copy Button -->
|
||||
<Button
|
||||
android:id="@+id/btn_copy_data"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="RP"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#666666"
|
||||
android:gravity="left" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_amount_display"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Rp 0,00"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#333333"
|
||||
android:gravity="left"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Masukkan kembali nominal pembayaran pelanggan Anda"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#999999"
|
||||
android:gravity="left"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<!-- Hidden EditText for amount input (for debugging/testing) -->
|
||||
<EditText
|
||||
android:id="@+id/et_amount_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:inputType="number"
|
||||
android:text="0" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Keypad -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="16dp"
|
||||
android:elevation="2dp">
|
||||
|
||||
<!-- Row 1: 1, 2, 3 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="1"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="2"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="3"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Row 2: 4, 5, 6 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_4"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="4"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="5"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_6"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="6"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Row 3: 7, 8, 9 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_7"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="7"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_8"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="8"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_9"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="9"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Row 4: 000, 0, Clear -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_00"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="000"
|
||||
android:textSize="18sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_0"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="0"
|
||||
android:textSize="24sp"
|
||||
android:background="#F0F0F0"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="⌫"
|
||||
android:textSize="20sp"
|
||||
android:background="#FF5722"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Card Result Layout -->
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_card_result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Copy Card Data"
|
||||
android:visibility="gone" />
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<!-- Clear Button -->
|
||||
<Button
|
||||
android:id="@+id/btn_clear_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Clear Data"
|
||||
android:visibility="gone" />
|
||||
<!-- Scrollable Result Area -->
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/white"
|
||||
android:elevation="2dp">
|
||||
|
||||
<!-- Check Card Button -->
|
||||
<TextView
|
||||
android:id="@+id/tv_result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:text="Ready to scan card..."
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="monospace"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="#333333"
|
||||
android:background="@android:color/white" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<!-- Copy Button -->
|
||||
<Button
|
||||
android:id="@+id/btn_copy_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Copy Card Data"
|
||||
android:background="#4CAF50"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- Clear Button -->
|
||||
<Button
|
||||
android:id="@+id/btn_clear_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Clear Data"
|
||||
android:background="#FF5722"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Main Action Button -->
|
||||
<Button
|
||||
android:id="@+id/btn_check_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Start Scanning"
|
||||
android:textSize="16sp"
|
||||
android:padding="16dp" />
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Konfirmasi"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:padding="16dp"
|
||||
android:background="#4CAF50"
|
||||
android:textColor="@android:color/white"
|
||||
android:elevation="4dp" />
|
||||
|
||||
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user