Allow to toggle photo gestures via settings toggle

This commit is contained in:
Nikola Trubitsyn 2018-02-04 03:33:51 +03:00
parent 467058583b
commit d884da9b82
30 changed files with 67 additions and 2 deletions

View File

@ -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 {

View File

@ -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()
}

View File

@ -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()

View File

@ -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"

View File

@ -203,6 +203,26 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_allow_photo_gestures_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_allow_photo_gestures"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/allow_photo_gestures"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_allow_video_gestures_holder"
android:layout_width="match_parent"

View File

@ -130,6 +130,7 @@
<string name="scroll_thumbnails_horizontally">قم بتمرير الصور المصغرة أفقيا</string>
<string name="hide_system_ui_at_fullscreen">إخفاء واجهة النظام تلقائيا عند العرض في وضع ملء الشاشة</string>
<string name="delete_empty_folders">احذف المجلدات الفارغة بعد حذف محتواها</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">السماح بالتحكم في صوت الفيديو والسطوع بالإيماءات العمودية</string>
<string name="show_media_count">إظهار عدد لوسائط المجلد على طريقة العرض الرئيسية</string>
<string name="replace_share_with_rotate">استبدال خيار المشاركة مع خيار تدوير في القائمة ملء الشاشة</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Desplaçar miniatures horizontalment</string>
<string name="hide_system_ui_at_fullscreen">Ocultar automàticament la interficie de usuari del sistema a pantalla complerta</string>
<string name="delete_empty_folders">Eliminar carpetes buides després d\'esborrar el seu contingut</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Permet controlar el volum i la brillantor del vídeo amb gestos verticals</string>
<string name="show_media_count">Mostrar el número de mitjans de les carpetes a la vista principal</string>
<string name="replace_share_with_rotate">Reemplaçar Compartir per Girar al menú de pantalla complerta</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="show_media_count">Show folder media count on the main view</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Kacheln horizontal scrollen</string>
<string name="hide_system_ui_at_fullscreen">Systemleiste im Vollbild ausblenden</string>
<string name="delete_empty_folders">Nach Löschen leere Ordner löschen</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Gesten für Videolautstärke/Helligkeit zulassen</string>
<string name="show_media_count">Medienanzahl bei Ordnern anzeigen</string>
<string name="replace_share_with_rotate">Teilen/Drehen im Vollbild-Menü vertauschen</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Desplazar miniaturas horizontalmente</string>
<string name="hide_system_ui_at_fullscreen">Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa</string>
<string name="delete_empty_folders">Eliminar carpetas vacias despues de borrar su contenido</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Permite controlar el volumen y el brillo del video con gestos verticales</string>
<string name="show_media_count">Mostrar el conteo de medios de las carpetas en la vista principal</string>
<string name="replace_share_with_rotate">Reemplazar Compartir con Girar en el menú de pantalla completa</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Vieritä pienoiskuvia vaakasuorassa</string>
<string name="hide_system_ui_at_fullscreen">Piilota järjestelmän UI automaattisesti koko näytön mediassa</string>
<string name="delete_empty_folders">Poista tyhjät kansiot kansion tyhjennyksen jälkeen</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Salli videon äänenvoimakkuuden ja kirkkauden säätö pystysuorilla eleillä</string>
<string name="show_media_count">Show folder media count on the main view</string>
<string name="replace_share_with_rotate">Korvaa jakaminen kääntämisellä koko näytön tilassa</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Défilement des miniatures horizontalement</string>
<string name="hide_system_ui_at_fullscreen">Masquer automatiquement l\'interface utilisateur si média plein écran</string>
<string name="delete_empty_folders">Supprimer les dossiers vides après avoir supprimé leur contenu</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Permettre le contrôle du volume vidéo et de la luminosité avec des gestes verticaux</string>
<string name="show_media_count">Afficher le nombre de fichiers dans les dossiers sur l\'écran principal</string>
<string name="replace_share_with_rotate">Remplacer Partager par Pivoter si menu en plein écran</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Desplazar iconas horizontalmente</string>
<string name="hide_system_ui_at_fullscreen">Agochar controis do sistema cando visualice a pantalla completa</string>
<string name="delete_empty_folders">Borrar cartafoles baldeiros cando elmine o seu contido</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Permitir controlar o volume do vídeo e o brillo con xestos verticáis</string>
<string name="show_media_count">Mostrar a conta de medios do cartafol na vista principal</string>
<string name="replace_share_with_rotate">Substituír Compartir con Rotar no menú de pantalla completa</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Listaj sličice horizontalno</string>
<string name="hide_system_ui_at_fullscreen">Automatski sakrij UI sustava pri pregledu datoteka</string>
<string name="delete_empty_folders">Izbriži prazne direktorije nakon brisanja njihovog sadržaja</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Omogući kontrolu glasnoće videa i svjetline pomoću vertikalnih gesti</string>
<string name="show_media_count">Prikaži broj datoteka u direktoriju na glavnom zaslonu</string>
<string name="replace_share_with_rotate">Zamjeni Dijeli s Rotiraj pri pregledu datoteka</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="show_media_count">Show folder media count on the main view</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Scorri le miniature orizzontalmente</string>
<string name="hide_system_ui_at_fullscreen">Nascondi UI di sistema con media a schermo intero</string>
<string name="delete_empty_folders">Elimina cartelle vuote dopo averne eliminato il contenuto</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Gestisci il volume e la luminosità dei video con gesti verticali</string>
<string name="show_media_count">Mostra numero elementi nella cartella</string>
<string name="replace_share_with_rotate">Sostituisci Condividi con Ruota a schermo intero</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">サムネイル画面を横方向にスクロール</string>
<string name="hide_system_ui_at_fullscreen">フルスクリーン時にシステムUIを非表示にする</string>
<string name="delete_empty_folders">メディアの削除後にフォルダーが空になった場合、そのフォルダーを削除する</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">ビデオ再生中に、音量と明るさを縦方向のジェスチャーで変更する</string>
<string name="show_media_count">Show folder media count on the main view</string>
<string name="replace_share_with_rotate">フルスクリーンメニューの「共有」を「回転」に置き換える</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">섬네일 수평스크롤</string>
<string name="hide_system_ui_at_fullscreen">전체화면 모드에서 시스템 UI 숨김</string>
<string name="delete_empty_folders">콘텐츠 삭제 후 빈폴더 삭제</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">수직 제스처로 비디오 볼륨 및 밝기 제어</string>
<string name="show_media_count">폴더에 포함된 미디어파일 수 표시</string>
<string name="replace_share_with_rotate">전체화면 메뉴의 공유 아이콘을 회전 아이콘으로 변경</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Horisontal rulling av minibilder</string>
<string name="hide_system_ui_at_fullscreen">Skjul automatisk systemlinjer ved mediavisning</string>
<string name="delete_empty_folders">Slett tomme mapper etter sletting av deres innhold</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Tillat å styre videovolum og lysstyrke med vertikale bevegelser</string>
<string name="show_media_count">Vis mediaantallet i mapper på hovedvisningen</string>
<string name="replace_share_with_rotate">Erstatt Del med Roter i meny ved mediavisning</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Horizontaal scrollen</string>
<string name="hide_system_ui_at_fullscreen">Statusbalk automatisch verbergen in volledig scherm</string>
<string name="delete_empty_folders">Lege mappen verwijderen na leegmaken</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Volume en helderheid aanpassen met verticale gebaren</string>
<string name="show_media_count">Aantallen in mappen tonen</string>
<string name="replace_share_with_rotate">Menu-item Draaien vastzetten in volledig scherm (in plaats van Delen)</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Przewijaj miniatury poziomo</string>
<string name="hide_system_ui_at_fullscreen">Ukrywaj interfejs przy pełnoekranowym podglądzie</string>
<string name="delete_empty_folders">Usuwaj puste foldery po usunięciu ich zawartości</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Zezwalaj na kontrolę jasności i głośności filmów pionowymi gestami</string>
<string name="show_media_count">Pokazuj liczbę elementów w folderach w głównym widoku</string>
<string name="replace_share_with_rotate">Zamień funkcję udostępniania na obracanie w menu pełnoekranowym</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Rolar miniaturas horizontalmente</string>
<string name="hide_system_ui_at_fullscreen">Esconder interface do sistema automaticamente quando em tela cheia</string>
<string name="delete_empty_folders">Apagar pastas vazias após deleter seu conteúdo</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Permitir controle do volume e brilho com gestos na vertical</string>
<string name="show_media_count">Mostrar quantidade de arquivos das pastas</string>
<string name="replace_share_with_rotate">Substituir botão "Compartilhar" por "Rotação de tela" quando em tela cheia</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Deslocação horizontal de miniaturas</string>
<string name="hide_system_ui_at_fullscreen">Ocultar interface do sistema se em ecrã completo</string>
<string name="delete_empty_folders">Apagar as pastas vazias depois de remover o seu conteúdo</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Permitir controlo do volume e brilho dos vídeos através de gestos verticais</string>
<string name="show_media_count">Mostrar número de ficheiros na vista principal</string>
<string name="replace_share_with_rotate">Substituir a opção Partilhar pela opção Rodar se em ecrã completo</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Прокрутка эскизов по горизонтали</string>
<string name="hide_system_ui_at_fullscreen">Автоматически скрывать системный интерфейс в полноэкранном режиме</string>
<string name="delete_empty_folders">Удалять пустые папки после удаления их содержимого</string>
<string name="allow_photo_gestures">Управлять яркостью фото с помощью вертикальных жестов</string>
<string name="allow_video_gestures">Управлять громкостью и яркостью видео с помощью вертикальных жестов</string>
<string name="show_media_count">Показывать количество файлов в папках</string>
<string name="replace_share_with_rotate">Заменить \"Поделиться\" на \"Повернуть\" в меню полноэкранного режима</string>

