Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class SettingsService {
public static final String SETTING_ALTERNATIVE_FILE_ACCESS = "use_alternative_file_access";
public static final String SETTING_SHOW_LAST_EDITED_FILES = "show_last_edited_files";

public static final String SETTING_AUTO_WRAPPING = "auto_wrapping";

private static final String SETTING_USE_WAKE_LOCK = "use_wake_lock";
public static final String SETTING_USE_SIMPLE_SCROLLING = "use_simple_scrolling";

Expand Down Expand Up @@ -59,6 +61,7 @@ public class SettingsService {
private boolean legacy_file_picker = false;
private boolean alternative_file_access = true;
private boolean auto_save_current_file = false;
private boolean auto_wrapping = true;

private String file_encoding = "";
private String last_filename = "";
Expand Down Expand Up @@ -93,6 +96,7 @@ public void loadSettings(Context context) {
useWakeLock = sharedPref.getBoolean(SETTING_USE_WAKE_LOCK, false);
useSimpleScrolling = sharedPref.getBoolean(SETTING_USE_SIMPLE_SCROLLING, false);
alternative_file_access = sharedPref.getBoolean(SETTING_ALTERNATIVE_FILE_ACCESS, true);
auto_wrapping = sharedPref.getBoolean(SETTING_AUTO_WRAPPING, true);
last_filename = sharedPref.getString(SETTING_LAST_FILENAME, TPStrings.EMPTY);
file_encoding = sharedPref.getString(SETTING_FILE_ENCODING, TPStrings.UTF_8);
delimiters = sharedPref.getString(SETTING_DELIMITERS, TPStrings.EMPTY);
Expand Down Expand Up @@ -281,4 +285,8 @@ public boolean useWakeLock() {
public boolean isUseSimpleScrolling() {
return this.useSimpleScrolling;
}

public boolean isAutoWrapping() {
return this.auto_wrapping;
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@

<string name="preferenceAutoSaveCurrentFileTitle">Autosaving</string>
<string name="preferenceAutoSaveCurrentFileDescription">Automatically save currently editing file when window is closed</string>
<string name="preferenceAutowrappingTitle">Autowrapping</string>
<string name="preferenceAutowrappingDescription">wrap the line if text too long</string>
<string name="Open_Other">Open other…</string>


Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
android:summary="@string/preferenceAutoSaveCurrentFileDescription"
android:defaultValue="false" />

<CheckBoxPreference
android:key="auto_wrapping"
android:title="@string/preferenceAutowrappingTitle"
android:summary="@string/preferenceAutowrappingDescription"
android:defaultValue="true" />

<CheckBoxPreference
android:key="use_wake_lock"
android:title="@string/preferenceUseWakeLockTitle"
Expand Down