mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 08:18:00 +01:00
adding a menu item at viewpager for resizing images
This commit is contained in:
parent
943c4a0cb8
commit
7fda22e5d5
2 changed files with 10 additions and 0 deletions
|
@ -172,6 +172,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
findItem(R.id.menu_move_to).isVisible = visibleBottomActions and BOTTOM_ACTION_MOVE == 0
|
||||
findItem(R.id.menu_save_as).isVisible = rotationDegrees != 0
|
||||
findItem(R.id.menu_print).isVisible = currentMedium.isImage() || currentMedium.isRaw()
|
||||
findItem(R.id.menu_resize).isVisible = currentMedium.isImage()
|
||||
findItem(R.id.menu_hide).isVisible = !currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin()
|
||||
findItem(R.id.menu_unhide).isVisible = currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin()
|
||||
findItem(R.id.menu_add_to_favorites).isVisible = !currentMedium.isFavorite && visibleBottomActions and BOTTOM_ACTION_TOGGLE_FAVORITE == 0 && !currentMedium.getIsInRecycleBin()
|
||||
|
@ -226,6 +227,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
R.id.menu_default_orientation -> toggleOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
||||
R.id.menu_save_as -> saveImageAs()
|
||||
R.id.menu_create_shortcut -> createShortcut()
|
||||
R.id.menu_resize -> resizeImage()
|
||||
R.id.menu_settings -> launchSettings()
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
@ -898,6 +900,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
}
|
||||
|
||||
private fun resizeImage() {
|
||||
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||
if (requestCode == REQUEST_EDIT_IMAGE && resultCode == Activity.RESULT_OK && resultData != null) {
|
||||
mPos = -1
|
||||
|
|
|
@ -115,6 +115,10 @@
|
|||
android:id="@+id/menu_print"
|
||||
android:title="@string/print"
|
||||
app:showAsAction="never"/>
|
||||
<item
|
||||
android:id="@+id/menu_resize"
|
||||
android:title="@string/resize"
|
||||
app:showAsAction="never"/>
|
||||
<item
|
||||
android:id="@+id/menu_show_on_map"
|
||||
android:title="@string/show_on_map"
|
||||
|
|
Loading…
Reference in a new issue