Skip to content

Commit

Permalink
fix(platform): Fix edge to edge glitch in TakePhotoActivity
Browse files Browse the repository at this point in the history
Refs: #1713

Signed-off-by: Stefan Niedermann <[email protected]>
  • Loading branch information
stefan-niedermann committed Jan 3, 2025
1 parent 4256199 commit 03dd71e
Showing 1 changed file with 52 additions and 46 deletions.
98 changes: 52 additions & 46 deletions app/src/main/res/layout/activity_take_photo.xml
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:orientation="vertical"
tools:theme="@style/TransparentTheme">

<androidx.camera.view.PreviewView
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/mdtp_transparent_black"
app:layout_constraintBottom_toBottomOf="parent">
android:layout_height="match_parent"
android:background="@android:color/black"
android:orientation="vertical"
tools:theme="@style/TransparentTheme">

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/switchCamera"
style="?attr/floatingActionButtonSmallSecondaryStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/take_photo_switch_camera"
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
app:layout_constraintEnd_toStartOf="@id/takePhoto"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/takePhoto"
tools:srcCompat="@drawable/ic_camera_front_24" />
<androidx.camera.view.PreviewView
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/takePhoto"
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/take_photo"
android:layout_alignParentBottom="true"
android:background="@color/mdtp_transparent_black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/toggle_torch"
app:layout_constraintStart_toEndOf="@id/switchCamera"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_photo_camera_24" />
android:fitsSystemWindows="true">

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/toggle_torch"
style="?attr/floatingActionButtonSmallSecondaryStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/take_photo_toggle_torch"
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/takePhoto"
app:layout_constraintTop_toTopOf="@id/takePhoto"
tools:srcCompat="@drawable/ic_flash_on_24" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/switchCamera"
style="?attr/floatingActionButtonSmallSecondaryStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/take_photo_switch_camera"
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
app:layout_constraintEnd_toStartOf="@id/takePhoto"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/takePhoto"
tools:srcCompat="@drawable/ic_camera_front_24" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/takePhoto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/take_photo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/toggle_torch"
app:layout_constraintStart_toEndOf="@id/switchCamera"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_photo_camera_24" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/toggle_torch"
style="?attr/floatingActionButtonSmallSecondaryStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/take_photo_toggle_torch"
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/takePhoto"
app:layout_constraintTop_toTopOf="@id/takePhoto"
tools:srcCompat="@drawable/ic_flash_on_24" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 comments on commit 03dd71e

Please sign in to comment.