From ff66f36cda93e28625e4248ee2c4363356f81e3b Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Fri, 2 Feb 2018 16:28:13 +0300 Subject: [PATCH 1/9] Move side scroll functionality to MediaSideScroll.kt --- .../gallery/fragments/VideoFragment.kt | 159 ++---------------- .../gallery/helpers/MediaSideScroll.kt | 150 +++++++++++++++++ 2 files changed, 168 insertions(+), 141 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 0ee831121..1c3516642 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -7,7 +7,6 @@ import android.net.Uri import android.os.Build import android.os.Bundle import android.os.Handler -import android.provider.Settings import android.support.annotation.RequiresApi import android.util.DisplayMetrics import android.view.* @@ -17,16 +16,17 @@ import android.widget.TextView import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.VideoActivity -import com.simplemobiletools.gallery.activities.ViewPagerActivity -import com.simplemobiletools.gallery.extensions.* +import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.extensions.navigationBarHeight +import com.simplemobiletools.gallery.extensions.usableScreenSize +import com.simplemobiletools.gallery.extensions.windowManager import com.simplemobiletools.gallery.helpers.MEDIUM +import com.simplemobiletools.gallery.helpers.MediaSideScroll import com.simplemobiletools.gallery.models.Medium import kotlinx.android.synthetic.main.pager_video_item.view.* import java.io.IOException class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSeekBarChangeListener { - private val CLICK_MAX_DURATION = 150 - private val SLIDE_INFO_FADE_DELAY = 1000L private val PROGRESS = "progress" private var mMediaPlayer: MediaPlayer? = null @@ -50,21 +50,12 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mDuration = 0 private var mEncodedPath = "" - private var mTouchDownX = 0f - private var mTouchDownY = 0f - private var mTouchDownTime = 0L - private var mTouchDownVolume = 0 - private var mTouchDownBrightness = -1 - private var mTempBrightness = 0 - private var mLastTouchY = 0f - - private var mSlideInfoText = "" - private var mSlideInfoFadeHandler = Handler() - private var mStoredShowExtendedDetails = false private var mStoredHideExtendedDetails = false private var mStoredExtendedDetails = 0 + private lateinit var mediaSideScroll: MediaSideScroll + lateinit var medium: Medium override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { @@ -94,6 +85,13 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee return mView } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + mediaSideScroll = MediaSideScroll(context!!, activity!!, view.slide_info, { + view.video_holder.performClick() + }) + } + override fun onResume() { super.onResume() activity!!.updateTextColors(mView!!.video_holder) @@ -145,13 +143,15 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mSurfaceHolder!!.addCallback(this) mSurfaceView!!.setOnClickListener { toggleFullscreen() } mView!!.video_holder.setOnClickListener { toggleFullscreen() } + mView!!.video_volume_controller.setOnTouchListener { v, event -> - handleVolumeTouched(event) + mediaSideScroll.handleVolumeTouched(event) + true true } mView!!.video_brightness_controller.setOnTouchListener { v, event -> - handleBrightnessTouched(event) + mediaSideScroll.handleBrightnessTouched(event) true } @@ -186,129 +186,6 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee listener?.fragmentClicked() } - private fun handleVolumeTouched(event: MotionEvent) { - when (event.action) { - MotionEvent.ACTION_DOWN -> { - mTouchDownX = event.x - mTouchDownY = event.y - mLastTouchY = event.y - mTouchDownTime = System.currentTimeMillis() - mTouchDownVolume = getCurrentVolume() - mSlideInfoText = "${getString(R.string.volume)}:\n" - } - MotionEvent.ACTION_MOVE -> { - val diffX = mTouchDownX - event.x - val diffY = mTouchDownY - event.y - - if (Math.abs(diffY) > 20 && Math.abs(diffY) > Math.abs(diffX)) { - var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 - percent = Math.min(100, Math.max(-100, percent)) - - if ((percent == 100 && event.y > mLastTouchY) || (percent == -100 && event.y < mLastTouchY)) { - mTouchDownY = event.y - mTouchDownVolume = getCurrentVolume() - } - - volumePercentChanged(percent) - } - mLastTouchY = event.y - } - MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { - val diffX = Math.abs(event.x - mTouchDownX) - val diffY = Math.abs(event.y - mTouchDownY) - if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) { - mView!!.video_holder.performClick() - } - } - } - } - - private fun handleBrightnessTouched(event: MotionEvent) { - when (event.action) { - MotionEvent.ACTION_DOWN -> { - mTouchDownX = event.x - mTouchDownY = event.y - mLastTouchY = event.y - mTouchDownTime = System.currentTimeMillis() - mSlideInfoText = "${getString(R.string.brightness)}:\n" - if (mTouchDownBrightness == -1) - mTouchDownBrightness = getCurrentBrightness() - } - MotionEvent.ACTION_MOVE -> { - val diffX = mTouchDownX - event.x - val diffY = mTouchDownY - event.y - - if (Math.abs(diffY) > 20 && Math.abs(diffY) > Math.abs(diffX)) { - var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 - percent = Math.min(100, Math.max(-100, percent)) - - if ((percent == 100 && event.y > mLastTouchY) || (percent == -100 && event.y < mLastTouchY)) { - mTouchDownY = event.y - mTouchDownBrightness = mTempBrightness - } - - brightnessPercentChanged(percent) - } - mLastTouchY = event.y - } - MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { - val diffX = Math.abs(event.x - mTouchDownX) - val diffY = Math.abs(event.y - mTouchDownY) - if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) { - mView!!.video_holder.performClick() - } - mTouchDownBrightness = mTempBrightness - } - } - mView!!.video_holder - } - - private fun getCurrentVolume() = context!!.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) - - private fun getCurrentBrightness() = Settings.System.getInt(activity!!.contentResolver, Settings.System.SCREEN_BRIGHTNESS) - - private fun volumePercentChanged(percent: Int) { - val stream = AudioManager.STREAM_MUSIC - val maxVolume = context!!.audioManager.getStreamMaxVolume(stream) - val percentPerPoint = 100 / maxVolume - val addPoints = percent / percentPerPoint - val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownVolume + addPoints)) - context!!.audioManager.setStreamVolume(stream, newVolume, 0) - - val absolutePercent = ((newVolume / maxVolume.toFloat()) * 100).toInt() - mView!!.slide_info.apply { - text = "$mSlideInfoText$absolutePercent%" - alpha = 1f - } - - mSlideInfoFadeHandler.removeCallbacksAndMessages(null) - mSlideInfoFadeHandler.postDelayed({ - mView!!.slide_info.animate().alpha(0f) - }, SLIDE_INFO_FADE_DELAY) - } - - private fun brightnessPercentChanged(percent: Int) { - val maxBrightness = 255f - var newBrightness = (mTouchDownBrightness + 2.55 * percent).toFloat() - newBrightness = Math.min(maxBrightness, Math.max(0f, newBrightness)) - mTempBrightness = newBrightness.toInt() - - val absolutePercent = ((newBrightness / maxBrightness) * 100).toInt() - mView!!.slide_info.apply { - text = "$mSlideInfoText$absolutePercent%" - alpha = 1f - } - - val attributes = activity!!.window.attributes - attributes.screenBrightness = absolutePercent / 100f - activity!!.window.attributes = attributes - - mSlideInfoFadeHandler.removeCallbacksAndMessages(null) - mSlideInfoFadeHandler.postDelayed({ - mView!!.slide_info.animate().alpha(0f) - }, SLIDE_INFO_FADE_DELAY) - } - private fun initTimeHolder() { val res = resources val height = context!!.navigationBarHeight diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt new file mode 100644 index 000000000..9536f7abb --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt @@ -0,0 +1,150 @@ +package com.simplemobiletools.gallery.helpers + +import android.app.Activity +import android.content.Context +import android.media.AudioManager +import android.os.Handler +import android.provider.Settings +import android.view.MotionEvent +import android.widget.TextView +import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.activities.ViewPagerActivity +import com.simplemobiletools.gallery.extensions.audioManager + +class MediaSideScroll(val context: Context, val activity: Activity, val slideInfoView: TextView, val onSpecialEvent: () -> Unit) { + private val CLICK_MAX_DURATION = 150 + private val SLIDE_INFO_FADE_DELAY = 1000L + private var mTouchDownX = 0f + private var mTouchDownY = 0f + private var mTouchDownTime = 0L + private var mTouchDownVolume = 0 + private var mTouchDownBrightness = -1 + private var mTempBrightness = 0 + private var mLastTouchY = 0f + + private var mSlideInfoText = "" + private var mSlideInfoFadeHandler = Handler() + + fun handleVolumeTouched(event: MotionEvent) { + when (event.action) { + MotionEvent.ACTION_DOWN -> { + mTouchDownX = event.x + mTouchDownY = event.y + mLastTouchY = event.y + mTouchDownTime = System.currentTimeMillis() + mTouchDownVolume = getCurrentVolume() + mSlideInfoText = "${context.getString(R.string.volume)}:\n" + } + MotionEvent.ACTION_MOVE -> { + val diffX = mTouchDownX - event.x + val diffY = mTouchDownY - event.y + + if (Math.abs(diffY) > 20 && Math.abs(diffY) > Math.abs(diffX)) { + var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 + percent = Math.min(100, Math.max(-100, percent)) + + if ((percent == 100 && event.y > mLastTouchY) || (percent == -100 && event.y < mLastTouchY)) { + mTouchDownY = event.y + mTouchDownVolume = getCurrentVolume() + } + + volumePercentChanged(percent) + } + mLastTouchY = event.y + } + MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { + val diffX = Math.abs(event.x - mTouchDownX) + val diffY = Math.abs(event.y - mTouchDownY) + if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) { + onSpecialEvent() + } + } + } + } + + fun handleBrightnessTouched(event: MotionEvent) { + when (event.action) { + MotionEvent.ACTION_DOWN -> { + mTouchDownX = event.x + mTouchDownY = event.y + mLastTouchY = event.y + mTouchDownTime = System.currentTimeMillis() + mSlideInfoText = "${context.getString(R.string.brightness)}:\n" + if (mTouchDownBrightness == -1) + mTouchDownBrightness = getCurrentBrightness() + } + MotionEvent.ACTION_MOVE -> { + val diffX = mTouchDownX - event.x + val diffY = mTouchDownY - event.y + + if (Math.abs(diffY) > 20 && Math.abs(diffY) > Math.abs(diffX)) { + var percent = ((diffY / ViewPagerActivity.screenHeight) * 100).toInt() * 3 + percent = Math.min(100, Math.max(-100, percent)) + + if ((percent == 100 && event.y > mLastTouchY) || (percent == -100 && event.y < mLastTouchY)) { + mTouchDownY = event.y + mTouchDownBrightness = mTempBrightness + } + + brightnessPercentChanged(percent) + } + mLastTouchY = event.y + } + MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { + val diffX = Math.abs(event.x - mTouchDownX) + val diffY = Math.abs(event.y - mTouchDownY) + if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) { + onSpecialEvent() + } + mTouchDownBrightness = mTempBrightness + } + } + //mView.video_holder + } + + private fun getCurrentVolume() = context.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) + + private fun getCurrentBrightness() = Settings.System.getInt(activity.contentResolver, Settings.System.SCREEN_BRIGHTNESS) + + private fun volumePercentChanged(percent: Int) { + val stream = AudioManager.STREAM_MUSIC + val maxVolume = context.audioManager.getStreamMaxVolume(stream) + val percentPerPoint = 100 / maxVolume + val addPoints = percent / percentPerPoint + val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownVolume + addPoints)) + context.audioManager.setStreamVolume(stream, newVolume, 0) + + val absolutePercent = ((newVolume / maxVolume.toFloat()) * 100).toInt() + slideInfoView.apply { + text = "$mSlideInfoText$absolutePercent%" + alpha = 1f + } + + mSlideInfoFadeHandler.removeCallbacksAndMessages(null) + mSlideInfoFadeHandler.postDelayed({ + slideInfoView.animate().alpha(0f) + }, SLIDE_INFO_FADE_DELAY) + } + + private fun brightnessPercentChanged(percent: Int) { + val maxBrightness = 255f + var newBrightness = (mTouchDownBrightness + 2.55 * percent).toFloat() + newBrightness = Math.min(maxBrightness, Math.max(0f, newBrightness)) + mTempBrightness = newBrightness.toInt() + + val absolutePercent = ((newBrightness / maxBrightness) * 100).toInt() + slideInfoView.apply { + text = "$mSlideInfoText$absolutePercent%" + alpha = 1f + } + + val attributes = activity.window.attributes + attributes.screenBrightness = absolutePercent / 100f + activity.window.attributes = attributes + + mSlideInfoFadeHandler.removeCallbacksAndMessages(null) + mSlideInfoFadeHandler.postDelayed({ + slideInfoView.animate().alpha(0f) + }, SLIDE_INFO_FADE_DELAY) + } +} \ No newline at end of file From abd027e27bf89947052581a952a80c14bbeeac74 Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Fri, 2 Feb 2018 16:32:27 +0300 Subject: [PATCH 2/9] Use MediaSideScroll in PhotoFragment --- .../gallery/fragments/PhotoFragment.kt | 12 ++++++++++ app/src/main/res/layout/pager_photo_item.xml | 24 +++++++++++++++++++ app/src/main/res/values/dimens.xml | 1 + 3 files changed, 37 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 1cb1d5e23..d689fa449 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -30,6 +30,7 @@ import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.GlideRotateTransformation import com.simplemobiletools.gallery.helpers.MEDIUM +import com.simplemobiletools.gallery.helpers.MediaSideScroll import com.simplemobiletools.gallery.models.Medium import it.sephiroth.android.library.exif2.ExifInterface import kotlinx.android.synthetic.main.pager_photo_item.view.* @@ -49,6 +50,8 @@ class PhotoFragment : ViewPagerFragment() { private var storedHideExtendedDetails = false private var storedExtendedDetails = 0 + private lateinit var mediaSideScroll: MediaSideScroll + lateinit var view: ViewGroup lateinit var medium: Medium @@ -58,6 +61,10 @@ class PhotoFragment : ViewPagerFragment() { gif_view.setOnClickListener { photoClicked() } instant_prev_item.setOnClickListener { listener?.goToPrevItem() } instant_next_item.setOnClickListener { listener?.goToNextItem() } + photo_brightness_controller.setOnTouchListener { v, event -> + mediaSideScroll.handleBrightnessTouched(event) + true + } } storeStateVariables() @@ -105,6 +112,11 @@ class PhotoFragment : ViewPagerFragment() { return view } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + mediaSideScroll = MediaSideScroll(context!!, activity!!, view.slide_info, {}) + } + override fun onPause() { super.onPause() storeStateVariables() diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml index e86420b4f..38c9c4c2e 100644 --- a/app/src/main/res/layout/pager_photo_item.xml +++ b/app/src/main/res/layout/pager_photo_item.xml @@ -31,6 +31,30 @@ android:visibility="gone" tools:text="My image\nAnother line"/> + + + + 150dp 24dp 50dp + 150dp 150dp 60dp 72dp From 330d501889c9aa9bbfcb362501b009162b0e3b42 Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Fri, 2 Feb 2018 16:50:19 +0300 Subject: [PATCH 3/9] Remove Context from MediaSideScroll constructor --- .../gallery/fragments/PhotoFragment.kt | 2 +- .../gallery/fragments/VideoFragment.kt | 2 +- .../gallery/helpers/MediaSideScroll.kt | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index d689fa449..0b077c905 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -114,7 +114,7 @@ class PhotoFragment : ViewPagerFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - mediaSideScroll = MediaSideScroll(context!!, activity!!, view.slide_info, {}) + mediaSideScroll = MediaSideScroll(activity!!, view.slide_info, {}) } override fun onPause() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 1c3516642..968ee24b2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -87,7 +87,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - mediaSideScroll = MediaSideScroll(context!!, activity!!, view.slide_info, { + mediaSideScroll = MediaSideScroll(activity!!, view.slide_info, { view.video_holder.performClick() }) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt index 9536f7abb..3aaf33ff0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt @@ -1,7 +1,6 @@ package com.simplemobiletools.gallery.helpers import android.app.Activity -import android.content.Context import android.media.AudioManager import android.os.Handler import android.provider.Settings @@ -11,7 +10,7 @@ import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.extensions.audioManager -class MediaSideScroll(val context: Context, val activity: Activity, val slideInfoView: TextView, val onSpecialEvent: () -> Unit) { +class MediaSideScroll(val activity: Activity, val slideInfoView: TextView, val onSpecialEvent: () -> Unit) { private val CLICK_MAX_DURATION = 150 private val SLIDE_INFO_FADE_DELAY = 1000L private var mTouchDownX = 0f @@ -33,7 +32,7 @@ class MediaSideScroll(val context: Context, val activity: Activity, val slideInf mLastTouchY = event.y mTouchDownTime = System.currentTimeMillis() mTouchDownVolume = getCurrentVolume() - mSlideInfoText = "${context.getString(R.string.volume)}:\n" + mSlideInfoText = "${activity.getString(R.string.volume)}:\n" } MotionEvent.ACTION_MOVE -> { val diffX = mTouchDownX - event.x @@ -69,7 +68,7 @@ class MediaSideScroll(val context: Context, val activity: Activity, val slideInf mTouchDownY = event.y mLastTouchY = event.y mTouchDownTime = System.currentTimeMillis() - mSlideInfoText = "${context.getString(R.string.brightness)}:\n" + mSlideInfoText = "${activity.getString(R.string.brightness)}:\n" if (mTouchDownBrightness == -1) mTouchDownBrightness = getCurrentBrightness() } @@ -102,17 +101,17 @@ class MediaSideScroll(val context: Context, val activity: Activity, val slideInf //mView.video_holder } - private fun getCurrentVolume() = context.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) + private fun getCurrentVolume() = activity.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) private fun getCurrentBrightness() = Settings.System.getInt(activity.contentResolver, Settings.System.SCREEN_BRIGHTNESS) private fun volumePercentChanged(percent: Int) { val stream = AudioManager.STREAM_MUSIC - val maxVolume = context.audioManager.getStreamMaxVolume(stream) + val maxVolume = activity.audioManager.getStreamMaxVolume(stream) val percentPerPoint = 100 / maxVolume val addPoints = percent / percentPerPoint val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownVolume + addPoints)) - context.audioManager.setStreamVolume(stream, newVolume, 0) + activity.audioManager.setStreamVolume(stream, newVolume, 0) val absolutePercent = ((newVolume / maxVolume.toFloat()) * 100).toInt() slideInfoView.apply { From e91bc71ee0149e636d745af48490a600998d1a71 Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Fri, 2 Feb 2018 16:52:23 +0300 Subject: [PATCH 4/9] Add an empty line to the end of MediaSideScroll.kt --- .../com/simplemobiletools/gallery/helpers/MediaSideScroll.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt index 3aaf33ff0..f18cc03e8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt @@ -146,4 +146,4 @@ class MediaSideScroll(val activity: Activity, val slideInfoView: TextView, val o slideInfoView.animate().alpha(0f) }, SLIDE_INFO_FADE_DELAY) } -} \ No newline at end of file +} From b735636ecf6e2b9ceaeb0e09146e96693219f0fe Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Fri, 2 Feb 2018 16:52:58 +0300 Subject: [PATCH 5/9] Remove unused comment --- .../com/simplemobiletools/gallery/helpers/MediaSideScroll.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt index f18cc03e8..35117fc27 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt @@ -98,7 +98,6 @@ class MediaSideScroll(val activity: Activity, val slideInfoView: TextView, val o mTouchDownBrightness = mTempBrightness } } - //mView.video_holder } private fun getCurrentVolume() = activity.audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) From 5ab2bc2fe73f8a642e953e057fb37462b5405ab5 Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Fri, 2 Feb 2018 16:55:12 +0300 Subject: [PATCH 6/9] Join two dimens together --- app/src/main/res/layout/pager_photo_item.xml | 2 +- app/src/main/res/layout/pager_video_item.xml | 4 ++-- app/src/main/res/values/dimens.xml | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml index 38c9c4c2e..9a82b9b16 100644 --- a/app/src/main/res/layout/pager_photo_item.xml +++ b/app/src/main/res/layout/pager_photo_item.xml @@ -33,7 +33,7 @@ diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml index c8ddbf676..30a61c50c 100644 --- a/app/src/main/res/layout/pager_video_item.xml +++ b/app/src/main/res/layout/pager_video_item.xml @@ -15,14 +15,14 @@ 150dp 24dp 50dp - 150dp - 150dp + 150dp 60dp 72dp From 467058583bc37b835a00246ba0953eeebccd3b3e Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Fri, 2 Feb 2018 17:07:49 +0300 Subject: [PATCH 7/9] Rename callback and allow it to be set externally --- .../simplemobiletools/gallery/fragments/PhotoFragment.kt | 2 +- .../simplemobiletools/gallery/fragments/VideoFragment.kt | 5 +++-- .../simplemobiletools/gallery/helpers/MediaSideScroll.kt | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 0b077c905..bac0962cb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -114,7 +114,7 @@ class PhotoFragment : ViewPagerFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - mediaSideScroll = MediaSideScroll(activity!!, view.slide_info, {}) + mediaSideScroll = MediaSideScroll(activity!!, view.slide_info) } override fun onPause() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 968ee24b2..0cab540ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -87,9 +87,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - mediaSideScroll = MediaSideScroll(activity!!, view.slide_info, { + mediaSideScroll = MediaSideScroll(activity!!, view.slide_info) + mediaSideScroll.onClickOnSlider = { view.video_holder.performClick() - }) + } } override fun onResume() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt index 35117fc27..f94ae7411 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaSideScroll.kt @@ -10,7 +10,7 @@ import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.extensions.audioManager -class MediaSideScroll(val activity: Activity, val slideInfoView: TextView, val onSpecialEvent: () -> Unit) { +class MediaSideScroll(val activity: Activity, val slideInfoView: TextView) { private val CLICK_MAX_DURATION = 150 private val SLIDE_INFO_FADE_DELAY = 1000L private var mTouchDownX = 0f @@ -24,6 +24,8 @@ class MediaSideScroll(val activity: Activity, val slideInfoView: TextView, val o private var mSlideInfoText = "" private var mSlideInfoFadeHandler = Handler() + var onClickOnSlider: (() -> Unit)? = null + fun handleVolumeTouched(event: MotionEvent) { when (event.action) { MotionEvent.ACTION_DOWN -> { @@ -55,7 +57,7 @@ class MediaSideScroll(val activity: Activity, val slideInfoView: TextView, val o val diffX = Math.abs(event.x - mTouchDownX) val diffY = Math.abs(event.y - mTouchDownY) if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) { - onSpecialEvent() + onClickOnSlider?.invoke() } } } @@ -93,7 +95,7 @@ class MediaSideScroll(val activity: Activity, val slideInfoView: TextView, val o val diffX = Math.abs(event.x - mTouchDownX) val diffY = Math.abs(event.y - mTouchDownY) if (System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION && diffX < 20 && diffY < 20) { - onSpecialEvent() + onClickOnSlider?.invoke() } mTouchDownBrightness = mTempBrightness } From d884da9b824901cb111abcb118f64923edd70d01 Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Sun, 4 Feb 2018 03:33:51 +0300 Subject: [PATCH 8/9] Allow to toggle photo gestures via settings toggle --- .../gallery/activities/SettingsActivity.kt | 9 +++++++++ .../gallery/fragments/PhotoFragment.kt | 10 ++++++++-- .../gallery/helpers/Config.kt | 4 ++++ .../gallery/helpers/Constants.kt | 1 + app/src/main/res/layout/activity_settings.xml | 20 +++++++++++++++++++ app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-ca/strings.xml | 1 + app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fi/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-gl/strings.xml | 1 + app/src/main/res/values-hr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko-rKR/strings.xml | 1 + app/src/main/res/values-nb/strings.xml | 1 + app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 30 files changed, 67 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 0e75cdddd..6e6537f5f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -50,6 +50,7 @@ class SettingsActivity : SimpleActivity() { setupPasswordProtection() setupAppPasswordProtection() setupDeleteEmptyFolders() + setupAllowPhotoGestures() setupAllowVideoGestures() setupShowMediaCount() setupKeepLastModified() @@ -250,6 +251,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupAllowPhotoGestures() { + settings_allow_photo_gestures.isChecked = config.allowPhotoGestures + settings_allow_photo_gestures_holder.setOnClickListener { + settings_allow_photo_gestures.toggle() + config.allowPhotoGestures = settings_allow_photo_gestures.isChecked + } + } + private fun setupAllowVideoGestures() { settings_allow_video_gestures.isChecked = config.allowVideoGestures settings_allow_video_gestures_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index bac0962cb..bed5b928a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -128,9 +128,15 @@ class PhotoFragment : ViewPagerFragment() { checkExtendedDetails() } + val allowPhotoGestures = context!!.config.allowPhotoGestures val allowInstantChange = context!!.config.allowInstantChange - view.instant_prev_item.beVisibleIf(allowInstantChange) - view.instant_next_item.beVisibleIf(allowInstantChange) + + view.apply { + photo_brightness_controller.beVisibleIf(allowPhotoGestures) + instant_prev_item.beVisibleIf(allowInstantChange) + instant_next_item.beVisibleIf(allowInstantChange) + } + storeStateVariables() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 9f10cbaa1..39c26d6d4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -253,6 +253,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(DELETE_EMPTY_FOLDERS, false) set(deleteEmptyFolders) = prefs.edit().putBoolean(DELETE_EMPTY_FOLDERS, deleteEmptyFolders).apply() + var allowPhotoGestures: Boolean + get() = prefs.getBoolean(ALLOW_PHOTO_GESTURES, true) + set(allowPhotoGestures) = prefs.edit().putBoolean(ALLOW_PHOTO_GESTURES, allowPhotoGestures).apply() + var allowVideoGestures: Boolean get() = prefs.getBoolean(ALLOW_VIDEO_GESTURES, true) set(allowVideoGestures) = prefs.edit().putBoolean(ALLOW_VIDEO_GESTURES, allowVideoGestures).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 33a95e350..70cd2c7b1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -35,6 +35,7 @@ const val SCROLL_HORIZONTALLY = "scroll_horizontally" const val HIDE_SYSTEM_UI = "hide_system_ui" const val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate" const val DELETE_EMPTY_FOLDERS = "delete_empty_folders" +const val ALLOW_PHOTO_GESTURES = "allow_photo_gestures" const val ALLOW_VIDEO_GESTURES = "allow_video_gestures" const val SHOW_MEDIA_COUNT = "show_media_count" const val TEMP_FOLDER_PATH = "temp_folder_path" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 6558a9fb1..95c9e84a9 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -203,6 +203,26 @@ + + + + + + قم بتمرير الصور المصغرة أفقيا إخفاء واجهة النظام تلقائيا عند العرض في وضع ملء الشاشة احذف المجلدات الفارغة بعد حذف محتواها + Allow controlling photo brightness with vertical gestures السماح بالتحكم في صوت الفيديو والسطوع بالإيماءات العمودية إظهار عدد لوسائط المجلد على طريقة العرض الرئيسية استبدال خيار المشاركة مع خيار تدوير في القائمة ملء الشاشة diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index fae7b6b0a..ee0086c84 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -126,6 +126,7 @@ Desplaçar miniatures horizontalment Ocultar automàticament la interficie de usuari del sistema a pantalla complerta Eliminar carpetes buides després d\'esborrar el seu contingut + Allow controlling photo brightness with vertical gestures Permet controlar el volum i la brillantor del vídeo amb gestos verticals Mostrar el número de mitjans de les carpetes a la vista principal Reemplaçar Compartir per Girar al menú de pantalla complerta diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 859adbd5f..68b5670e5 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -126,6 +126,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Delete empty folders after deleting their content + Allow controlling photo brightness with vertical gestures Allow controlling video volume and brightness with vertical gestures Show folder media count on the main view Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 39b4d3634..48215ed88 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -126,6 +126,7 @@ Kacheln horizontal scrollen Systemleiste im Vollbild ausblenden Nach Löschen leere Ordner löschen + Allow controlling photo brightness with vertical gestures Gesten für Videolautstärke/Helligkeit zulassen Medienanzahl bei Ordnern anzeigen Teilen/Drehen im Vollbild-Menü vertauschen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 031a2c97d..e1f5c0ba7 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -126,6 +126,7 @@ Desplazar miniaturas horizontalmente Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa Eliminar carpetas vacias despues de borrar su contenido + Allow controlling photo brightness with vertical gestures Permite controlar el volumen y el brillo del video con gestos verticales Mostrar el conteo de medios de las carpetas en la vista principal Reemplazar Compartir con Girar en el menú de pantalla completa diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 45386c324..130af2791 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -126,6 +126,7 @@ Vieritä pienoiskuvia vaakasuorassa Piilota järjestelmän UI automaattisesti koko näytön mediassa Poista tyhjät kansiot kansion tyhjennyksen jälkeen + Allow controlling photo brightness with vertical gestures Salli videon äänenvoimakkuuden ja kirkkauden säätö pystysuorilla eleillä Show folder media count on the main view Korvaa jakaminen kääntämisellä koko näytön tilassa diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 51702b67f..3934f7ed8 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -126,6 +126,7 @@ Défilement des miniatures horizontalement Masquer automatiquement l\'interface utilisateur si média plein écran Supprimer les dossiers vides après avoir supprimé leur contenu + Allow controlling photo brightness with vertical gestures Permettre le contrôle du volume vidéo et de la luminosité avec des gestes verticaux Afficher le nombre de fichiers dans les dossiers sur l\'écran principal Remplacer Partager par Pivoter si menu en plein écran diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 31b8eb039..fe5afac60 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -126,6 +126,7 @@ Desplazar iconas horizontalmente Agochar controis do sistema cando visualice a pantalla completa Borrar cartafoles baldeiros cando elmine o seu contido + Allow controlling photo brightness with vertical gestures Permitir controlar o volume do vídeo e o brillo con xestos verticáis Mostrar a conta de medios do cartafol na vista principal Substituír Compartir con Rotar no menú de pantalla completa diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 9de39af66..8c5e71f42 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -126,6 +126,7 @@ Listaj sličice horizontalno Automatski sakrij UI sustava pri pregledu datoteka Izbriži prazne direktorije nakon brisanja njihovog sadržaja + Allow controlling photo brightness with vertical gestures Omogući kontrolu glasnoće videa i svjetline pomoću vertikalnih gesti Prikaži broj datoteka u direktoriju na glavnom zaslonu Zamjeni Dijeli s Rotiraj pri pregledu datoteka diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index d2ff7481a..51eddf77e 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -126,6 +126,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Delete empty folders after deleting their content + Allow controlling photo brightness with vertical gestures Allow controlling video volume and brightness with vertical gestures Show folder media count on the main view Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index a040ee80d..49e950261 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -126,6 +126,7 @@ Scorri le miniature orizzontalmente Nascondi UI di sistema con media a schermo intero Elimina cartelle vuote dopo averne eliminato il contenuto + Allow controlling photo brightness with vertical gestures Gestisci il volume e la luminosità dei video con gesti verticali Mostra numero elementi nella cartella Sostituisci Condividi con Ruota a schermo intero diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index c2d4de191..697f54752 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -126,6 +126,7 @@ サムネイル画面を横方向にスクロール フルスクリーン時にシステムUIを非表示にする メディアの削除後にフォルダーが空になった場合、そのフォルダーを削除する + Allow controlling photo brightness with vertical gestures ビデオ再生中に、音量と明るさを縦方向のジェスチャーで変更する Show folder media count on the main view フルスクリーンメニューの「共有」を「回転」に置き換える diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 03a188346..d674a574e 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -126,6 +126,7 @@ 섬네일 수평스크롤 전체화면 모드에서 시스템 UI 숨김 콘텐츠 삭제 후 빈폴더 삭제 + Allow controlling photo brightness with vertical gestures 수직 제스처로 비디오 볼륨 및 밝기 제어 폴더에 포함된 미디어파일 수 표시 전체화면 메뉴의 공유 아이콘을 회전 아이콘으로 변경 diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 342bb2f27..c44e95e83 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -126,6 +126,7 @@ Horisontal rulling av minibilder Skjul automatisk systemlinjer ved mediavisning Slett tomme mapper etter sletting av deres innhold + Allow controlling photo brightness with vertical gestures Tillat å styre videovolum og lysstyrke med vertikale bevegelser Vis mediaantallet i mapper på hovedvisningen Erstatt Del med Roter i meny ved mediavisning diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index be82781f7..a8a41ead3 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -126,6 +126,7 @@ Horizontaal scrollen Statusbalk automatisch verbergen in volledig scherm Lege mappen verwijderen na leegmaken + Allow controlling photo brightness with vertical gestures Volume en helderheid aanpassen met verticale gebaren Aantallen in mappen tonen Menu-item Draaien vastzetten in volledig scherm (in plaats van Delen) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 5b5505b85..f0a5dd403 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -126,6 +126,7 @@ Przewijaj miniatury poziomo Ukrywaj interfejs przy pełnoekranowym podglądzie Usuwaj puste foldery po usunięciu ich zawartości + Allow controlling photo brightness with vertical gestures Zezwalaj na kontrolę jasności i głośności filmów pionowymi gestami Pokazuj liczbę elementów w folderach w głównym widoku Zamień funkcję udostępniania na obracanie w menu pełnoekranowym diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index bb2cdec30..142ab825f 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -126,6 +126,7 @@ Rolar miniaturas horizontalmente Esconder interface do sistema automaticamente quando em tela cheia Apagar pastas vazias após deleter seu conteúdo + Allow controlling photo brightness with vertical gestures Permitir controle do volume e brilho com gestos na vertical Mostrar quantidade de arquivos das pastas Substituir botão "Compartilhar" por "Rotação de tela" quando em tela cheia diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 8afac4e8d..4d8fe5e46 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -126,6 +126,7 @@ Deslocação horizontal de miniaturas Ocultar interface do sistema se em ecrã completo Apagar as pastas vazias depois de remover o seu conteúdo + Allow controlling photo brightness with vertical gestures Permitir controlo do volume e brilho dos vídeos através de gestos verticais Mostrar número de ficheiros na vista principal Substituir a opção Partilhar pela opção Rodar se em ecrã completo diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 69b3df690..9d1a86a1f 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -126,6 +126,7 @@ Прокрутка эскизов по горизонтали Автоматически скрывать системный интерфейс в полноэкранном режиме Удалять пустые папки после удаления их содержимого + Управлять яркостью фото с помощью вертикальных жестов Управлять громкостью и яркостью видео с помощью вертикальных жестов Показывать количество файлов в папках Заменить \"Поделиться\" на \"Повернуть\" в меню полноэкранного режима diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index aeb067881..102e6c1b3 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -126,6 +126,7 @@ Prehliadať miniatúry vodorovne Automaticky skrývať systémové lišty pri celoobrazovkových médiách Odstrániť prázdne priečinky po vymazaní ich obsahu + Allow controlling photo brightness with vertical gestures Povoliť ovládanie hlasitosti a jasu videí vertikálnymi ťahmi Zobraziť počet médií v priečinku na hlavnej obrazovke Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index a4c380455..cff13c4cd 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -126,6 +126,7 @@ Rulla horisontellt genom miniatyrer Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge Ta bort tomma mappar när deras innehåll tas bort + Allow controlling photo brightness with vertical gestures Tillåt styrning av videovolym och videoljusstyrka med vertikala gester Visa antalet mediefiler i varje mapp i huvudvyn Ersätt Dela med Rotera i helskärmsmenyn diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index fdb8ddf11..4b3df55a3 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -126,6 +126,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Delete empty folders after deleting their content + Allow controlling photo brightness with vertical gestures Allow controlling video volume and brightness with vertical gestures Show folder media count on the main view Replace Share with Rotate at fullscreen menu diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 9989b6f9d..b56f181ef 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -126,6 +126,7 @@ 水平滚动缩略图 全屏时自动隐藏状态栏 删除没有内容的空文件夹 + Allow controlling photo brightness with vertical gestures 使用纵向滑动手势控制视频音量和亮度 在主界面显示文件夹媒体计数 替换全屏时菜单栏的“分享”为“旋转” diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index a00a943a1..89272de76 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -126,6 +126,7 @@ 橫向滑動縮圖 全螢幕時自動隱藏系統介面 刪除內容後刪除空白資料夾 + Allow controlling photo brightness with vertical gestures 允許用上下手勢來控制影片的音量和亮度 主畫面顯示資料夾內媒體檔案數量 將全螢幕選單的分享取代為旋轉 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5cea74dfe..9259c090e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -126,6 +126,7 @@ Scroll thumbnails horizontally Automatically hide system UI at fullscreen media Delete empty folders after deleting their content + Allow controlling photo brightness with vertical gestures Allow controlling video volume and brightness with vertical gestures Show folder media count on the main view Replace Share with Rotate at fullscreen menu From cc79c99c04e2104e29c2559716ba5470149cf64d Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sun, 4 Feb 2018 11:58:46 +0100 Subject: [PATCH 9/9] move the Photo gestures toggle from Videos to Fullscreen media section --- app/src/main/res/layout/activity_settings.xml | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 95c9e84a9..444ca3d75 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -203,26 +203,6 @@ - - - - - - + + + + + +