make Down gesture closing optional, enabled by default

This commit is contained in:
tibbi 2018-10-22 17:10:31 +02:00
parent 197dec4a26
commit 90d1c521fa
36 changed files with 88 additions and 16 deletions

View file

@ -58,6 +58,7 @@ class SettingsActivity : SimpleActivity() {
setupDeleteEmptyFolders()
setupAllowPhotoGestures()
setupAllowVideoGestures()
setupAllowDownGesture()
setupBottomActions()
setupShowMediaCount()
setupKeepLastModified()
@ -302,6 +303,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupAllowDownGesture() {
settings_allow_down_gesture.isChecked = config.allowDownGesture
settings_allow_down_gesture_holder.setOnClickListener {
settings_allow_down_gesture.toggle()
config.allowDownGesture = settings_allow_down_gesture.isChecked
}
}
private fun setupShowMediaCount() {
settings_show_media_count.isChecked = config.showMediaCount
settings_show_media_count_holder.setOnClickListener {

View file

@ -101,16 +101,18 @@ class PhotoFragment : ViewPagerFragment() {
}
}
gif_view.setOnTouchListener { v, event ->
handleEvent(event)
false
}
subsampling_view.setOnTouchListener { v, event ->
if (view.subsampling_view.scale == mOriginalSubsamplingScale) {
if (context.config.allowDownGesture) {
gif_view.setOnTouchListener { v, event ->
handleEvent(event)
false
}
subsampling_view.setOnTouchListener { v, event ->
if (view.subsampling_view.scale == mOriginalSubsamplingScale) {
handleEvent(event)
}
false
}
false
}
}

View file

@ -88,14 +88,16 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mVolumeSideScroll = video_volume_controller
mCurrTimeView = video_curr_time
video_preview.setOnTouchListener { v, event ->
handleEvent(event)
true
}
if (context.config.allowDownGesture) {
video_preview.setOnTouchListener { v, event ->
handleEvent(event)
true
}
video_surface.setOnTouchListener { v, event ->
handleEvent(event)
false
video_surface.setOnTouchListener { v, event ->
handleEvent(event)
false
}
}
}

View file

@ -399,4 +399,8 @@ class Config(context: Context) : BaseConfig(context) {
var showRecycleBinLast: Boolean
get() = prefs.getBoolean(SHOW_RECYCLE_BIN_LAST, false)
set(showRecycleBinLast) = prefs.edit().putBoolean(SHOW_RECYCLE_BIN_LAST, showRecycleBinLast).apply()
var allowDownGesture: Boolean
get() = prefs.getBoolean(ALLOW_DOWN_GESTURE, true)
set(allowDownGesture) = prefs.edit().putBoolean(ALLOW_DOWN_GESTURE, allowDownGesture).apply()
}

View file

@ -63,6 +63,7 @@ const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images"
const val WAS_SVG_SHOWING_HANDLED = "was_svg_showing_handled"
const val LAST_BIN_CHECK = "last_bin_check"
const val SHOW_HIGHEST_QUALITY = "show_highest_quality"
const val ALLOW_DOWN_GESTURE = "allow_down_gesture"
// slideshow
const val SLIDESHOW_INTERVAL = "slideshow_interval"

View file

@ -644,6 +644,30 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_allow_down_gesture_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_allow_down_gesture"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/allow_down_gesture"
app:switchPadding="@dimen/medium_margin"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_screen_rotation_holder"
android:layout_width="match_parent"

View file

@ -166,6 +166,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">المصغرات</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniatures</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Stark vergrösserbare Bilder</string>
<string name="show_highest_quality">Zeige Bilder in der höchstmöglichen Qualität</string>
<string name="show_recycle_bin_last">Zeige den Papierkorb als letztes Element auf dem Hauptbildschirm</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Βαθιά μεγέθυνση εικόνων</string>
<string name="show_highest_quality">Εμφάνιση εικόνων με την υψηλότερη δυνατή ποιότητα</string>
<string name="show_recycle_bin_last">Εμφάνιση του Κάδου ως τελευταίο στοιχείο στην κύρια οθόνη</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Εικονίδια</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniaturas</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Esikatselukuvat</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Vignettes</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Iconas</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Sličice</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Immagini ingrandibili a fondo</string>
<string name="show_highest_quality">Mostra le immagini alla massima qualità possibile</string>
<string name="show_recycle_bin_last">Mostra il cestino come ultimo elemento nella schermata principale</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniature</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">画像のズームを深くする</string>
<string name="show_highest_quality">可能な限り高品質で画像を表示</string>
<string name="show_recycle_bin_last">ごみ箱をメイン画面の最後に表示</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">サムネイル設定</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">섬네일</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniatiūros</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Minibilder</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Afbeeldingen ver inzoomen</string>
<string name="show_highest_quality">Afbeeldingen in de hoogst mogelijke kwaliteit weergeven</string>
<string name="show_recycle_bin_last">Prullenbak als laatste item tonen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniatuurvoorbeelden</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
   <string name="thumbnails">Miniatury</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniaturas</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Mostrar fotos com a melhor qualidade possível</string>
<string name="show_recycle_bin_last">Mostrar a reciclagem como o último item do ecrã principal</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniaturas</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Масштабируемые изображения</string>
<string name="show_highest_quality">Показывать изображения с максимально высоким качеством</string>
<string name="show_recycle_bin_last">Показывать корзину как последний элемент на главном экране</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Миниатюры</string>

View file

@ -146,7 +146,7 @@
<string name="scroll_thumbnails_horizontally">Prehliadať miniatúry vodorovne</string>
<string name="hide_system_ui_at_fullscreen">Automaticky skrývať systémové lišty pri celoobrazovkových médiách</string>
<string name="delete_empty_folders">Odstrániť prázdne priečinky po vymazaní ich obsahu</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_photo_gestures">Povoliť ovládanie jasu vertikálnymi ťahmi</string>
<string name="allow_video_gestures">Povoliť ovládanie hlasitosti a jasu videí vertikálnymi ťahmi</string>
<string name="show_media_count">Zobraziť počet médií v priečinku na hlavnej obrazovke</string>
<string name="replace_share_with_rotate">Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu</string>
@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Hlboko priblížiteľné obrázky</string>
<string name="show_highest_quality">Zobrazovať obrázky v najlepšej možnej kvalite</string>
<string name="show_recycle_bin_last">Zobraziť odpadkový kôš ako poslednú položku na hlavnej obrazovke</string>
<string name="allow_down_gesture">Povoliť zatváranie celoobrazovkového režimu potiahnutím prsta dole</string>
<!-- Setting sections -->
<string name="thumbnails">Náhľady</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Miniatyrer</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Глибокомасштабовані зображення</string>
<string name="show_highest_quality">Показувати зображення в найвищій можливій якості</string>
<string name="show_recycle_bin_last">Показувати \"Кошик\" останнім елементом на головному екрані</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Ескізи</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">深度放大图像</string>
<string name="show_highest_quality">以最高质量显示图像</string>
<string name="show_recycle_bin_last">在主屏幕界面的最后一项显示回收站</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">缩略图</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">可深度縮放的圖片</string>
<string name="show_highest_quality">以最高品質顯示圖片</string>
<string name="show_recycle_bin_last">回收桶顯示在主畫面最後一項</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">縮圖</string>

View file

@ -162,6 +162,7 @@
<string name="deep_zoomable_images">Deep zoomable images</string>
<string name="show_highest_quality">Show images in the highest possible quality</string>
<string name="show_recycle_bin_last">Show the Recycle Bin as the last item on the main screen</string>
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>