mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 08:55:54 +03:00
move flash/flip-cam toggles
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
c78967b6b1
commit
03cb3a66c6
6 changed files with 26 additions and 28 deletions
|
@ -97,10 +97,6 @@ public class TakePhotoActivity extends AppCompatActivity {
|
||||||
imageCapture,
|
imageCapture,
|
||||||
preview);
|
preview);
|
||||||
|
|
||||||
viewModel.getCameraSelectorToggleButtonImageResource()
|
|
||||||
.observe(
|
|
||||||
this,
|
|
||||||
res -> binding.switchCamera.setIcon(ContextCompat.getDrawable(this, res)));
|
|
||||||
viewModel.getTorchToggleButtonImageResource()
|
viewModel.getTorchToggleButtonImageResource()
|
||||||
.observe(
|
.observe(
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -38,9 +38,7 @@ public class TakePictureViewModel extends ViewModel {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private CameraSelector cameraSelector = DEFAULT_BACK_CAMERA;
|
private CameraSelector cameraSelector = DEFAULT_BACK_CAMERA;
|
||||||
@NonNull
|
|
||||||
private final MutableLiveData<Integer> cameraSelectorToggleButtonImageResource =
|
|
||||||
new MutableLiveData<>(R.drawable.ic_baseline_camera_front_24);
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private final MutableLiveData<Boolean> torchEnabled = new MutableLiveData<>(Boolean.FALSE);
|
private final MutableLiveData<Boolean> torchEnabled = new MutableLiveData<>(Boolean.FALSE);
|
||||||
|
|
||||||
|
@ -49,17 +47,11 @@ public class TakePictureViewModel extends ViewModel {
|
||||||
return this.cameraSelector;
|
return this.cameraSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveData<Integer> getCameraSelectorToggleButtonImageResource() {
|
|
||||||
return this.cameraSelectorToggleButtonImageResource;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toggleCameraSelector() {
|
public void toggleCameraSelector() {
|
||||||
if (this.cameraSelector == DEFAULT_BACK_CAMERA) {
|
if (this.cameraSelector == DEFAULT_BACK_CAMERA) {
|
||||||
this.cameraSelector = DEFAULT_FRONT_CAMERA;
|
this.cameraSelector = DEFAULT_FRONT_CAMERA;
|
||||||
this.cameraSelectorToggleButtonImageResource.postValue(R.drawable.ic_baseline_camera_rear_24);
|
|
||||||
} else {
|
} else {
|
||||||
this.cameraSelector = DEFAULT_BACK_CAMERA;
|
this.cameraSelector = DEFAULT_BACK_CAMERA;
|
||||||
this.cameraSelectorToggleButtonImageResource.postValue(R.drawable.ic_baseline_camera_front_24);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
<vector android:height="24dp" android:tint="#757575"
|
|
||||||
android:viewportHeight="24" android:viewportWidth="24"
|
|
||||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<path android:fillColor="@android:color/white" android:pathData="M10,20L5,20v2h5v2l3,-3 -3,-3v2zM14,20v2h5v-2h-5zM12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -1.99,0.9 -1.99,2S10.9,8 12,8zM17,0L7,0C5.9,0 5,0.9 5,2v14c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,2c0,-1.1 -0.9,-2 -2,-2zM7,2h10v10.5c0,-1.67 -3.33,-2.5 -5,-2.5s-5,0.83 -5,2.5L7,2z"/>
|
|
||||||
</vector>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<vector android:height="24dp" android:tint="#757575"
|
|
||||||
android:viewportHeight="24" android:viewportWidth="24"
|
|
||||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<path android:fillColor="@android:color/white" android:pathData="M10,20L5,20v2h5v2l3,-3 -3,-3v2zM14,20v2h5v-2h-5zM17,0L7,0C5.9,0 5,0.9 5,2v14c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,2c0,-1.1 -0.9,-2 -2,-2zM12,6c-1.11,0 -2,-0.9 -2,-2s0.89,-2 1.99,-2 2,0.9 2,2C14,5.1 13.1,6 12,6z"/>
|
|
||||||
</vector>
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M9,12c0,1.66 1.34,3 3,3s3,-1.34 3,-3s-1.34,-3 -3,-3S9,10.34 9,12z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M8,10V8H5.09C6.47,5.61 9.05,4 12,4c3.72,0 6.85,2.56 7.74,6h2.06c-0.93,-4.56 -4.96,-8 -9.8,-8C8.73,2 5.82,3.58 4,6.01V4H2v6H8z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M16,14v2h2.91c-1.38,2.39 -3.96,4 -6.91,4c-3.72,0 -6.85,-2.56 -7.74,-6H2.2c0.93,4.56 4.96,8 9.8,8c3.27,0 6.18,-1.58 8,-4.01V20h2v-6H16z"/>
|
||||||
|
</vector>
|
|
@ -52,6 +52,7 @@
|
||||||
android:layout_marginStart="0dp"
|
android:layout_marginStart="0dp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:contentDescription="@string/take_photo_toggle_torch"
|
android:contentDescription="@string/take_photo_toggle_torch"
|
||||||
android:insetLeft="4dp"
|
android:insetLeft="4dp"
|
||||||
android:insetTop="4dp"
|
android:insetTop="4dp"
|
||||||
|
@ -66,8 +67,9 @@
|
||||||
app:iconPadding="0dp"
|
app:iconPadding="0dp"
|
||||||
app:iconSize="24dp"
|
app:iconSize="24dp"
|
||||||
app:iconTint="@color/white"
|
app:iconTint="@color/white"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintEnd_toStartOf="@id/takePhoto"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/switchCamera"
|
android:id="@+id/switchCamera"
|
||||||
|
@ -79,6 +81,7 @@
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:contentDescription="@string/take_photo_switch_camera"
|
android:contentDescription="@string/take_photo_switch_camera"
|
||||||
android:insetLeft="4dp"
|
android:insetLeft="4dp"
|
||||||
android:insetTop="4dp"
|
android:insetTop="4dp"
|
||||||
|
@ -89,13 +92,14 @@
|
||||||
app:backgroundTint="#99121212"
|
app:backgroundTint="#99121212"
|
||||||
app:cornerRadius="@dimen/button_corner_radius"
|
app:cornerRadius="@dimen/button_corner_radius"
|
||||||
app:elevation="0dp"
|
app:elevation="0dp"
|
||||||
app:icon="@drawable/ic_baseline_camera_front_24"
|
app:icon="@drawable/ic_baseline_flip_camera_android_24"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
app:iconPadding="0dp"
|
app:iconPadding="0dp"
|
||||||
app:iconSize="24dp"
|
app:iconSize="24dp"
|
||||||
app:iconTint="@color/white"
|
app:iconTint="@color/white"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/toggle_torch"
|
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/takePhoto" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/retake"
|
android:id="@+id/retake"
|
||||||
|
|
Loading…
Reference in a new issue