diff --git a/app/src/main/java/com/example/bondoman/fragments/ScanReceiptFragment.kt b/app/src/main/java/com/example/bondoman/fragments/ScanReceiptFragment.kt index d0d2b3de9a4123266971259281727b580c356f2a..ead26164fc04438d6fa8bc2c1140d87155c3c515 100644 --- a/app/src/main/java/com/example/bondoman/fragments/ScanReceiptFragment.kt +++ b/app/src/main/java/com/example/bondoman/fragments/ScanReceiptFragment.kt @@ -63,7 +63,7 @@ class ScanReceiptFragment : Fragment() { } // Set up the listeners for take photo and video capture button - viewBinding.imageCaptureButton.setOnClickListener{ takePhoto() } + viewBinding.receiptCaptureButton.setOnClickListener{ takePhoto() } cameraExecutor = Executors.newSingleThreadExecutor() } diff --git a/app/src/main/res/layout/fragment_scan_receipt.xml b/app/src/main/res/layout/fragment_scan_receipt.xml index 0a28c5c8ab42332fa13e2ace4711e8230cb66f7e..2f50e6e2462f3b1a80d0b075eb856e182dc7bda3 100644 --- a/app/src/main/res/layout/fragment_scan_receipt.xml +++ b/app/src/main/res/layout/fragment_scan_receipt.xml @@ -10,17 +10,41 @@ <androidx.camera.view.PreviewView android:id="@+id/camera_preview" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="0dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHeight_percent="0.85" /> - <Button - android:id="@+id/image_capture_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + <ImageButton + android:id="@+id/receipt_capture_button" + android:theme="@style/teal200RoundBackground" + android:layout_width="50dp" + android:layout_height="50dp" + android:background="@drawable/bg_full_border" + android:src="@drawable/ic_camera" + android:contentDescription="@string/capture" android:elevation="2dp" - android:text="Capture" + app:layout_constraintTop_toBottomOf="@id/camera_preview" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" - android:layout_marginBottom="15dp" /> + app:tint="@color/zinc_800" /> + + <ImageButton + android:id="@+id/gallery_button" + android:theme="@style/transparentRoundBackground" + android:layout_width="30dp" + android:layout_height="30dp" + android:elevation="2dp" + android:src="@drawable/ic_library_photo" + android:background="@drawable/bg_full_border" + android:layout_marginStart="20dp" + android:scaleType="fitCenter" + android:contentDescription="@string/gallery" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/camera_preview" + app:layout_constraintBottom_toBottomOf="parent" + app:tint="@color/zinc_300" /> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4552bf5c721512660c15aa043e2fd7b0817a58fd..96db0b83feab6ff63ddbcf739226957d133deaf1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,4 +20,6 @@ <string name="dummy_page_title">Title</string> <string name="text_edit_button">Edit</string> <string name="text_transaction_category">OUTCOME</string> + <string name="capture">Capture receipt</string> + <string name="gallery">Gallery</string> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index d14257aa3708c324dc50f86b352cf24725574542..abaf76ca97f3c8d3f864573f44e680df43b43c10 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -102,6 +102,11 @@ <item name="backgroundColor">@color/teal_200</item> <item name="borderRadius">100dp</item> </style> + <style name="transparentRoundBackground"> + <item name="borderColor">@android:color/transparent</item> + <item name="backgroundColor">@android:color/transparent</item> + <item name="borderRadius">100dp</item> + </style> <style name="swipeButtonBackground"> <item name="borderColor">@android:color/transparent</item> <item name="backgroundColor">@color/zinc_200</item>