View File

@ -126,6 +126,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_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>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Rulla horisontellt genom miniatyrer</string>
<string name="hide_system_ui_at_fullscreen">Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge</string>
<string name="delete_empty_folders">Ta bort tomma mappar när deras innehåll tas bort</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Tillåt styrning av videovolym och videoljusstyrka med vertikala gester</string>
<string name="show_media_count">Visa antalet mediefiler i varje mapp i huvudvyn</string>
<string name="replace_share_with_rotate">Ersätt Dela med Rotera i helskärmsmenyn</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="show_media_count">Show folder media count on the main view</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">水平滚动缩略图</string>
<string name="hide_system_ui_at_fullscreen">全屏时自动隐藏状态栏</string>
<string name="delete_empty_folders">删除没有内容的空文件夹</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">使用纵向滑动手势控制视频音量和亮度</string>
<string name="show_media_count">在主界面显示文件夹媒体计数</string>
<string name="replace_share_with_rotate">替换全屏时菜单栏的“分享”为“旋转”</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">橫向滑動縮圖</string>
<string name="hide_system_ui_at_fullscreen">全螢幕時自動隱藏系統介面</string>
<string name="delete_empty_folders">刪除內容後刪除空白資料夾</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">允許用上下手勢來控制影片的音量和亮度</string>
<string name="show_media_count">主畫面顯示資料夾內媒體檔案數量</string>
<string name="replace_share_with_rotate">將全螢幕選單的分享取代為旋轉</string>

View File

@ -126,6 +126,7 @@
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="delete_empty_folders">Delete empty folders after deleting their content</string>
<string name="allow_photo_gestures">Allow controlling photo brightness with vertical gestures</string>
<string name="allow_video_gestures">Allow controlling video volume and brightness with vertical gestures</string>
<string name="show_media_count">Show folder media count on the main view</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>