From 1e67fdf065a7970f476484ddc6075f9cdb5e2ea9 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Mon, 11 Feb 2019 18:53:18 -0600 Subject: [PATCH] Improve the camera preview in SendTransactionFragment, so that both the preview and the scan zone are squared. --- .../fragments/SendTransactionFragment.kt | 2 + .../res/drawable/camera_view_background.xml | 6 ++- .../res/layout/fragment_send_transaction.xml | 52 ++++++++++--------- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt index 0bcc144..5680722 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt @@ -351,6 +351,8 @@ class SendTransactionFragment : ConnectedFragment(), ZXingScannerView.ResultHand cameraPreview.setMaskColor(R.color.colorAccent) cameraPreview.setResultHandler(this) cameraPreview.startCamera() + + cameraPreview.scrollY = holderCamera.width / 6 } private fun stopCameraPreview() { diff --git a/app/src/main/res/drawable/camera_view_background.xml b/app/src/main/res/drawable/camera_view_background.xml index 3557241..a738e4f 100644 --- a/app/src/main/res/drawable/camera_view_background.xml +++ b/app/src/main/res/drawable/camera_view_background.xml @@ -1,5 +1,7 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_send_transaction.xml b/app/src/main/res/layout/fragment_send_transaction.xml index 8c128e6..141c97c 100644 --- a/app/src/main/res/layout/fragment_send_transaction.xml +++ b/app/src/main/res/layout/fragment_send_transaction.xml @@ -136,18 +136,32 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tilMemo" /> - + + + + + - - + app:layout_constraintTop_toTopOf="@id/holderCamera" + app:layout_constraintBottom_toBottomOf="@id/holderCamera"/>