From 87f90879ea6bbf84b9bb30e9552708e447a87c76 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 18 Jul 2018 20:07:47 +0200 Subject: [PATCH] replace the editors Flip menu items with bottom actions --- .../gallery/activities/EditActivity.kt | 18 ++++++++--------- .../{ic_flip.png => ic_flip_horizontally.png} | Bin .../res/drawable-hdpi/ic_flip_vertically.png | Bin 0 -> 344 bytes .../{ic_flip.png => ic_flip_horizontally.png} | Bin .../res/drawable-xhdpi/ic_flip_vertically.png | Bin 0 -> 297 bytes .../{ic_flip.png => ic_flip_horizontally.png} | Bin .../drawable-xxhdpi/ic_flip_vertically.png | Bin 0 -> 442 bytes .../{ic_flip.png => ic_flip_horizontally.png} | Bin .../drawable-xxxhdpi/ic_flip_vertically.png | Bin 0 -> 684 bytes .../main/res/layout/bottom_editor_actions.xml | 19 ++++++++++++++---- app/src/main/res/menu/menu_editor.xml | 19 +++--------------- 11 files changed, 26 insertions(+), 30 deletions(-) rename app/src/main/res/drawable-hdpi/{ic_flip.png => ic_flip_horizontally.png} (100%) create mode 100644 app/src/main/res/drawable-hdpi/ic_flip_vertically.png rename app/src/main/res/drawable-xhdpi/{ic_flip.png => ic_flip_horizontally.png} (100%) create mode 100644 app/src/main/res/drawable-xhdpi/ic_flip_vertically.png rename app/src/main/res/drawable-xxhdpi/{ic_flip.png => ic_flip_horizontally.png} (100%) create mode 100644 app/src/main/res/drawable-xxhdpi/ic_flip_vertically.png rename app/src/main/res/drawable-xxxhdpi/{ic_flip.png => ic_flip_horizontally.png} (100%) create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_flip_vertically.png diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index b342019df..3eb5c1fdb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -115,8 +115,6 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.save_as -> crop_image_view.getCroppedImageAsync() - R.id.flip_horizontally -> flipImage(true) - R.id.flip_vertically -> flipImage(false) R.id.edit -> editWith() else -> return super.onOptionsItemSelected(item) } @@ -132,6 +130,14 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener bottom_resize.setOnClickListener { resizeImage() } + + bottom_flip_horizontally.setOnClickListener { + crop_image_view.flipImageHorizontally() + } + + bottom_flip_vertically.setOnClickListener { + crop_image_view.flipImageVertically() + } } private fun resizeImage() { @@ -258,14 +264,6 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener out.close() } - private fun flipImage(horizontally: Boolean) { - if (horizontally) { - crop_image_view.flipImageHorizontally() - } else { - crop_image_view.flipImageVertically() - } - } - private fun editWith() { openEditor(uri.toString()) isEditingWithThirdParty = true diff --git a/app/src/main/res/drawable-hdpi/ic_flip.png b/app/src/main/res/drawable-hdpi/ic_flip_horizontally.png similarity index 100% rename from app/src/main/res/drawable-hdpi/ic_flip.png rename to app/src/main/res/drawable-hdpi/ic_flip_horizontally.png diff --git a/app/src/main/res/drawable-hdpi/ic_flip_vertically.png b/app/src/main/res/drawable-hdpi/ic_flip_vertically.png new file mode 100644 index 0000000000000000000000000000000000000000..eff105482434518e0d87acd05bd73ce1f10013b1 GIT binary patch literal 344 zcmV-e0jK_nP)e6Mc;M!@0k4lB1^T zn~qZC@_RiLfT!fWsG(ebZ_29TRY-f{QjDGdpCfS8`L$3H(OnM(4m-aVI@u}HnkFJz z+rZzT{mXLsCpTryP>#tN@|yZHi9@==6e9H8)obWIiEraG7H`=Tokej>R^Fm`YL%V? qH^Al4GIaQ2TbY-$R_R9LhkOID`V9W&W#+K}0000X3_mwG}IsJ*h zqvMR&$)*(FO_C?7jGpkG?0WKT_NVDRtihi@uTb=Or=~SyQuxAoVv-A3H@q@4*}Q#E z`Gqr;*=er>!Y9^??e17C9+|iDc)U-rx;(Ff(!O2QuP;bHoU?Zxw|%|%B?hHO-uIdB znKYR5KJaC(h<4k==J4J5>d)$hysR5VEmAa$!Zvun@r+@xV7l=n<4dDm4t*YN>?;bkT8GhBwlx9 z&-9tDRv-UIw@FpRnw0pvF#*lKwdwB0+T`E&zNI+ktrLBwzU}w6^*QCAwBwrI*4{qs zC3Z*6e#74B@s&+)*S!r~%AGe!-eTwEZAOZo(;JF@={6oj9AIFnrT^c)16d> zH~rOG`TO<5pl5dfua~XYvDaPt=FDkkh7FRNj{gZdo|Sv+%>2C?|Dr`i7A#<3W!2zd zXz2a=Ha6wr^v3^BURz6j2a9SrI5KiEF(f2^jMX_{3+8bJ1T-`;!L&hya@32HJ$KvJ z$9#UDaoI;>ck{exo}ksseKevk#CAJoO^piv_P(!g$-X6r&4fc!R91$2&2&9@g->hg z9#5;OCOMW7ymG2@Q%+5sW^vR@Q-4y`q;+36&OX+AEV_5*5_Zq+lltthgM!H9JKq+i V?&+>({GC7^gQu&X%Q~loCIEV$u^9jW literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_flip.png b/app/src/main/res/drawable-xxxhdpi/ic_flip_horizontally.png similarity index 100% rename from app/src/main/res/drawable-xxxhdpi/ic_flip.png rename to app/src/main/res/drawable-xxxhdpi/ic_flip_horizontally.png diff --git a/app/src/main/res/drawable-xxxhdpi/ic_flip_vertically.png b/app/src/main/res/drawable-xxxhdpi/ic_flip_vertically.png new file mode 100644 index 0000000000000000000000000000000000000000..0053524c44b32de8f1d50cd2cf7b7f5fad36fe39 GIT binary patch literal 684 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGooCO|{#S9F5M?jcysy3fA0|Qf> zr;B4q#hkZy9kYZBCE7l!D+T#KXBKiq}j?-Uh=IoLb zzd0k*=h=VLx3|yO*uPlzW%kT-hnE4*CO@$Lz_i2i!Sn00=HA-%(Er$5#`6vC zd!NpUN~;%Ld%L9bx%C6l4=gkCXGm|`)X4a);roHNil^VKUsO7~Ea9K&6G*}xH2q+ zVAjRUUpRN2y{8j13}Gsu!8-Ln`V~XfPKkx666{?F+Nm{3RtEcM|?;zLJ>3us`C@!CK#kiO=Kr*(sdSeux~w d$c}rX|6+M{6o2x{zrf_j;OXk;vd$@?2>|OMDDwaS literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/bottom_editor_actions.xml b/app/src/main/res/layout/bottom_editor_actions.xml index 901fb5cc2..7ffe42837 100644 --- a/app/src/main/res/layout/bottom_editor_actions.xml +++ b/app/src/main/res/layout/bottom_editor_actions.xml @@ -27,19 +27,30 @@ android:layout_height="wrap_content" android:padding="@dimen/medium_margin" android:src="@drawable/ic_minimize" - app:layout_constraintEnd_toStartOf="@+id/bottom_flip" + app:layout_constraintEnd_toStartOf="@+id/bottom_flip_horizontally" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toEndOf="@+id/bottom_rotate"/> + + diff --git a/app/src/main/res/menu/menu_editor.xml b/app/src/main/res/menu/menu_editor.xml index b0e2ad6c9..b72316342 100644 --- a/app/src/main/res/menu/menu_editor.xml +++ b/app/src/main/res/menu/menu_editor.xml @@ -5,23 +5,10 @@ android:id="@+id/save_as" android:icon="@drawable/ic_check" android:title="@string/save_as" - app:showAsAction="always"/> - - - - - - + app:showAsAction="ifRoom"/> + app:showAsAction="ifRoom"/>