diff --git a/app/src/main/java/com/simplemobiletools/gallery/Config.java b/app/src/main/java/com/simplemobiletools/gallery/Config.java index 49e89154e..c40f726ad 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/Config.java +++ b/app/src/main/java/com/simplemobiletools/gallery/Config.java @@ -102,4 +102,12 @@ public class Config { public boolean getIsFolderHidden(String path) { return getHiddenFolders().contains(path); } + + public boolean getAutoplayVideos() { + return mPrefs.getBoolean(Constants.AUTOPLAY_VIDEOS, false); + } + + public void setAutoplayVideos(boolean autoplay) { + mPrefs.edit().putBoolean(Constants.AUTOPLAY_VIDEOS, autoplay).apply(); + } } diff --git a/app/src/main/java/com/simplemobiletools/gallery/Constants.java b/app/src/main/java/com/simplemobiletools/gallery/Constants.java index 2cd5c35a6..429de434f 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/Constants.java +++ b/app/src/main/java/com/simplemobiletools/gallery/Constants.java @@ -17,6 +17,7 @@ public class Constants { public static final String DIRECTORY_SORT_ORDER = "directory_sort_order"; public static final String HIDDEN_FOLDERS = "hidden_folders"; public static final String SHOW_HIDDEN_FOLDERS = "show_hidden_folders"; + public static final String AUTOPLAY_VIDEOS = "autoplay_videos"; // sorting public static final int SORT_BY_NAME = 1; diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/SettingsActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/SettingsActivity.java index 7f4655dbc..881effb9a 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/SettingsActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/SettingsActivity.java @@ -15,6 +15,7 @@ public class SettingsActivity extends SimpleActivity { @BindView(R.id.settings_dark_theme) SwitchCompat mDarkThemeSwitch; @BindView(R.id.settings_same_sorting) SwitchCompat mSameSortingSwitch; @BindView(R.id.settings_show_hidden_folders) SwitchCompat mShowHiddenFoldersSwitch; + @BindView(R.id.settings_autoplay_videos) SwitchCompat mAutoplayVideosSwitch; private static Config mConfig; @@ -28,6 +29,7 @@ public class SettingsActivity extends SimpleActivity { setupDarkTheme(); setupSameSorting(); setupShowHiddenFolders(); + setupAutoplayVideos(); } private void setupDarkTheme() { @@ -42,6 +44,10 @@ public class SettingsActivity extends SimpleActivity { mShowHiddenFoldersSwitch.setChecked(mConfig.getShowHiddenFolders()); } + private void setupAutoplayVideos() { + mAutoplayVideosSwitch.setChecked(mConfig.getAutoplayVideos()); + } + @OnClick(R.id.settings_dark_theme_holder) public void handleDarkTheme() { mDarkThemeSwitch.setChecked(!mDarkThemeSwitch.isChecked()); @@ -61,6 +67,12 @@ public class SettingsActivity extends SimpleActivity { mConfig.setShowHiddenFolders(mShowHiddenFoldersSwitch.isChecked()); } + @OnClick(R.id.settings_autoplay_videos_holder) + public void handleAutoplayVideos() { + mAutoplayVideosSwitch.setChecked(!mAutoplayVideosSwitch.isChecked()); + mConfig.setAutoplayVideos(mAutoplayVideosSwitch.isChecked()); + } + private void restartActivity() { TaskStackBuilder.create(getApplicationContext()).addNextIntentWithParentStack(getIntent()).startActivities(); } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index ae26ba795..26eb74bb6 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -94,5 +94,33 @@ android:clickable="false"/> + + + + + + + + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index bd665d3f6..8b38339e9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -82,6 +82,7 @@ Dunkles Design Selbe Sortierung für Dateien und Ordner Zeige versteckte Ordner + Start videos automatically Diese App nutzt die folgenden Drittanbieterbilbiotheken, die mein Leben einfacher machen. Danke. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e8e3b7ca3..a72434c27 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -82,6 +82,7 @@ Tema oscuro Ordenar del mismo modo los archivos y las carpetas Show hidden folders + Start videos automatically Esta aplicación usa las siguientes bibliotecas de terceros que hacen mi vida más fácil. Gracias. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 61c510a39..e6db06b3f 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -82,6 +82,7 @@ Tema scuro Same sorting for files and folders Show hidden folders + Start videos automatically Questa app usa le seguenti librerie di terze parti per semplificarmi la vita. Grazie. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 45d2795f0..75a2ade43 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -82,6 +82,7 @@ ダークテーマ Same sorting for files and folders Show hidden folders + Start videos automatically このアプリは、私の人生を容易にするために、次のサードパーティのライブラリーを使用しています。 ありがとうございます。 diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 9333de115..8a2d4a48a 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -82,6 +82,7 @@ Tema escuro A mesma ordenação para ficheiros e pastas Show hidden folders + Start videos automatically Esta aplicação usa as seguintes bibliotecas de terceiros para facilitar a minha vida. Obrigado. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 1f6e164b1..52d96714e 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -82,6 +82,7 @@ Mörkt tema Same sorting for files and folders Show hidden folders + Start videos automatically Denna app använder följande tredjepartsbibliotek för att göra mitt liv enklare. Tack. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b1206a7a6..d47591e8a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -83,6 +83,7 @@ Dark theme Same sorting for files and folders Show hidden folders + Start videos automatically This app uses the following third party libraries to make my life easier. Thank you.