diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt index 64784c34c..e0f76780f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt @@ -63,6 +63,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener private val PRIMARY_ACTION_NONE = 0 private val PRIMARY_ACTION_FILTER = 1 private val PRIMARY_ACTION_CROP_ROTATE = 2 + private val PRIMARY_ACTION_DRAW = 3 private val CROP_ROTATE_NONE = 0 private val CROP_ROTATE_ASPECT_RATIO = 1 @@ -208,6 +209,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener if (isCropIntent) { bottom_primary_filter.beGone() + bottom_primary_draw.beGone() } return false @@ -287,6 +289,10 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener bottom_primary_crop_rotate.setOnClickListener { bottomCropRotateClicked() } + + bottom_primary_draw.setOnClickListener { + bottomDrawClicked() + } } private fun bottomFilterClicked() { @@ -307,6 +313,15 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener updatePrimaryActionButtons() } + private fun bottomDrawClicked() { + currPrimaryAction = if (currPrimaryAction == PRIMARY_ACTION_DRAW) { + PRIMARY_ACTION_NONE + } else { + PRIMARY_ACTION_DRAW + } + updatePrimaryActionButtons() + } + private fun setupCropRotateActionButtons() { bottom_rotate.setOnClickListener { crop_image_view.rotateImage(90) @@ -375,13 +390,14 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener loadDefaultImageView() } - arrayOf(bottom_primary_filter, bottom_primary_crop_rotate).forEach { + arrayOf(bottom_primary_filter, bottom_primary_crop_rotate, bottom_primary_draw).forEach { it.applyColorFilter(Color.WHITE) } val currentPrimaryActionButton = when (currPrimaryAction) { PRIMARY_ACTION_FILTER -> bottom_primary_filter PRIMARY_ACTION_CROP_ROTATE -> bottom_primary_crop_rotate + PRIMARY_ACTION_DRAW -> bottom_primary_draw else -> null } diff --git a/app/src/main/res/drawable-hdpi/ic_draw.png b/app/src/main/res/drawable-hdpi/ic_draw.png new file mode 100644 index 000000000..b2c513174 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_draw.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_draw.png b/app/src/main/res/drawable-xhdpi/ic_draw.png new file mode 100644 index 000000000..534bf7180 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_draw.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_draw.png b/app/src/main/res/drawable-xxhdpi/ic_draw.png new file mode 100644 index 000000000..3e42d0923 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_draw.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_draw.png b/app/src/main/res/drawable-xxxhdpi/ic_draw.png new file mode 100644 index 000000000..6c1924bdf Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_draw.png differ diff --git a/app/src/main/res/layout/bottom_editor_primary_actions.xml b/app/src/main/res/layout/bottom_editor_primary_actions.xml index ecbe0193b..20d8035fd 100644 --- a/app/src/main/res/layout/bottom_editor_primary_actions.xml +++ b/app/src/main/res/layout/bottom_editor_primary_actions.xml @@ -16,7 +16,6 @@ android:src="@drawable/ic_photo_filter" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/bottom_primary_crop_rotate" - app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"/> @@ -28,9 +27,20 @@ android:padding="@dimen/normal_margin" android:src="@drawable/ic_crop_rotate" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintEnd_toStartOf="@+id/bottom_primary_draw" app:layout_constraintStart_toEndOf="@+id/bottom_primary_filter" app:layout_constraintTop_toTopOf="parent"/> + +