From 7edd87fa4eb7511c610d5226ee5d68c214fb5e8b Mon Sep 17 00:00:00 2001 From: Adam Serbinski Date: Fri, 5 Nov 2021 11:25:19 -0400 Subject: [PATCH] Add crop and low res (2MP) drawables Signed-off-by: Adam Serbinski --- .../nextcloud/talk/activities/TakePhotoActivity.java | 8 ++++---- app/src/main/res/drawable/ic_2mp_24dp.xml | 10 ++++++++++ app/src/main/res/drawable/ic_crop_16_9_24dp.xml | 10 ++++++++++ app/src/main/res/layout/activity_take_picture.xml | 4 ++-- app/src/main/res/values/colors.xml | 2 ++ 5 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/ic_2mp_24dp.xml create mode 100644 app/src/main/res/drawable/ic_crop_16_9_24dp.xml diff --git a/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java b/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java index c14da0b89..7a164fcdf 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java @@ -113,8 +113,8 @@ public class TakePhotoActivity extends AppCompatActivity { binding.toggleCrop.setOnClickListener((v) -> { crop = !crop; - binding.toggleCrop.setIcon(ContextCompat.getDrawable(this, crop ? - R.drawable.ic_baseline_flash_on_24 : R.drawable.ic_baseline_flash_off_24)); + binding.toggleCrop.setBackgroundColor(crop ? getResources().getColor(R.color.colorPrimary) : + getResources().getColor(R.color.camera_bg_tint)); cameraProvider.unbindAll(); camera = cameraProvider.bindToLifecycle( this, @@ -125,8 +125,8 @@ public class TakePhotoActivity extends AppCompatActivity { binding.toggleLowres.setOnClickListener((v) -> { lowres = !lowres; - binding.toggleLowres.setIcon(ContextCompat.getDrawable(this, lowres ? - R.drawable.ic_baseline_flash_on_24 : R.drawable.ic_baseline_flash_off_24)); + binding.toggleLowres.setBackgroundColor(lowres ? getResources().getColor(R.color.colorPrimary) : + getResources().getColor(R.color.camera_bg_tint)); cameraProvider.unbindAll(); camera = cameraProvider.bindToLifecycle( this, diff --git a/app/src/main/res/drawable/ic_2mp_24dp.xml b/app/src/main/res/drawable/ic_2mp_24dp.xml new file mode 100644 index 000000000..e2d85094a --- /dev/null +++ b/app/src/main/res/drawable/ic_2mp_24dp.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_crop_16_9_24dp.xml b/app/src/main/res/drawable/ic_crop_16_9_24dp.xml new file mode 100644 index 000000000..92fc1a646 --- /dev/null +++ b/app/src/main/res/drawable/ic_crop_16_9_24dp.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/activity_take_picture.xml b/app/src/main/res/layout/activity_take_picture.xml index 90af7976f..f9cec0165 100644 --- a/app/src/main/res/layout/activity_take_picture.xml +++ b/app/src/main/res/layout/activity_take_picture.xml @@ -63,7 +63,7 @@ app:backgroundTint="#99121212" app:cornerRadius="@dimen/button_corner_radius" app:elevation="0dp" - app:icon="@drawable/ic_baseline_flash_off_24" + app:icon="@drawable/ic_crop_16_9_24dp" app:iconGravity="textStart" app:iconPadding="0dp" app:iconSize="24dp" @@ -93,7 +93,7 @@ app:backgroundTint="#99121212" app:cornerRadius="@dimen/button_corner_radius" app:elevation="0dp" - app:icon="@drawable/ic_baseline_flash_off_24" + app:icon="@drawable/ic_2mp_24dp" app:iconGravity="textStart" app:iconPadding="0dp" app:iconSize="24dp" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index d8422386c..61726802b 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -89,4 +89,6 @@ #606060 + #99121212 +