Compare commits

...

3 Commits

31 changed files with 288 additions and 98 deletions

View File

@ -143,6 +143,8 @@ dependencies {
// ML Kit Face Detection
implementation 'com.google.mlkit:face-detection:16.1.6'
implementation 'com.airbnb.android:lottie:6.1.0'
// CameraX (optional but recommended for better camera handling)
// implementation "androidx.camera:camera-camera2:1.3.2"
// implementation "androidx.camera:camera-lifecycle:1.3.2"

View File

@ -25,16 +25,13 @@ public class FaceIDHelper implements TextureView.SurfaceTextureListener {
private static final int REQUEST_CAMERA_PERMISSION = 200;
private static final int DETECTION_INTERVAL_MS = 1000; // Check every second
private Context context;
private TextureView textureView;
private FaceIDCallback callback;
private CameraManager cameraManager;
private CameraDevice cameraDevice;
private CameraCaptureSession cameraCaptureSession;
private CaptureRequest.Builder captureRequestBuilder;
private Handler backgroundHandler;
private HandlerThread backgroundThread;
private String frontCameraId;
@ -80,7 +77,6 @@ public class FaceIDHelper implements TextureView.SurfaceTextureListener {
callback.onCameraError("Camera permission required");
return;
}
setupCamera();
}
@ -91,7 +87,6 @@ public class FaceIDHelper implements TextureView.SurfaceTextureListener {
callback.onCameraError("Front camera not found");
return;
}
textureView.setSurfaceTextureListener(this);
} catch (CameraAccessException e) {

View File

@ -266,8 +266,8 @@ public class PrinterHelper {
// ================== ADDRESS ==================
// mPrinter.addText("г. Волгоград, пр. Ленина, д. 92");
// ================== RECEIPT DETAILS ==================
mPrinter.addText("ЧЕК №" + 123465);
mPrinter.addText("Кассир: Иванов И.И.");
// mPrinter.addText("ЧЕК №" + 123465);
// mPrinter.addText("Кассир: Иванов И.И.");
SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy", Locale.getDefault());
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
@ -292,11 +292,11 @@ public class PrinterHelper {
new int[]{PrintStyle.Alignment.CENTER, PrintStyle.Alignment.ALIGN_OPPOSITE}
);
mPrinter.addTexts(
new String[]{" НДС 20%", "= " + String.format("%.2f %s", amount * 0.2, currencySymbol)},
new int[]{2, 1},
new int[]{PrintStyle.Alignment.NORMAL, PrintStyle.Alignment.ALIGN_OPPOSITE}
);
// mPrinter.addTexts(
// new String[]{" НДС 20%", "= " + String.format("%.2f %s", amount * 0.2, currencySymbol)},
// new int[]{2, 1},
// new int[]{PrintStyle.Alignment.NORMAL, PrintStyle.Alignment.ALIGN_OPPOSITE}
// );
// ================== TOTALS ==================
mPrinter.addText("--------------------------------");
mPrinter.addPrintLintStyle(new PrintLineStyle(PrintStyle.FontStyle.BOLD, PrintLine.CENTER, 28));

View File

@ -70,16 +70,21 @@ public class CashierFragment extends BaseFragment<FragmentCashierBinding, Cashie
public void initData() {
super.initData();
// Request focus immediately
if (etAmountInput != null) {
etAmountInput.requestFocus();
}
// Setup amount input field
setupAmountInput();
}
private void setupAmountInput() {
// Find the EditText in layout
etAmountInput = binding.getRoot().findViewById(R.id.etAmountInput);
// Make EditText invisible but still focusable
if (etAmountInput != null) {
// Request focus
etAmountInput.requestFocus();
// Add text watcher to update amount in real-time
etAmountInput.addTextChangedListener(new TextWatcher() {
@ -130,6 +135,8 @@ public class CashierFragment extends BaseFragment<FragmentCashierBinding, Cashie
return false;
}
});
// etAmountInput.setVisibility(View.I);
}
}
@ -162,7 +169,7 @@ public class CashierFragment extends BaseFragment<FragmentCashierBinding, Cashie
viewModel.sendMessage(paymentDataM20.toString());
// Reset input field
etAmountInput.setText("");
// etAmountInput.setText("");
} catch (Exception e) {
Log.e("CashierFragment", "Error creating JSON", e);

View File

@ -37,7 +37,9 @@ public class CashierViewModel extends BaseAppViewModel {
return paymentInfo;
}
public ObservableField<String> amount = new ObservableField<>("0.00");
public ObservableField<String> currencyCode = new ObservableField<>("RUB");
public ObservableField<String> currencyCode = new ObservableField<>("");
public ObservableField<String> instructionText = new ObservableField<>(" ");
private final MutableLiveData<PaymentStatus> paymentStatus = new MutableLiveData<>(PaymentStatus.WAITING);
public LiveData<PaymentStatus> getPaymentStatus() {
return paymentStatus;
@ -53,6 +55,7 @@ public class CashierViewModel extends BaseAppViewModel {
super(application);
mContext = application.getApplicationContext();
initializePrinter();
instructionText.set("Введите сумму для оплаты на PIN-пад");
}
private void initializePrinter() {
@ -206,7 +209,7 @@ public class CashierViewModel extends BaseAppViewModel {
public void sendMessage(String message) {
try {
sendWebSocketMessage(message);
instructionText.set("Ожидание оплаты с пин-пада");
} catch (Exception e) {
Log.e(TAG, "Error sending WebSocket message", e);
}

View File

@ -1,19 +1,25 @@
package com.dspread.pos.ui.payment;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import com.alibaba.fastjson.JSONException;
@ -52,6 +58,9 @@ import me.goldze.mvvmhabit.utils.ToastUtils;
// Add these imports at the top
import android.widget.FrameLayout;
import android.widget.MediaController;
import android.widget.VideoView;
import com.dspread.pos_android_app.databinding.WaitingForCardBinding; // Generated binding class
import com.dspread.pos.faceID.FaceIDHelper;
@ -92,6 +101,14 @@ public class PaymentActivity extends BaseActivity<ActivityPaymentBinding, Paymen
@Override
public void initData() {
// 👇 Add this code to hide both bars
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // Hides back/home buttons
// | View.SYSTEM_UI_FLAG_FULLSCREEN // Hides status bar (clock, battery)
);
// Debug current locale
Locale currentLocale = getResources().getConfiguration().locale;
Log.d("LanguageDebug", "Current locale: " + currentLocale.getLanguage());
@ -175,6 +192,12 @@ public class PaymentActivity extends BaseActivity<ActivityPaymentBinding, Paymen
waitingViewModel.onFaceIDClicked();
});
VideoView videoView = findViewById(R.id.videoView);
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.misha_card);
videoView.setVideoURI(videoUri);
videoView.start();
videoView.setOnCompletionListener(mediaPlayer -> videoView.start());
startTransaction();
}
@ -185,15 +208,40 @@ public class PaymentActivity extends BaseActivity<ActivityPaymentBinding, Paymen
// Show camera container - now it's inside the FrameLayout
FrameLayout cameraContainer = waitingBinding.getRoot().findViewById(R.id.camera_container);
LinearLayout yuzlogoContainer = waitingBinding.getRoot().findViewById(R.id.yuzpay_id);
if (cameraContainer != null) {
cameraContainer.setVisibility(View.VISIBLE);
yuzlogoContainer.setVisibility(View.VISIBLE);
}
// Create TextureView for camera preview
TextureView textureView = new TextureView(this);
textureView.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT));
// Set layout params to maintain aspect ratio (4:3 is common for cameras)
// int width = getResources().getDisplayMetrics().widthPixels;
// int height = (width * 4) / 3; // 4:3 aspect ratio
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int zoomedWidth = (int) (displayMetrics.widthPixels * 1.5f);
int zoomedHeight = (int) (displayMetrics.heightPixels * 0.8f);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
zoomedWidth,
zoomedHeight,
Gravity.CENTER_HORIZONTAL | Gravity.TOP);
// FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
// width, height, Gravity.CENTER);
textureView.setLayoutParams(params);
// textureView.setLayoutParams(new FrameLayout.LayoutParams(
// FrameLayout.LayoutParams.MATCH_PARENT,
// FrameLayout.LayoutParams.MATCH_PARENT));
// Add TextureView to camera container
if (cameraContainer != null) {

View File

@ -58,13 +58,14 @@ public class PinpadViewModel extends BaseAppViewModel {
// Get the amount from the signal (or use the current amount)
String signalAmount = results.optString("amount", null);
Log.d(TAG, "onPaymentRedirected: amount " + signalAmount);
if (signalAmount != null) {
amount.set(formatAmount(signalAmount));
}
// Trigger navigation via the event
String amountToPass = results.optString("rawAmount", getRawAmount());
paymentStartEvent.postValue(amountToPass);
// String amountToPass = results.optString("rawAmount", getRawAmount());
paymentStartEvent.postValue(signalAmount);
break;
default:
@ -77,9 +78,11 @@ public class PinpadViewModel extends BaseAppViewModel {
// Helper method to get raw amount (without formatting)
private String getRawAmount() {
String formatted = amount.get();
try {
// Convert formatted amount back to raw cents
String formatted = amount.get();
if (formatted != null) {
double amountDouble = Double.parseDouble(formatted);
return String.valueOf((int)(amountDouble * 100));
@ -87,11 +90,11 @@ public class PinpadViewModel extends BaseAppViewModel {
} catch (NumberFormatException e) {
Log.e(TAG, "Error converting amount back to raw", e);
}
return "1000"; // default fallback
return formatted; // default fallback
}
// Method to manually trigger payment (if needed)
public void triggerPayment() {
paymentStartEvent.postValue(getRawAmount());
}
// public void triggerPayment() {
// paymentStartEvent.postValue(getRawAmount());
// }
}

View File

@ -27,7 +27,8 @@ public class QRCodeGenerator {
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
bitmap.setPixel(x, y, bitMatrix.get(x, y) ? Color.WHITE : Color.rgb(140, 16 , 132));
bitmap.setPixel(x, y, bitMatrix.get(x, y) ? Color.WHITE : Color.TRANSPARENT);
// Color.rgb(113, 22 , 141)
}
}
return bitmap;

View File

@ -18,7 +18,7 @@
android:endY="234.97"
android:type="linear">
<item android:offset="0" android:color="#FFACAFCA"/>
<item android:offset="1" android:color="#FF44454E"/>
<item android:offset="1" android:color="#FFFFFFFF"/>
</gradient>
</aapt:attr>
</path>

View File

@ -8,7 +8,7 @@
<item android:color="#FFACAFCA" android:offset="0"/>
<item android:color="#FF44454E" android:offset="1"/>
<item android:color="#FFFFFFFF" android:offset="1"/>
</gradient>

View File

@ -18,7 +18,7 @@
android:endY="238.43"
android:type="linear">
<item android:offset="0" android:color="#FFACAFCA"/>
<item android:offset="1" android:color="#FF44454E"/>
<item android:offset="1" android:color="#FFFFFFFF"/>
</gradient>
</aapt:attr>
</path>

View File

@ -18,7 +18,7 @@
android:endY="240.81"
android:type="linear">
<item android:offset="0" android:color="#FFACAFCA"/>
<item android:offset="1" android:color="#FF44454E"/>
<item android:offset="1" android:color="#FFFFFFFF"/>
</gradient>
</aapt:attr>
</path>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:type="linear"
android:angle="275"
android:startColor="#6125CE"
android:endColor="#D399FF" />
</shape>

View File

@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="119dp"
android:height="32dp"
android:viewportWidth="119"
android:viewportHeight="32">
<group>
<clip-path
android:pathData="M0.18,-0h27.7v31.35h-27.7z"/>
<path
android:pathData="M4.7,10.26L12.56,0.44L1.23,7.66L4.7,10.26ZM14.03,0.44L22.06,10.48H6L14.03,0.44ZM22.23,11.64L14.03,24.96L5.83,11.64H22.23ZM15.51,0.44L26.84,7.66L23.36,10.26L15.51,0.44ZM27.31,20.51V8.74L23.95,11.26L27.31,20.51ZM14.61,30.82V26.55L27.09,24.47L14.61,30.82ZM13.46,26.55L0.97,24.47L13.46,30.82V26.55ZM0.75,8.74L4.21,11.34L0.75,20.52L0.75,8.74ZM15.19,25.28L27.1,23.3L23.13,12.38L15.19,25.28ZM4.94,12.38L12.88,25.28L0.97,23.3L4.94,12.38Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</group>
<group>
<clip-path
android:pathData="M35.17,4.37h83.11v22.6h-83.11z"/>
<path
android:pathData="M52.64,4.37L46.3,13.88V20.88H42.32V13.88L36.12,4.37L40.94,4.37L44.46,10.48L47.98,4.37L52.64,4.37Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M62.99,20.88H59.31V19.27H59.26C58.98,19.81 58.52,20.27 57.89,20.64C57.25,21.01 56.54,21.2 55.77,21.2C54.32,21.2 53.26,20.74 52.57,19.83C51.89,18.89 51.55,17.77 51.55,16.45V9.27H55.39V15.56C55.39,17.21 55.97,18.03 57.12,18.03C57.76,18.03 58.25,17.79 58.61,17.31C58.98,16.83 59.17,16.24 59.17,15.54V9.27H62.99V20.88Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M75.63,20.88H65.28V17.89L70.74,12.21H65.49V9.27H75.4V12.14L69.78,17.92H75.63V20.88Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M90.63,9.45C90.63,10.67 90.31,11.68 89.68,12.48C89.06,13.29 88.27,13.86 87.32,14.19C86.39,14.5 85.31,14.65 84.08,14.65H82.1V20.88H78.12V4.37L84.18,4.37C86.13,4.37 87.7,4.78 88.86,5.59C90.04,6.38 90.63,7.67 90.63,9.45ZM86.65,9.48C86.65,8.22 85.71,7.59 83.85,7.59H82.1V11.48H83.78C85.69,11.48 86.65,10.81 86.65,9.48Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M98.57,16.21V15.82H98.09C95.71,15.82 94.52,16.35 94.52,17.4C94.52,17.81 94.68,18.11 95.01,18.31C95.34,18.5 95.72,18.59 96.17,18.59C96.94,18.59 97.53,18.38 97.95,17.96C98.36,17.53 98.57,16.94 98.57,16.21ZM93.49,12.93L91.56,10.85C92.94,9.55 94.67,8.9 96.73,8.9C98.64,8.9 100.01,9.39 100.83,10.36C101.66,11.33 102.07,12.88 102.07,15.03V20.88H98.57V19.64H98.5C98.23,20.11 97.78,20.48 97.18,20.76C96.57,21.02 95.92,21.15 95.22,21.15C94.54,21.15 93.89,21.05 93.28,20.85C92.69,20.63 92.17,20.24 91.7,19.66C91.23,19.09 91,18.37 91,17.52C91,14.91 93.49,13.6 98.46,13.6V13.42C98.46,12.87 98.26,12.46 97.88,12.18C97.49,11.89 96.98,11.74 96.36,11.74C95.3,11.74 94.35,12.14 93.49,12.93Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M116.67,9.27L111.47,22.62C110.97,23.93 110.35,24.89 109.58,25.51C108.82,26.15 107.75,26.47 106.37,26.47C105.65,26.47 104.95,26.38 104.27,26.21L104.69,23C105.14,23.14 105.55,23.21 105.93,23.21C106.49,23.21 106.9,23.08 107.16,22.83C107.44,22.6 107.68,22.2 107.88,21.64L108.26,20.69L103.41,9.27H107.65L110.24,16.73H110.31L112.61,9.27H116.67Z"
android:fillColor="#ffffff"/>
</group>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -111,14 +111,14 @@
android:id="@+id/iv_status"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@{viewModel.isSuccess ? @drawable/ic_check_circle : @drawable/ic_error_circle}"
android:src="@{viewModel.isSuccess ? @drawable/ic_check_circle : null}"
android:layout_marginEnd="8dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/transaction_result"
android:textColor="@{viewModel.isSuccess ? @color/green : @color/red}"
android:textColor="@{viewModel.isSuccess ? @color/green : @color/black}"
android:textSize="24sp"/>
</LinearLayout>

View File

@ -20,10 +20,11 @@
<!-- Real-time amount display -->
<TextView
android:id="@+id/realTimeAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{viewModel.amount + ` ` + viewModel.currencyCode}"
android:textSize="24sp"
android:textSize="34sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginTop="16dp"
@ -32,11 +33,13 @@
<EditText
android:id="@+id/etAmountInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="1dp"
android:inputType="numberDecimal"
android:hint="Enter amount"
android:hint=" "
android:imeOptions="actionDone"
android:maxLines="1"/>
android:maxLines="1"
android:textColor="@color/white"
android:visibility="visible"/>
<!-- Waiting State -->
<LinearLayout
@ -48,12 +51,14 @@
android:visibility="@{viewModel.paymentStatus == PaymentStatus.WAITING ? View.VISIBLE : View.GONE}">
<TextView
android:id="@+id/text_instruction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter amount for pinpad M50 to pay"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:gravity="center"
android:text="@{viewModel.instructionText}"
android:textSize="18sp"
android:textStyle="bold"
android:gravity="center" />
android:textStyle="bold" />
</LinearLayout>
<!-- Success State -->
@ -74,11 +79,13 @@
<!-- android:gravity="center" />-->
<Button
android:id="@+id/printButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Print Receipt"
android:text="Печатать чек еще раз"
android:padding="10dp"
android:onClick="@{() -> viewModel.printReceipt()}"
android:layout_marginTop="16dp" />
android:layout_marginTop="26dp" />
</LinearLayout>
<!-- Failed State -->

View File

@ -6,20 +6,32 @@
<variable
name="viewModel"
type="com.dspread.pos.ui.home.HomeViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/keyboard_background">
android:background="@drawable/wallpaper_8f25c3">
<LinearLayout
android:id="@+id/LogoContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
app:layout_constraintBottom_toTopOf="@id/txt_amount_container"
app:layout_constraintVertical_bias="0.5"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<ImageView
android:id="@+id/logoImage"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:scaleType="fitCenter"
@ -28,15 +40,15 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</LinearLayout>
<!-- 金额显示区域 -->
<!-- 金额显示区域 -->
<LinearLayout
android:id="@+id/txt_amount_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingRight="20dp"
app:layout_constraintTop_toBottomOf="@id/logoImage"
app:layout_constraintTop_toBottomOf="@id/LogoContainer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:orientation="horizontal"

View File

@ -16,19 +16,15 @@
<!-- android:text="@{viewModel.status}"-->
<!-- binding:onClickCommand="@{viewModel.actionCommand}"-->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:padding="16dp"
android:gravity="center"
android:background="@drawable/wallpaper_8f25c3"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintHorizontal_chainStyle="packed"
>
app:layout_constraintHorizontal_chainStyle="packed">
<!-- Top Section: Logo -->
<LinearLayout
@ -37,18 +33,11 @@
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/gridLayout"
app:layout_constraintVertical_bias="0.5"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
>
app:layout_constraintEnd_toEndOf="parent">
<ImageView
android:id="@+id/ivLogo"
@ -84,6 +73,7 @@
>
<androidx.recyclerview.widget.RecyclerView
android:background="@android:color/transparent"
android:id="@+id/mulberryCards_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -190,6 +180,7 @@
app:layout_constraintEnd_toEndOf="parent">
<TextView
android:textColor="@color/white"
android:id="@+id/footertext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@ -15,7 +15,10 @@
android:layout_margin="8dp"
android:onClick="@{() -> viewModel.itemClick.execute()}"
app:cardCornerRadius="8dp"
app:cardElevation="4dp">
app:cardBackgroundColor="@android:color/transparent"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false"
>
<LinearLayout
android:layout_width="match_parent"
@ -33,12 +36,13 @@
tools:src="@drawable/ax_card_grey" /> <!-- Use your actual default drawable -->
<TextView
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@{viewModel.title}"
android:textSize="16sp"
android:textStyle="bold"
android:textStyle="normal"
tools:text="Payment" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -11,7 +11,8 @@
<!-- Use FrameLayout as root to contain both camera overlay and main content -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/white">
<!-- Main Content -->
<LinearLayout
@ -19,21 +20,49 @@
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp">
android:padding="0dp">
<!-- Card animation GIF -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_300"
android:paddingTop="10dp"
android:scaleType="fitCenter"
android:src="@drawable/melberry_char_purple" />
</LinearLayout>
<VideoView
android:id="@+id/videoView"
android:layout_width="400dp"
android:layout_height="400dp"
android:paddingLeft="-16dp"
android:layout_gravity="end"
android:adjustViewBounds="true"
android:scaleType="centerCrop"/>
<!-- &lt;!&ndash; Card animation GIF &ndash;&gt;-->
<!-- <LinearLayout-->
<!-- android:layout_width="258dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="0dp"-->
<!-- android:layout_weight="1"-->
<!-- android:gravity="center">-->
<!-- &lt;!&ndash; <pl.droidsonroids.gif.GifImageView&ndash;&gt;-->
<!-- &lt;!&ndash; android:layout_width="348dp"&ndash;&gt;-->
<!-- &lt;!&ndash; android:layout_height="480dp"&ndash;&gt;-->
<!-- &lt;!&ndash; android:padding="35dp"&ndash;&gt;-->
<!-- &lt;!&ndash; android:scaleType="centerCrop"&ndash;&gt;-->
<!-- &lt;!&ndash; android:src="@drawable/mishka_like" />&ndash;&gt;-->
<!--&lt;!&ndash; <com.airbnb.lottie.LottieAnimationView&ndash;&gt;-->
<!--&lt;!&ndash; android:id="@+id/lottie_view"&ndash;&gt;-->
<!--&lt;!&ndash; android:layout_width="200dp"&ndash;&gt;-->
<!--&lt;!&ndash; android:layout_height="200dp"&ndash;&gt;-->
<!--&lt;!&ndash; android:layout_centerInParent="true"&ndash;&gt;-->
<!--&lt;!&ndash; app:lottie_rawRes="@raw/like_misha_v2"&ndash;&gt;-->
<!--&lt;!&ndash; app:lottie_speed="3" />&ndash;&gt;-->
<!-- -->
<!-- &lt;!&ndash; <ImageView&ndash;&gt;-->
<!-- &lt;!&ndash; android:layout_width="match_parent"&ndash;&gt;-->
<!-- &lt;!&ndash; android:layout_height="@dimen/dp_300"&ndash;&gt;-->
<!-- &lt;!&ndash; android:paddingTop="10dp"&ndash;&gt;-->
<!-- &lt;!&ndash; android:scaleType="fitCenter"&ndash;&gt;-->
<!-- &lt;!&ndash; android:src="@drawable/melberry_char_purple" />&ndash;&gt;-->
<!-- </LinearLayout>-->
<!-- Amount and currency section -->
<LinearLayout
@ -68,6 +97,7 @@
android:layout_marginTop="20dp"
android:orientation="horizontal"
android:weightSum="2"
android:padding="16dp"
android:paddingHorizontal="1dp">
<!-- Left side - Face ID Card -->
@ -86,7 +116,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#8c1084"
android:background="#71168d"
android:padding="5dp">
<!-- Inner Card (Purple Background) -->
@ -159,7 +189,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#8c1084"
android:background="#71168d"
android:padding="3dp">
<!-- QR Code Image -->
@ -168,7 +198,7 @@
android:layout_width="match_parent"
android:layout_height="170dp"
android:scaleType="fitCenter"
android:src="@drawable/am_qr_code_mag_black"
android:src="@drawable/qr_site"
android:contentDescription="@string/qr_code_description"
app:imageBitmap="@{vm.qrCodeBitmap}" />
@ -195,22 +225,23 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="visible"
android:visibility="gone"
android:scaleType="centerCrop"
android:background="@android:color/black">
<!-- Camera Preview will be added here programmatically -->
<FrameLayout
android:id="@+id/camera_preview_holder"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="centerCrop"
android:layout_gravity="center">
<!-- <FrameLayout-->
<!-- android:id="@+id/camera_preview_holder"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="0dp"-->
<!-- android:layout_weight="1"-->
<!-- android:scaleType="centerCrop"-->
<!-- android:layout_gravity="center">-->
<!-- Camera Preview will be added here -->
<!-- &lt;!&ndash; Camera Preview will be added here &ndash;&gt;-->
</FrameLayout>
<!-- </FrameLayout>-->
<TextView
android:id="@+id/amountOnCamera"
@ -255,5 +286,44 @@
android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:id="@+id/yuzpay_id"
android:layout_width="match_parent"
android:layout_height="112dp"
app:layout_constraintTop_toBottomOf="@id/amountOnCamera"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_gravity="bottom"
android:background="@color/colorMulberry"
android:visibility="gone"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_gravity="center"
android:src="@drawable/logo_yuz_pay_white" />
</LinearLayout>
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:paddingRight="20dp"-->
<!-- app:layout_constraintTop_toBottomOf="@id/amountOnCamera"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- -->
<!-- android:text="Смотрите в камеру\nЛицо должно быть в рамке"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="18sp" -->
<!-- android:padding="16dp"-->
<!-- android:background="@drawable/rounded_bg_black_50"-->
<!-- android:visibility="visible" />-->
</FrameLayout>
</layout>

Binary file not shown.

Binary file not shown.

View File

@ -9,7 +9,10 @@
<!-- <color name="colorPrimary">#3F51B5</color>-->
<color name="colorPrimary">#8c1084</color>
<color name="colorMulberry">#8c1084</color>
<!-- <color name="colorMulberry">#8c1084</color>-->
<color name="colorMulberry">#71168d</color>
<color name="colorMulberryNew">#8f25c3</color>
<color name="colorPrimarys">#8c1084</color>
<color name="colorPrimaryDark">#8c1084</color>
<color name="colorAccent">#FF4081</color>

View File

@ -49,7 +49,7 @@
<style name="Theme.Despreaddemo1" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- 主要颜色 -->
<item name="colorPrimary">@color/number_button_background</item>
<item name="colorPrimary">@color/colorMulberryNew</item>
<item name="colorPrimaryVariant">@color/button_stroke</item>
<item name="colorOnPrimary">@color/number_button_text</item>
@ -59,7 +59,7 @@
<item name="colorOnSecondary">@color/confirm_button_text</item>
<!-- 状态栏颜色 -->
<item name="android:statusBarColor">@color/keyboard_background</item>
<item name="android:statusBarColor">@color/colorMulberryNew</item>
<!-- 按钮默认样式 -->
<item name="materialButtonStyle">@style/NumberKeyboardButton</item>