mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
improve camera layout
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
56d57c0b37
commit
547e9ebf8b
@ -91,11 +91,11 @@ public class TakePhotoActivity extends AppCompatActivity {
|
|||||||
viewModel.getCameraSelectorToggleButtonImageResource()
|
viewModel.getCameraSelectorToggleButtonImageResource()
|
||||||
.observe(
|
.observe(
|
||||||
this,
|
this,
|
||||||
res -> binding.switchCamera.setImageDrawable(ContextCompat.getDrawable(this, res)));
|
res -> binding.switchCamera.setIcon(ContextCompat.getDrawable(this, res)));
|
||||||
viewModel.getTorchToggleButtonImageResource()
|
viewModel.getTorchToggleButtonImageResource()
|
||||||
.observe(
|
.observe(
|
||||||
this,
|
this,
|
||||||
res -> binding.toggleTorch.setImageDrawable(ContextCompat.getDrawable(this, res)));
|
res -> binding.toggleTorch.setIcon(ContextCompat.getDrawable(this, res)));
|
||||||
viewModel.isTorchEnabled()
|
viewModel.isTorchEnabled()
|
||||||
.observe(
|
.observe(
|
||||||
this,
|
this,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
<!--
|
|
||||||
~ Nextcloud Talk application
|
~ Nextcloud Talk application
|
||||||
~
|
~
|
||||||
~ @author Andy Scherzinger
|
~ @author Andy Scherzinger
|
||||||
@ -35,53 +34,73 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<com.google.android.material.button.MaterialButton
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/toggle_torch"
|
||||||
android:layout_height="wrap_content"
|
style="@style/Widget.AppTheme.Button.IconButton"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_width="48dp"
|
||||||
android:background="@color/transparent_black"
|
android:layout_height="48dp"
|
||||||
android:paddingTop="@dimen/standard_padding"
|
android:layout_alignParentTop="true"
|
||||||
android:paddingBottom="@dimen/standard_double_padding"
|
android:layout_alignParentEnd="true"
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:contentDescription="@string/take_photo_toggle_torch"
|
||||||
|
android:insetLeft="4dp"
|
||||||
|
android:insetTop="4dp"
|
||||||
|
android:insetRight="4dp"
|
||||||
|
android:insetBottom="4dp"
|
||||||
|
android:tint="@color/white"
|
||||||
|
app:backgroundTint="#99121212"
|
||||||
|
app:cornerRadius="@dimen/button_corner_radius"
|
||||||
|
app:elevation="0dp"
|
||||||
|
app:icon="@drawable/ic_baseline_flash_on_24"
|
||||||
|
app:iconGravity="textStart"
|
||||||
|
app:iconPadding="0dp"
|
||||||
|
app:iconSize="24dp"
|
||||||
|
app:iconTint="@color/white"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/switchCamera"
|
android:id="@+id/switchCamera"
|
||||||
android:layout_width="wrap_content"
|
style="@style/Widget.AppTheme.Button.IconButton"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
android:contentDescription="@string/take_photo_switch_camera"
|
android:contentDescription="@string/take_photo_switch_camera"
|
||||||
|
android:insetLeft="4dp"
|
||||||
|
android:insetTop="4dp"
|
||||||
|
android:insetRight="4dp"
|
||||||
|
android:insetBottom="4dp"
|
||||||
|
android:padding="0dp"
|
||||||
android:tint="@android:color/white"
|
android:tint="@android:color/white"
|
||||||
app:backgroundTint="@color/colorPrimary"
|
app:backgroundTint="#99121212"
|
||||||
app:fabSize="mini"
|
app:cornerRadius="@dimen/button_corner_radius"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
|
app:elevation="0dp"
|
||||||
app:layout_constraintEnd_toStartOf="@id/takePhoto"
|
app:icon="@drawable/ic_baseline_camera_front_24"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:iconGravity="textStart"
|
||||||
app:layout_constraintTop_toTopOf="@id/takePhoto"
|
app:iconPadding="0dp"
|
||||||
tools:srcCompat="@drawable/ic_baseline_camera_front_24" />
|
app:iconSize="24dp"
|
||||||
|
app:iconTint="@color/white"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/toggle_torch"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
android:id="@+id/takePhoto"
|
android:id="@+id/takePhoto"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginBottom="@dimen/standard_double_margin"
|
||||||
android:contentDescription="@string/take_photo"
|
android:contentDescription="@string/take_photo"
|
||||||
android:tint="@android:color/white"
|
android:tint="@android:color/white"
|
||||||
app:backgroundTint="@color/colorPrimary"
|
app:backgroundTint="@color/colorPrimary"
|
||||||
|
app:fabCustomSize="72dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/toggle_torch"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/switchCamera"
|
|
||||||
app:srcCompat="@drawable/ic_baseline_photo_camera_24" />
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/toggle_torch"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:contentDescription="@string/take_photo_toggle_torch"
|
|
||||||
android:tint="@android:color/white"
|
|
||||||
app:backgroundTint="@color/colorPrimary"
|
|
||||||
app:fabSize="mini"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/takePhoto"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/takePhoto"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/takePhoto"
|
app:srcCompat="@drawable/ic_baseline_photo_camera_24" />
|
||||||
tools:srcCompat="@drawable/ic_baseline_flash_on_24" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
<item name="elevation">1dp</item>
|
<item name="elevation">1dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TransparentTheme" parent="Theme.AppCompat.NoActionBar">
|
<style name="TransparentTheme" parent="Theme.MaterialComponents.NoActionBar.Bridge">
|
||||||
<item name="android:windowNoTitle">true</item>
|
<item name="android:windowNoTitle">true</item>
|
||||||
<item name="android:windowBackground">@android:color/background_dark</item>
|
<item name="android:windowBackground">@android:color/background_dark</item>
|
||||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user