Safepoint Transaction-1
This commit is contained in:
		
							parent
							
								
									ece79942c1
								
							
						
					
					
						commit
						f5d9e53118
					
				@ -9,13 +9,13 @@ import android.view.View;
 | 
				
			|||||||
import android.widget.Button;
 | 
					import android.widget.Button;
 | 
				
			||||||
import android.widget.FrameLayout;
 | 
					import android.widget.FrameLayout;
 | 
				
			||||||
import android.widget.ImageView;
 | 
					import android.widget.ImageView;
 | 
				
			||||||
 | 
					import android.widget.LinearLayout;
 | 
				
			||||||
import android.widget.ProgressBar;
 | 
					import android.widget.ProgressBar;
 | 
				
			||||||
import android.widget.TextView;
 | 
					import android.widget.TextView;
 | 
				
			||||||
import android.widget.Toast;
 | 
					import android.widget.Toast;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import androidx.appcompat.app.AlertDialog;
 | 
					import androidx.appcompat.app.AlertDialog;
 | 
				
			||||||
import androidx.appcompat.app.AppCompatActivity;
 | 
					import androidx.appcompat.app.AppCompatActivity;
 | 
				
			||||||
import androidx.appcompat.widget.Toolbar;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.example.bdkipoc.R;
 | 
					import com.example.bdkipoc.R;
 | 
				
			||||||
import com.example.bdkipoc.transaction.managers.CardScannerManager;
 | 
					import com.example.bdkipoc.transaction.managers.CardScannerManager;
 | 
				
			||||||
@ -29,7 +29,7 @@ import java.util.Locale;
 | 
				
			|||||||
import com.example.bdkipoc.kredit.CreditCardActivity;
 | 
					import com.example.bdkipoc.kredit.CreditCardActivity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * CreateTransactionActivity - Refactored with Manager Classes
 | 
					 * CreateTransactionActivity - Updated UI to match screenshot design
 | 
				
			||||||
 * Handles amount input and card scanning in one screen
 | 
					 * Handles amount input and card scanning in one screen
 | 
				
			||||||
 * Located in transaction package
 | 
					 * Located in transaction package
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@ -46,9 +46,11 @@ public class CreateTransactionActivity extends AppCompatActivity implements
 | 
				
			|||||||
    private Button btnConfirm;
 | 
					    private Button btnConfirm;
 | 
				
			||||||
    private Button btnToggleMode;
 | 
					    private Button btnToggleMode;
 | 
				
			||||||
    private ProgressBar progressBar;
 | 
					    private ProgressBar progressBar;
 | 
				
			||||||
 | 
					    private LinearLayout backNavigation;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // Amount Input Keypad
 | 
					    // Amount Input Keypad (now TextViews)
 | 
				
			||||||
    private Button btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn0, btn00, btnClear;
 | 
					    private TextView btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn0, btn00;
 | 
				
			||||||
 | 
					    private ImageView btnClear;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // State Management
 | 
					    // State Management
 | 
				
			||||||
    private String transactionAmount = "0";
 | 
					    private String transactionAmount = "0";
 | 
				
			||||||
