Added option to set a custom start folder.
This commit is contained in:
parent
ada182a569
commit
bbaa526c61
8 changed files with 77 additions and 21 deletions
|
|
@ -9,6 +9,9 @@ import android.support.annotation.StyleRes;
|
|||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.helper.SortOrder;
|
||||
import com.kabouzeid.gramophone.ui.fragments.FolderFragment;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public final class PreferenceUtil {
|
||||
public static final String GENERAL_THEME = "general_theme";
|
||||
|
|
@ -57,6 +60,8 @@ public final class PreferenceUtil {
|
|||
|
||||
public static final String AUTO_DOWNLOAD_IMAGES_POLICY = "auto_download_images_policy";
|
||||
|
||||
public static final String START_DIRECTORY = "start_directory";
|
||||
|
||||
private static PreferenceUtil sInstance;
|
||||
|
||||
private final SharedPreferences mPreferences;
|
||||
|
|
@ -310,4 +315,14 @@ public final class PreferenceUtil {
|
|||
public final String autoDownloadImagesPolicy() {
|
||||
return mPreferences.getString(AUTO_DOWNLOAD_IMAGES_POLICY, "only_wifi");
|
||||
}
|
||||
|
||||
public final File getStartDirectory() {
|
||||
return new File(mPreferences.getString(START_DIRECTORY, FolderFragment.getDefaultStartDirectory().getPath()));
|
||||
}
|
||||
|
||||
public void setStartDirectory(File file) {
|
||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||
editor.putString(START_DIRECTORY, file.getPath());
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue