-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved Termux app settings into dedicated "directory" in Termux Settin…
…gs and added About page The `TermuxConstants` class has been updated to `v0.20.0`. Check its Changelog sections for info on changes.
- Loading branch information
1 parent
90c9a7b
commit d42514d
Showing
19 changed files
with
344 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/termux/app/fragments/settings/TermuxPreferencesFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.termux.app.fragments.settings; | ||
|
||
import android.content.Context; | ||
import android.os.Bundle; | ||
|
||
import androidx.annotation.Keep; | ||
import androidx.preference.PreferenceDataStore; | ||
import androidx.preference.PreferenceFragmentCompat; | ||
import androidx.preference.PreferenceManager; | ||
|
||
import com.termux.R; | ||
import com.termux.shared.settings.preferences.TermuxAppSharedPreferences; | ||
|
||
@Keep | ||
public class TermuxPreferencesFragment extends PreferenceFragmentCompat { | ||
|
||
@Override | ||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { | ||
PreferenceManager preferenceManager = getPreferenceManager(); | ||
preferenceManager.setPreferenceDataStore(TermuxPreferencesDataStore.getInstance(getContext())); | ||
|
||
setPreferencesFromResource(R.xml.termux_preferences, rootKey); | ||
} | ||
|
||
} | ||
|
||
class TermuxPreferencesDataStore extends PreferenceDataStore { | ||
|
||
private final Context mContext; | ||
private final TermuxAppSharedPreferences mPreferences; | ||
|
||
private static TermuxPreferencesDataStore mInstance; | ||
|
||
private TermuxPreferencesDataStore(Context context) { | ||
mContext = context; | ||
mPreferences = new TermuxAppSharedPreferences(context); | ||
} | ||
|
||
public static synchronized TermuxPreferencesDataStore getInstance(Context context) { | ||
if (mInstance == null) { | ||
mInstance = new TermuxPreferencesDataStore(context.getApplicationContext()); | ||
} | ||
return mInstance; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-appcompat-release/preference/preference/res/layout/preference.xml | ||
--> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_vertical" | ||
android:orientation="vertical"> | ||
|
||
<TextView android:id="@android:id/title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:singleLine="true" | ||
android:textAppearance="?android:attr/textAppearanceLarge" | ||
android:textColor="?android:attr/textColorPrimary" /> | ||
|
||
<include android:id="@android:id/summary" layout="@layout/markdown_adapter_node_default" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<Preference | ||
app:title="@string/debugging_preferences" | ||
app:summary="Preferences for debugging" | ||
app:fragment="com.termux.app.fragments.settings.DebuggingPreferencesFragment"/> | ||
app:key="termux" | ||
app:title="@string/termux_preferences_title" | ||
app:summary="@string/termux_preferences_summary" | ||
app:fragment="com.termux.app.fragments.settings.TermuxPreferencesFragment"/> | ||
|
||
<Preference | ||
app:title="@string/terminal_io_preferences" | ||
app:summary="Preferences for terminal I/O" | ||
app:fragment="com.termux.app.fragments.settings.TerminalIOPreferencesFragment"/> | ||
app:key="about" | ||
app:title="@string/about_preferences_title" | ||
app:persistent="false"/> | ||
<!-- app:layout="@layout/preference_markdown_text" --> | ||
|
||
</PreferenceScreen> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<PreferenceCategory | ||
app:key="logging" | ||
app:title="@string/termux_logging_header"> | ||
|
||
<ListPreference | ||
app:defaultValue="1" | ||
app:key="log_level" | ||
app:title="@string/termux_log_level_title" | ||
app:useSimpleSummaryProvider="true" /> | ||
|
||
<SwitchPreferenceCompat | ||
app:key="terminal_view_key_logging_enabled" | ||
app:summaryOff="@string/termux_terminal_view_key_logging_enabled_off" | ||
app:summaryOn="@string/termux_terminal_view_key_logging_enabled_on" | ||
app:title="@string/termux_terminal_view_key_logging_enabled_title" /> | ||
|
||
<SwitchPreferenceCompat | ||
app:key="plugin_error_notifications_enabled" | ||
app:summaryOff="@string/termux_plugin_error_notifications_enabled_off" | ||
app:summaryOn="@string/termux_plugin_error_notifications_enabled_on" | ||
app:title="@string/termux_plugin_error_notifications_enabled_title" /> | ||
|
||
<SwitchPreferenceCompat | ||
app:key="crash_report_notifications_enabled" | ||
app:summaryOff="@string/termux_crash_report_notifications_enabled_off" | ||
app:summaryOn="@string/termux_crash_report_notifications_enabled_on" | ||
app:title="@string/termux_crash_report_notifications_enabled_title" /> | ||
|
||
</PreferenceCategory> | ||
|
||
</PreferenceScreen> |
Oops, something went wrong.