@ -77,22 +79,15 @@ public class CreateTransactionActivity extends AppCompatActivity implements
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void initViews() {
 | 
					    private void initViews() {
 | 
				
			||||||
        // Setup Toolbar
 | 
					 | 
				
			||||||
        Toolbar toolbar = findViewById(R.id.toolbar);
 | 
					 | 
				
			||||||
        setSupportActionBar(toolbar);
 | 
					 | 
				
			||||||
        if (getSupportActionBar() != null) {
 | 
					 | 
				
			||||||
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
 | 
					 | 
				
			||||||
            getSupportActionBar().setTitle("Input Nominal Transaksi");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        // Initialize amount input UI components
 | 
					        // Initialize amount input UI components
 | 
				
			||||||
        tvAmountDisplay = findViewById(R.id.tv_amount_display);
 | 
					        tvAmountDisplay = findViewById(R.id.tv_amount_display);
 | 
				
			||||||
        tvModeIndicator = findViewById(R.id.tv_mode_indicator);
 | 
					        tvModeIndicator = findViewById(R.id.tv_mode_indicator);
 | 
				
			||||||
        btnConfirm = findViewById(R.id.btn_confirm);
 | 
					        btnConfirm = findViewById(R.id.btn_confirm);
 | 
				
			||||||
        btnToggleMode = findViewById(R.id.btn_toggle_mode);
 | 
					        btnToggleMode = findViewById(R.id.btn_toggle_mode);
 | 
				
			||||||
        progressBar = findViewById(R.id.progress_bar);
 | 
					        progressBar = findViewById(R.id.progress_bar);
 | 
				
			||||||
 | 
					        backNavigation = findViewById(R.id.back_navigation);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Initialize keypad buttons
 | 
					        // Initialize keypad buttons (now TextViews)
 | 
				
			||||||
        btn1 = findViewById(R.id.btn_1);
 | 
					        btn1 = findViewById(R.id.btn_1);
 | 
				
			||||||
        btn2 = findViewById(R.id.btn_2);
 | 
					        btn2 = findViewById(R.id.btn_2);
 | 
				
			||||||
        btn3 = findViewById(R.id.btn_3);
 | 
					        btn3 = findViewById(R.id.btn_3);
 | 
				
			||||||
@ -126,10 +121,16 @@ public class CreateTransactionActivity extends AppCompatActivity implements
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void setupListeners() {
 | 
					    private void setupListeners() {
 | 
				
			||||||
        // Keypad number listeners
 | 
					        // Back navigation listener
 | 
				
			||||||
 | 
					        backNavigation.setOnClickListener(v -> {
 | 
				
			||||||
 | 
					            cleanup();
 | 
				
			||||||
 | 
					            finish();
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        // Keypad number listeners for TextViews
 | 
				
			||||||
        View.OnClickListener numberClickListener = v -> {
 | 
					        View.OnClickListener numberClickListener = v -> {
 | 
				
			||||||
            Button btn = (Button) v;
 | 
					            TextView textView = (TextView) v;
 | 
				
			||||||
            String number = btn.getText().toString();
 | 
					            String number = textView.getText().toString();
 | 
				
			||||||
            appendToAmount(number);
 | 
					            appendToAmount(number);
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
@ -145,13 +146,13 @@ public class CreateTransactionActivity extends AppCompatActivity implements
 | 
				
			|||||||
        btn0.setOnClickListener(numberClickListener);
 | 
					        btn0.setOnClickListener(numberClickListener);
 | 
				
			||||||
        btn00.setOnClickListener(numberClickListener);
 | 
					        btn00.setOnClickListener(numberClickListener);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Clear button
 | 
					        // Clear button (ImageView)
 | 
				
			||||||
        btnClear.setOnClickListener(v -> clearAmount());
 | 
					        btnClear.setOnClickListener(v -> clearAmount());
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Confirm button - shows modal and starts scanning
 | 
					        // Confirm button - shows modal and starts scanning
 | 
				
			||||||
        btnConfirm.setOnClickListener(v -> handleConfirmAmount());
 | 
					        btnConfirm.setOnClickListener(v -> handleConfirmAmount());
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Toggle mode button
 | 
					        // Toggle mode button (hidden but functional)
 | 
				
			||||||
        btnToggleMode.setOnClickListener(v -> toggleEMVMode());
 | 
					        btnToggleMode.setOnClickListener(v -> toggleEMVMode());
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Modal overlay click to close (only if not processing)
 | 
					        // Modal overlay click to close (only if not processing)
 | 
				
			||||||
@ -184,13 +185,20 @@ public class CreateTransactionActivity extends AppCompatActivity implements
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private void updateAmountDisplay() {
 | 
					    private void updateAmountDisplay() {
 | 
				
			||||||
        if (tvAmountDisplay != null) {
 | 
					        if (tvAmountDisplay != null) {
 | 
				
			||||||
 | 
					            if (transactionAmount.equals("0")) {
 | 
				
			||||||
 | 
					                tvAmountDisplay.setText("");
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                // Format the number with thousand separators but without currency symbol
 | 
				
			||||||
                long amountCents = Long.parseLong(transactionAmount);
 | 
					                long amountCents = Long.parseLong(transactionAmount);
 | 
				
			||||||
            double amountRupiah = amountCents / 100.0;
 | 
					                
 | 
				
			||||||
            NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("id", "ID"));
 | 
					                // Format as integer with thousand separators
 | 
				
			||||||
            String formattedAmount = formatter.format(amountRupiah);
 | 
					                NumberFormat formatter = NumberFormat.getNumberInstance(new Locale("id", "ID"));
 | 
				
			||||||
 | 
					                String formattedAmount = formatter.format(amountCents);
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
                tvAmountDisplay.setText(formattedAmount);
 | 
					                tvAmountDisplay.setText(formattedAmount);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void handleConfirmAmount() {
 | 
					    private void handleConfirmAmount() {
 | 
				
			||||||
        long amountCents = Long.parseLong(transactionAmount);
 | 
					        long amountCents = Long.parseLong(transactionAmount);
 | 
				
			||||||
@ -465,10 +473,9 @@ public class CreateTransactionActivity extends AppCompatActivity implements
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean onSupportNavigateUp() {
 | 
					    public void onBackPressed() {
 | 
				
			||||||
        cleanup();
 | 
					        cleanup();
 | 
				
			||||||
        finish();
 | 
					        super.onBackPressed();
 | 
				
			||||||
        return true;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
 | 
				
			|||||||
@ -4,208 +4,279 @@
 | 
				
			|||||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
					    xmlns:tools="http://schemas.android.com/tools"
 | 
				
			||||||
    android:layout_width="match_parent"
 | 
					    android:layout_width="match_parent"
 | 
				
			||||||
    android:layout_height="match_parent"
 | 
					    android:layout_height="match_parent"
 | 
				
			||||||
    android:background="@color/colorBackground"
 | 
					    android:background="#FFFFFF"
 | 
				
			||||||
    tools:context=".kredit.CreateTransactionActivity">
 | 
					    tools:context=".transaction.CreateTransactionActivity">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- Main Content -->
 | 
					    <!-- Main Content -->
 | 
				
			||||||
    <ScrollView
 | 
					    <ScrollView
 | 
				
			||||||
        android:layout_width="match_parent"
 | 
					        android:layout_width="match_parent"
 | 
				
			||||||
        android:layout_height="match_parent"
 | 
					        android:layout_height="match_parent"
 | 
				
			||||||
        android:fillViewport="true">
 | 
					        android:fillViewport="true"
 | 
				
			||||||
 | 
					        android:overScrollMode="never"
 | 
				
			||||||
 | 
					        android:scrollbars="none"
 | 
				
			||||||
 | 
					        android:background="#FFFFFF">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <androidx.constraintlayout.widget.ConstraintLayout
 | 
				
			||||||
 | 
					            android:layout_width="match_parent"
 | 
				
			||||||
 | 
					            android:layout_height="match_parent"
 | 
				
			||||||
 | 
					            android:background="#FFFFFF">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <!-- Red Status Bar -->
 | 
				
			||||||
 | 
					        <View
 | 
				
			||||||
 | 
					            android:id="@+id/red_status_bar"
 | 
				
			||||||
 | 
					            android:layout_width="match_parent"
 | 
				
			||||||
 | 
					            android:layout_height="24dp"
 | 
				
			||||||
 | 
					            android:background="#E31937"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toTopOf="parent"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <!-- Red Background Header -->
 | 
				
			||||||
 | 
					        <View
 | 
				
			||||||
 | 
					            android:id="@+id/red_header_background"
 | 
				
			||||||
 | 
					            android:layout_width="match_parent"
 | 
				
			||||||
 | 
					            android:layout_height="160dp"
 | 
				
			||||||
 | 
					            android:background="#E31937"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toBottomOf="@id/red_status_bar"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <!-- Back Navigation -->
 | 
				
			||||||
        <LinearLayout
 | 
					        <LinearLayout
 | 
				
			||||||
            android:layout_width="match_parent"
 | 
					            android:id="@+id/back_navigation"
 | 
				
			||||||
 | 
					            android:layout_width="wrap_content"
 | 
				
			||||||
            android:layout_height="wrap_content"
 | 
					            android:layout_height="wrap_content"
 | 
				
			||||||
            android:orientation="vertical">
 | 
					            android:orientation="horizontal"
 | 
				
			||||||
 | 
					            android:gravity="center_vertical"
 | 
				
			||||||
 | 
					            android:layout_marginStart="16dp"
 | 
				
			||||||
 | 
					            android:layout_marginBottom="5dp"
 | 
				
			||||||
 | 
					            android:background="?attr/selectableItemBackgroundBorderless"
 | 
				
			||||||
 | 
					            android:padding="8dp"
 | 
				
			||||||
 | 
					            app:layout_constraintStart_toStartOf="parent"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toBottomOf="@id/red_status_bar">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <!-- Toolbar -->
 | 
					            <!-- Back Arrow -->
 | 
				
			||||||
            <androidx.appcompat.widget.Toolbar
 | 
					            <ImageView
 | 
				
			||||||
                android:id="@+id/toolbar"
 | 
					                android:id="@+id/backArrow"
 | 
				
			||||||
                android:layout_width="match_parent"
 | 
					                android:layout_width="16dp"
 | 
				
			||||||
                android:layout_height="?attr/actionBarSize"
 | 
					                android:layout_height="16dp"
 | 
				
			||||||
                android:background="@color/primary_blue"
 | 
					                android:src="@drawable/ic_arrow_back"
 | 
				
			||||||
                android:theme="@style/CustomToolbarTheme"
 | 
					                android:contentDescription="Back" />
 | 
				
			||||||
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <!-- Content Container -->
 | 
					            <!-- Title Text -->
 | 
				
			||||||
            <LinearLayout
 | 
					            <TextView
 | 
				
			||||||
                android:layout_width="match_parent"
 | 
					                android:id="@+id/toolbarTitle"
 | 
				
			||||||
 | 
					                android:layout_width="wrap_content"
 | 
				
			||||||
                android:layout_height="wrap_content"
 | 
					                android:layout_height="wrap_content"
 | 
				
			||||||
                android:orientation="vertical"
 | 
					                android:layout_marginStart="8dp"
 | 
				
			||||||
                android:padding="16dp">
 | 
					                android:text="Kembali"
 | 
				
			||||||
 | 
					                android:textColor="@android:color/white"
 | 
				
			||||||
 | 
					                android:textSize="12sp"
 | 
				
			||||||
 | 
					                android:fontFamily="@font/inter"
 | 
				
			||||||
 | 
					                android:textStyle="normal" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <!-- Header Section -->
 | 
					        </LinearLayout>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <!-- Payment Card -->
 | 
				
			||||||
        <androidx.cardview.widget.CardView
 | 
					        <androidx.cardview.widget.CardView
 | 
				
			||||||
 | 
					            android:id="@+id/paymentCard"
 | 
				
			||||||
            android:layout_width="match_parent"
 | 
					            android:layout_width="match_parent"
 | 
				
			||||||
                    android:layout_height="wrap_content"
 | 
					            android:layout_height="191dp"
 | 
				
			||||||
                    android:layout_marginBottom="24dp"
 | 
					            android:layout_margin="16dp"
 | 
				
			||||||
 | 
					            android:layout_marginTop="5dp"
 | 
				
			||||||
 | 
					            app:cardBackgroundColor="#3498DB"
 | 
				
			||||||
            app:cardCornerRadius="12dp"
 | 
					            app:cardCornerRadius="12dp"
 | 
				
			||||||
                    app:cardElevation="4dp">
 | 
					            app:cardElevation="8dp"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toBottomOf="@id/back_navigation">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <LinearLayout
 | 
					            <LinearLayout
 | 
				
			||||||
                android:layout_width="match_parent"
 | 
					                android:layout_width="match_parent"
 | 
				
			||||||
                        android:layout_height="wrap_content"
 | 
					                android:layout_height="match_parent"
 | 
				
			||||||
                android:orientation="vertical"
 | 
					                android:orientation="vertical"
 | 
				
			||||||
                android:padding="20dp">
 | 
					                android:padding="20dp">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <!-- Title -->
 | 
				
			||||||
                <TextView
 | 
					                <TextView
 | 
				
			||||||
                    android:layout_width="match_parent"
 | 
					                    android:layout_width="match_parent"
 | 
				
			||||||
                    android:layout_height="wrap_content"
 | 
					                    android:layout_height="wrap_content"
 | 
				
			||||||
                            android:text="MASUKKAN NOMINAL"
 | 
					                    android:text="TOTAL PEMBAYARAN"
 | 
				
			||||||
 | 
					                    android:textColor="@android:color/white"
 | 
				
			||||||
                    android:textSize="18sp"
 | 
					                    android:textSize="18sp"
 | 
				
			||||||
                    android:textStyle="bold"
 | 
					                    android:textStyle="bold"
 | 
				
			||||||
                            android:textColor="#333333"
 | 
					                    android:fontFamily="@font/inter"
 | 
				
			||||||
                            android:gravity="center"
 | 
					                    android:layout_marginBottom="24dp" />
 | 
				
			||||||
                            android:layout_marginBottom="16dp" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <!-- Amount Display -->
 | 
					 | 
				
			||||||
                        <TextView
 | 
					 | 
				
			||||||
                            android:id="@+id/tv_amount_display"
 | 
					 | 
				
			||||||
                            android:layout_width="match_parent"
 | 
					 | 
				
			||||||
                            android:layout_height="wrap_content"
 | 
					 | 
				
			||||||
                            android:text="Rp 0,00"
 | 
					 | 
				
			||||||
                            style="@style/AmountDisplayStyle"
 | 
					 | 
				
			||||||
                            android:layout_marginBottom="8dp" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        <!-- Mode Indicator -->
 | 
					 | 
				
			||||||
                        <TextView
 | 
					 | 
				
			||||||
                            android:id="@+id/tv_mode_indicator"
 | 
					 | 
				
			||||||
                            android:layout_width="match_parent"
 | 
					 | 
				
			||||||
                            android:layout_height="wrap_content"
 | 
					 | 
				
			||||||
                            android:text="Current Mode: EMV Mode (Full Card Data)"
 | 
					 | 
				
			||||||
                            style="@style/ModeIndicatorStyle" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    </LinearLayout>
 | 
					 | 
				
			||||||
                </androidx.cardview.widget.CardView>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                <!-- Mode Toggle Button -->
 | 
					 | 
				
			||||||
                <Button
 | 
					 | 
				
			||||||
                    android:id="@+id/btn_toggle_mode"
 | 
					 | 
				
			||||||
                    android:layout_width="match_parent"
 | 
					 | 
				
			||||||
                    android:layout_height="48dp"
 | 
					 | 
				
			||||||
                    android:layout_marginBottom="24dp"
 | 
					 | 
				
			||||||
                    android:text="Switch to Simple"
 | 
					 | 
				
			||||||
                    style="@style/OutlineButton" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                <!-- Keypad Section -->
 | 
					 | 
				
			||||||
                <androidx.cardview.widget.CardView
 | 
					 | 
				
			||||||
                    android:layout_width="match_parent"
 | 
					 | 
				
			||||||
                    android:layout_height="wrap_content"
 | 
					 | 
				
			||||||
                    android:layout_marginBottom="24dp"
 | 
					 | 
				
			||||||
                    app:cardCornerRadius="12dp"
 | 
					 | 
				
			||||||
                    app:cardElevation="4dp">
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <!-- Amount Input Section -->
 | 
				
			||||||
                <LinearLayout
 | 
					                <LinearLayout
 | 
				
			||||||
                    android:layout_width="match_parent"
 | 
					                    android:layout_width="match_parent"
 | 
				
			||||||
                    android:layout_height="wrap_content"
 | 
					                    android:layout_height="wrap_content"
 | 
				
			||||||
                        android:orientation="vertical"
 | 
					                    android:orientation="horizontal"
 | 
				
			||||||
                        android:padding="16dp">
 | 
					                    android:layout_marginBottom="8dp">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    <TextView
 | 
				
			||||||
 | 
					                        android:layout_width="wrap_content"
 | 
				
			||||||
 | 
					                        android:layout_height="wrap_content"
 | 
				
			||||||
 | 
					                        android:text="RP"
 | 
				
			||||||
 | 
					                        android:textColor="@android:color/white"
 | 
				
			||||||
 | 
					                        android:textSize="20sp"
 | 
				
			||||||
 | 
					                        android:textStyle="bold"
 | 
				
			||||||
 | 
					                        android:fontFamily="@font/inter"
 | 
				
			||||||
 | 
					                        android:layout_marginEnd="8dp"
 | 
				
			||||||
 | 
					                        android:layout_gravity="bottom" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    <TextView
 | 
				
			||||||
 | 
					                        android:id="@+id/tv_amount_display"
 | 
				
			||||||
 | 
					                        android:layout_width="0dp"
 | 
				
			||||||
 | 
					                        android:layout_height="wrap_content"
 | 
				
			||||||
 | 
					                        android:layout_weight="1"
 | 
				
			||||||
 | 
					                        android:background="@android:color/transparent"
 | 
				
			||||||
 | 
					                        android:textColor="@android:color/white"
 | 
				
			||||||
 | 
					                        android:textSize="20sp"
 | 
				
			||||||
 | 
					                        android:textStyle="bold"
 | 
				
			||||||
 | 
					                        android:fontFamily="@font/inter"
 | 
				
			||||||
 | 
					                        android:text=""
 | 
				
			||||||
 | 
					                        android:gravity="start"
 | 
				
			||||||
 | 
					                        android:paddingBottom="4dp" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                </LinearLayout>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <!-- White Underline -->
 | 
				
			||||||
 | 
					                <View
 | 
				
			||||||
 | 
					                    android:layout_width="match_parent"
 | 
				
			||||||
 | 
					                    android:layout_height="2dp"
 | 
				
			||||||
 | 
					                    android:background="@android:color/white"
 | 
				
			||||||
 | 
					                    android:layout_marginBottom="16dp" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <!-- Description -->
 | 
				
			||||||
                <TextView
 | 
					                <TextView
 | 
				
			||||||
                    android:layout_width="match_parent"
 | 
					                    android:layout_width="match_parent"
 | 
				
			||||||
                    android:layout_height="wrap_content"
 | 
					                    android:layout_height="wrap_content"
 | 
				
			||||||
                            android:text="Keypad Input"
 | 
					                    android:text="Pastikan kembali nominal pembayaran pelanggan Anda"
 | 
				
			||||||
                            android:textSize="16sp"
 | 
					                    android:textColor="@android:color/white"
 | 
				
			||||||
                            android:textStyle="bold"
 | 
					                    android:textSize="12sp"
 | 
				
			||||||
                            android:textColor="#333333"
 | 
					                    android:fontFamily="@font/inter"
 | 
				
			||||||
                            android:gravity="center"
 | 
					                    android:alpha="0.9" />
 | 
				
			||||||
                            android:layout_marginBottom="16dp" />
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        <!-- Keypad Grid -->
 | 
					            </LinearLayout>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        </androidx.cardview.widget.CardView>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <!-- Numpad -->
 | 
				
			||||||
        <GridLayout
 | 
					        <GridLayout
 | 
				
			||||||
 | 
					            android:id="@+id/numpad_grid"
 | 
				
			||||||
            android:layout_width="match_parent"
 | 
					            android:layout_width="match_parent"
 | 
				
			||||||
            android:layout_height="wrap_content"
 | 
					            android:layout_height="wrap_content"
 | 
				
			||||||
            android:columnCount="3"
 | 
					            android:columnCount="3"
 | 
				
			||||||
            android:rowCount="4"
 | 
					            android:rowCount="4"
 | 
				
			||||||
                            android:layout_gravity="center">
 | 
					            android:layout_marginTop="24dp"
 | 
				
			||||||
 | 
					            android:layout_marginStart="16dp"
 | 
				
			||||||
 | 
					            android:layout_marginEnd="16dp"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toBottomOf="@id/paymentCard">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <!-- Row 1: 1, 2, 3 -->
 | 
					            <!-- Row 1: 1, 2, 3 -->
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_1"
 | 
					                android:id="@+id/btn_1"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="1" />
 | 
					                android:text="1" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_2"
 | 
					                android:id="@+id/btn_2"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="2" />
 | 
					                android:text="2" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_3"
 | 
					                android:id="@+id/btn_3"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="3" />
 | 
					                android:text="3" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <!-- Row 2: 4, 5, 6 -->
 | 
					            <!-- Row 2: 4, 5, 6 -->
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_4"
 | 
					                android:id="@+id/btn_4"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="4" />
 | 
					                android:text="4" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_5"
 | 
					                android:id="@+id/btn_5"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="5" />
 | 
					                android:text="5" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_6"
 | 
					                android:id="@+id/btn_6"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="6" />
 | 
					                android:text="6" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <!-- Row 3: 7, 8, 9 -->
 | 
					            <!-- Row 3: 7, 8, 9 -->
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_7"
 | 
					                android:id="@+id/btn_7"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="7" />
 | 
					                android:text="7" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_8"
 | 
					                android:id="@+id/btn_8"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="8" />
 | 
					                android:text="8" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_9"
 | 
					                android:id="@+id/btn_9"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="9" />
 | 
					                android:text="9" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <!-- Row 4: 00, 0, Clear -->
 | 
					            <!-- Row 4: 000, 0, Delete -->
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_00"
 | 
					                android:id="@+id/btn_00"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                                android:text="00" />
 | 
					                android:text="000" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <TextView
 | 
				
			||||||
                android:id="@+id/btn_0"
 | 
					                android:id="@+id/btn_0"
 | 
				
			||||||
                                style="@style/KeypadButton"
 | 
					                style="@style/NumpadButton"
 | 
				
			||||||
                android:text="0" />
 | 
					                android:text="0" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            <Button
 | 
					            <ImageView
 | 
				
			||||||
                android:id="@+id/btn_clear"
 | 
					                android:id="@+id/btn_clear"
 | 
				
			||||||
                                style="@style/KeypadButtonSecondary"
 | 
					                android:layout_width="0dp"
 | 
				
			||||||
                                android:text="⌫" />
 | 
					                android:layout_height="60dp"
 | 
				
			||||||
 | 
					                android:layout_columnWeight="1"
 | 
				
			||||||
 | 
					                android:layout_margin="8dp"
 | 
				
			||||||
 | 
					                android:background="?attr/selectableItemBackgroundBorderless"
 | 
				
			||||||
 | 
					                android:src="@drawable/ic_backspace"
 | 
				
			||||||
 | 
					                android:scaleType="center"
 | 
				
			||||||
 | 
					                android:contentDescription="Delete" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        </GridLayout>
 | 
					        </GridLayout>
 | 
				
			||||||
                    </LinearLayout>
 | 
					 | 
				
			||||||
                </androidx.cardview.widget.CardView>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <!-- Confirm Button -->
 | 
					        <!-- Confirmation Button -->
 | 
				
			||||||
                <Button
 | 
					        <com.google.android.material.button.MaterialButton
 | 
				
			||||||
            android:id="@+id/btn_confirm"
 | 
					            android:id="@+id/btn_confirm"
 | 
				
			||||||
            android:layout_width="match_parent"
 | 
					            android:layout_width="match_parent"
 | 
				
			||||||
                    android:layout_height="56dp"
 | 
					            android:layout_height="48dp"
 | 
				
			||||||
                    android:text="KONFIRMASI NOMINAL"
 | 
					            android:text="Konfirmasi"
 | 
				
			||||||
                    style="@style/PrimaryButton"
 | 
					            android:textColor="#FFFFFF"
 | 
				
			||||||
                    android:layout_marginBottom="16dp" />
 | 
					            android:textSize="16sp"
 | 
				
			||||||
 | 
					            android:textStyle="bold"
 | 
				
			||||||
 | 
					            android:fontFamily="@font/inter"
 | 
				
			||||||
 | 
					            android:layout_marginStart="16dp"
 | 
				
			||||||
 | 
					            android:layout_marginEnd="16dp"
 | 
				
			||||||
 | 
					            android:layout_marginTop="24dp"
 | 
				
			||||||
 | 
					            android:layout_marginBottom="24dp"
 | 
				
			||||||
 | 
					            android:enabled="true"
 | 
				
			||||||
 | 
					            app:backgroundTint="#DE0701"
 | 
				
			||||||
 | 
					            app:cornerRadius="8dp"
 | 
				
			||||||
 | 
					            app:rippleColor="#B3000000"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toBottomOf="@id/numpad_grid"
 | 
				
			||||||
 | 
					            app:layout_constraintBottom_toBottomOf="parent"
 | 
				
			||||||
 | 
					            app:layout_constraintVertical_bias="1" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <!-- Instructions -->
 | 
					        <!-- Hidden Mode Indicator and Toggle (for compatibility with existing code) -->
 | 
				
			||||||
        <TextView
 | 
					        <TextView
 | 
				
			||||||
                    android:layout_width="match_parent"
 | 
					            android:id="@+id/tv_mode_indicator"
 | 
				
			||||||
                    android:layout_height="wrap_content"
 | 
					            android:layout_width="0dp"
 | 
				
			||||||
                    android:text="• Gunakan keypad untuk memasukkan nominal\n• Minimal transaksi Rp 1,00\n• Pilih mode EMV untuk data lengkap kartu"
 | 
					            android:layout_height="0dp"
 | 
				
			||||||
                    style="@style/HintTextStyle" />
 | 
					            android:visibility="gone"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toTopOf="parent" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            </LinearLayout>
 | 
					        <Button
 | 
				
			||||||
        </LinearLayout>
 | 
					            android:id="@+id/btn_toggle_mode"
 | 
				
			||||||
    </ScrollView>
 | 
					            android:layout_width="0dp"
 | 
				
			||||||
 | 
					            android:layout_height="0dp"
 | 
				
			||||||
 | 
					            android:visibility="gone"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toTopOf="parent" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <!-- Hidden Progress Bar for Card Scanning -->
 | 
					        <!-- Hidden Progress Bar for Card Scanning -->
 | 
				
			||||||
        <ProgressBar
 | 
					        <ProgressBar
 | 
				
			||||||
@ -215,9 +286,16 @@
 | 
				
			|||||||
            android:layout_height="48dp"
 | 
					            android:layout_height="48dp"
 | 
				
			||||||
            android:layout_gravity="center"
 | 
					            android:layout_gravity="center"
 | 
				
			||||||
            android:visibility="gone"
 | 
					            android:visibility="gone"
 | 
				
			||||||
        android:indeterminateTint="@color/primary_blue" />
 | 
					            android:indeterminateTint="#E31937"
 | 
				
			||||||
 | 
					            app:layout_constraintTop_toTopOf="parent"
 | 
				
			||||||
 | 
					            app:layout_constraintBottom_toBottomOf="parent"
 | 
				
			||||||
 | 
					            app:layout_constraintStart_toStartOf="parent"
 | 
				
			||||||
 | 
					            app:layout_constraintEnd_toEndOf="parent" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- Modal Overlay with Blur Effect for Card Scanning -->
 | 
					        </androidx.constraintlayout.widget.ConstraintLayout>
 | 
				
			||||||
 | 
					    </ScrollView>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- Modal Overlay with Blur Effect for Card Scanning - MOVED TO TOP LEVEL -->
 | 
				
			||||||
    <FrameLayout
 | 
					    <FrameLayout
 | 
				
			||||||
        android:id="@+id/modal_overlay"
 | 
					        android:id="@+id/modal_overlay"
 | 
				
			||||||
        android:layout_width="match_parent"
 | 
					        android:layout_width="match_parent"
 | 
				
			||||||
@ -225,7 +303,8 @@
 | 
				
			|||||||
        android:background="#80000000"
 | 
					        android:background="#80000000"
 | 
				
			||||||
        android:visibility="gone"
 | 
					        android:visibility="gone"
 | 
				
			||||||
        android:clickable="true"
 | 
					        android:clickable="true"
 | 
				
			||||||
        android:focusable="true">
 | 
					        android:focusable="true"
 | 
				
			||||||
 | 
					        android:elevation="100dp">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <!-- Modal Content -->
 | 
					        <!-- Modal Content -->
 | 
				
			||||||
        <androidx.cardview.widget.CardView
 | 
					        <androidx.cardview.widget.CardView
 | 
				
			||||||
@ -235,7 +314,7 @@
 | 
				
			|||||||
            android:layout_gravity="center"
 | 
					            android:layout_gravity="center"
 | 
				
			||||||
            android:layout_margin="32dp"
 | 
					            android:layout_margin="32dp"
 | 
				
			||||||
            app:cardCornerRadius="16dp"
 | 
					            app:cardCornerRadius="16dp"
 | 
				
			||||||
            app:cardElevation="8dp"
 | 
					            app:cardElevation="20dp"
 | 
				
			||||||
            app:cardBackgroundColor="@android:color/white">
 | 
					            app:cardBackgroundColor="@android:color/white">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <LinearLayout
 | 
					            <LinearLayout
 | 
				
			||||||
@ -254,7 +333,7 @@
 | 
				
			|||||||
                    android:layout_marginBottom="24dp"
 | 
					                    android:layout_marginBottom="24dp"
 | 
				
			||||||
                    android:scaleType="fitCenter"
 | 
					                    android:scaleType="fitCenter"
 | 
				
			||||||
                    android:adjustViewBounds="true"
 | 
					                    android:adjustViewBounds="true"
 | 
				
			||||||
                    app:tint="@color/primary_blue" />
 | 
					                    app:tint="#E31937" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <!-- Main Text -->
 | 
					                <!-- Main Text -->
 | 
				
			||||||
                <TextView
 | 
					                <TextView
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user