diff options
Diffstat (limited to 'app/src/main/java/ch/blinkenlights/android/vanilla/MediaFoldersSelectionActivity.java')
| -rw-r--r-- | app/src/main/java/ch/blinkenlights/android/vanilla/MediaFoldersSelectionActivity.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/app/src/main/java/ch/blinkenlights/android/vanilla/MediaFoldersSelectionActivity.java b/app/src/main/java/ch/blinkenlights/android/vanilla/MediaFoldersSelectionActivity.java new file mode 100644 index 0000000..5d04280 --- /dev/null +++ b/app/src/main/java/ch/blinkenlights/android/vanilla/MediaFoldersSelectionActivity.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2017 Adrian Ulrich <adrian@blinkenlights.ch> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package ch.blinkenlights.android.vanilla; + +import ch.blinkenlights.android.medialibrary.MediaLibrary; + +import android.app.Activity; +import android.os.Bundle; +import android.content.SharedPreferences; + +import java.io.File; +import java.util.ArrayList; + +public class MediaFoldersSelectionActivity extends FolderPickerActivity { + + private SharedPreferences.Editor mPrefEditor; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setTitle(R.string.media_folders_header); + + MediaLibrary.Preferences prefs = MediaLibrary.getPreferences(this); + File startPath = FileUtils.getFilesystemBrowseStart(this); + + // Setup UI and enable tritastic options. + enableTritasticSelect(true, prefs.mediaFolders, prefs.blacklistedFolders); + enableTritasticSpinner(true); + // ...and jump to the folder. + setCurrentDir(startPath); + } + + + @Override + public void onFolderPicked(File directory, ArrayList<String> included, ArrayList<String> excluded) { + MediaLibrary.Preferences prefs = MediaLibrary.getPreferences(this); + prefs.mediaFolders = included; + prefs.blacklistedFolders = excluded; + MediaLibrary.setPreferences(this, prefs); + finish(); + } + +} |
