Add CameraXFlashToggleView and selfie flash.

This commit is contained in:
alex-signal
2019-09-06 13:28:54 -03:00
committed by Greyson Parrelli
parent 70347e754c
commit f81c0b448e
24 changed files with 298 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<item app:state_flash_auto="true" android:drawable="@drawable/flash_auto_32" />
<item app:state_flash_off="true" android:drawable="@drawable/flash_off_32" />
<item app:state_flash_on="true" android:drawable="@drawable/flash_on_32" />
</selector>

View File

@@ -17,6 +17,16 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<org.thoughtcrime.securesms.mediasend.camerax.CameraXFlashToggleView
android:id="@+id/camera_flash_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:src="@drawable/camerax_flash_toggle"
app:layout_constraintStart_toEndOf="@+id/camera_flip_button"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/camera_flip_button"
android:layout_width="wrap_content"
@@ -60,5 +70,16 @@
app:layout_constraintEnd_toEndOf="@id/camera_capture_button"
tools:visibility="visible" />
<View
android:id="@+id/camera_selfie_flash"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha="0"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/white" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -17,6 +17,16 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<org.thoughtcrime.securesms.mediasend.camerax.CameraXFlashToggleView
android:id="@+id/camera_flash_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:layout_marginEnd="16dp"
android:src="@drawable/camerax_flash_toggle"
app:layout_constraintEnd_toStartOf="@+id/camera_flip_button"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/camera_flip_button"
android:layout_width="wrap_content"
@@ -61,5 +71,16 @@
app:layout_constraintEnd_toEndOf="parent"
tools:visibility="visible" />
<View
android:id="@+id/camera_selfie_flash"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha="0"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/white" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -362,4 +362,10 @@
<enum name="top" value="1" />
</attr>
</declare-styleable>
<declare-styleable name="CameraXFlashState">
<attr name="state_flash_auto" format="boolean" />
<attr name="state_flash_off" format="boolean" />
<attr name="state_flash_on" format="boolean" />
</declare-styleable>
</resources>