rotate image by 90 immediately after pressing the bottom action icon

This commit is contained in:
tibbi 2018-07-01 13:05:38 +02:00
parent 047a9e3e47
commit b0653ae2cc
2 changed files with 1 additions and 18 deletions

View File

@ -28,12 +28,10 @@ import android.view.WindowManager
import android.view.animation.DecelerateInterpolator
import com.bumptech.glide.Glide
import com.simplemobiletools.commons.dialogs.PropertiesDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.dialogs.RenameItemDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.FileDirItem
import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.adapters.MyPagerAdapter
import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask
@ -800,18 +798,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
bottom_rotate.setOnClickListener {
if (bottom_actions.alpha == 1f) {
val items = arrayListOf(
RadioItem(ROTATE_RIGHT, getString(R.string.rotate_right)),
RadioItem(ROTATE_LEFT, getString(R.string.rotate_left)),
RadioItem(ROTATE_ONE_EIGHTY, getString(R.string.rotate_one_eighty)))
RadioGroupDialog(this, items) {
when (it as Int) {
ROTATE_RIGHT -> rotateImage(90)
ROTATE_LEFT -> rotateImage(270)
ROTATE_ONE_EIGHTY -> rotateImage(180)
}
}
rotateImage(90)
}
}

View File

@ -131,10 +131,6 @@ const val GROUP_BY_EXTENSION = 16
const val GROUP_BY_FOLDER = 32
const val GROUP_DESCENDING = 1024
const val ROTATE_RIGHT = 1
const val ROTATE_LEFT = 2
const val ROTATE_ONE_EIGHTY = 3
// bottom actions
const val BOTTOM_ACTION_TOGGLE_FAVORITE = 1
const val BOTTOM_ACTION_EDIT = 2