Skip to content
Snippets Groups Projects
Commit 537c8da6 authored by I Putu Bakta Hari Sudewa's avatar I Putu Bakta Hari Sudewa
Browse files

Merge branch 'feat/camera' into 'dev'

feat: update scan receipt ui

See merge request !11
parents 07458018 57af643e
2 merge requests!46Dev,!11feat: update scan receipt ui
...@@ -63,7 +63,7 @@ class ScanReceiptFragment : Fragment() { ...@@ -63,7 +63,7 @@ class ScanReceiptFragment : Fragment() {
} }
// Set up the listeners for take photo and video capture button // Set up the listeners for take photo and video capture button
viewBinding.imageCaptureButton.setOnClickListener{ takePhoto() } viewBinding.receiptCaptureButton.setOnClickListener{ takePhoto() }
cameraExecutor = Executors.newSingleThreadExecutor() cameraExecutor = Executors.newSingleThreadExecutor()
} }
......
...@@ -10,17 +10,41 @@ ...@@ -10,17 +10,41 @@
<androidx.camera.view.PreviewView <androidx.camera.view.PreviewView
android:id="@+id/camera_preview" android:id="@+id/camera_preview"
android:layout_width="match_parent" 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 <ImageButton
android:id="@+id/image_capture_button" android:id="@+id/receipt_capture_button"
android:layout_width="wrap_content" android:theme="@style/teal200RoundBackground"
android:layout_height="wrap_content" 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:elevation="2dp"
android:text="Capture" app:layout_constraintTop_toBottomOf="@id/camera_preview"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="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> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -20,4 +20,6 @@ ...@@ -20,4 +20,6 @@
<string name="dummy_page_title">Title</string> <string name="dummy_page_title">Title</string>
<string name="text_edit_button">Edit</string> <string name="text_edit_button">Edit</string>
<string name="text_transaction_category">OUTCOME</string> <string name="text_transaction_category">OUTCOME</string>
<string name="capture">Capture receipt</string>
<string name="gallery">Gallery</string>
</resources> </resources>
\ No newline at end of file
...@@ -102,6 +102,11 @@ ...@@ -102,6 +102,11 @@
<item name="backgroundColor">@color/teal_200</item> <item name="backgroundColor">@color/teal_200</item>
<item name="borderRadius">100dp</item> <item name="borderRadius">100dp</item>
</style> </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"> <style name="swipeButtonBackground">
<item name="borderColor">@android:color/transparent</item> <item name="borderColor">@android:color/transparent</item>
<item name="backgroundColor">@color/zinc_200</item> <item name="backgroundColor">@color/zinc_200</item>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment