From e58ab7111c2bcf4acc8cb101fe8680fd8c312da2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 22 Mar 2017 22:50:25 +0100 Subject: [PATCH] reuse the same crop image view at Edit and Set Wallpaper activities --- .../gallery/activities/EditActivity.kt | 4 ++-- .../gallery/activities/SetWallpaperActivity.kt | 4 ++-- .../main/res/layout/activity_set_wallpaper.xml | 15 --------------- .../{activity_edit.xml => view_crop_image.xml} | 0 4 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 app/src/main/res/layout/activity_set_wallpaper.xml rename app/src/main/res/layout/{activity_edit.xml => view_crop_image.xml} (100%) 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 92675b824..90acd0001 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -19,7 +19,7 @@ import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.getCompressionFormat import com.simplemobiletools.gallery.extensions.getRealPathFromURI import com.theartofdev.edmodo.cropper.CropImageView -import kotlinx.android.synthetic.main.activity_edit.* +import kotlinx.android.synthetic.main.view_crop_image.* import java.io.File import java.io.FileOutputStream import java.io.OutputStream @@ -33,7 +33,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_edit) + setContentView(R.layout.view_crop_image) if (intent.data == null) { toast(R.string.invalid_image_path) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt index adb99b15d..869f51fdf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt @@ -12,7 +12,7 @@ import android.view.MenuItem import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.gallery.R import com.theartofdev.edmodo.cropper.CropImageView -import kotlinx.android.synthetic.main.activity_edit.* +import kotlinx.android.synthetic.main.view_crop_image.* class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener { private val PICK_IMAGE = 1 @@ -22,7 +22,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_set_wallpaper) + setContentView(R.layout.view_crop_image) if (intent.data == null) { val pickIntent = Intent(applicationContext, MainActivity::class.java) diff --git a/app/src/main/res/layout/activity_set_wallpaper.xml b/app/src/main/res/layout/activity_set_wallpaper.xml deleted file mode 100644 index 7cd5c32f2..000000000 --- a/app/src/main/res/layout/activity_set_wallpaper.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/view_crop_image.xml similarity index 100% rename from app/src/main/res/layout/activity_edit.xml rename to app/src/main/res/layout/view_crop_image.xml