allow clicking through bottom action items in fullscreen mode

This commit is contained in:
tibbi 2018-07-02 11:02:17 +02:00
parent cc5a5988ea
commit 9101f9e7f3
1 changed files with 22 additions and 40 deletions

View File

@ -250,6 +250,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
checkSystemUI()
if (!bottom_actions.isGone()) {
bottom_actions.animate().alpha(if (mIsFullScreen) 0f else 1f).start()
arrayOf(bottom_favorite, bottom_edit, bottom_share, bottom_delete, bottom_rotate, bottom_properties, bottom_change_orientation,
bottom_slideshow, bottom_show_on_map, bottom_toggle_file_visibility, bottom_rename).forEach {
it.isClickable = !mIsFullScreen
}
}
}
}
@ -776,48 +780,35 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0
bottom_favorite.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_TOGGLE_FAVORITE != 0)
bottom_favorite.setOnClickListener {
if (bottom_actions.alpha == 1f) {
toggleFavorite()
}
}
bottom_edit.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_EDIT != 0)
bottom_edit.setOnClickListener {
if (bottom_actions.alpha == 1f) {
openEditor(getCurrentPath())
}
}
bottom_share.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_SHARE != 0)
bottom_share.setOnClickListener {
if (bottom_actions.alpha == 1f) {
shareMediumPath(getCurrentPath())
}
}
bottom_delete.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_DELETE != 0)
bottom_delete.setOnClickListener {
if (bottom_actions.alpha == 1f) {
checkDeleteConfirmation()
}
}
bottom_rotate.setOnClickListener {
if (bottom_actions.alpha == 1f) {
rotateImage(90)
}
}
bottom_properties.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_PROPERTIES != 0)
bottom_properties.setOnClickListener {
if (bottom_actions.alpha == 1f) {
showProperties()
}
}
bottom_change_orientation.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_CHANGE_ORIENTATION != 0)
bottom_change_orientation.setOnClickListener {
if (bottom_actions.alpha == 1f) {
requestedOrientation = when (requestedOrientation) {
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT -> ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE -> ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
@ -826,40 +817,31 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
mIsOrientationLocked = requestedOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
updateBottomActionIcons(getCurrentMedium())
}
}
bottom_slideshow.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_SLIDESHOW != 0)
bottom_slideshow.setOnClickListener {
if (bottom_actions.alpha == 1f) {
initSlideshow()
}
}
bottom_show_on_map.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_SHOW_ON_MAP != 0)
bottom_show_on_map.setOnClickListener {
if (bottom_actions.alpha == 1f) {
showOnMap()
}
}
bottom_toggle_file_visibility.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY != 0)
bottom_toggle_file_visibility.setOnClickListener {
if (bottom_actions.alpha == 1f) {
getCurrentMedium()?.apply {
toggleFileVisibility(!isHidden()) {
updateBottomActionIcons(getCurrentMedium())
}
}
}
}
bottom_rename.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_RENAME != 0)
bottom_rename.setOnClickListener {
if (bottom_actions.alpha == 1f) {
renameFile()
}
}
}
private fun updateBottomActionIcons(medium: Medium?) {
if (medium == null) {