mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 10:45:23 +08:00
Changed TermuxAppSharedPreferences function naming convention
This commit is contained in:
@@ -225,7 +225,7 @@ public final class TermuxActivity extends Activity implements ServiceConnection
|
||||
|
||||
// If user changed the preference from {@link TermuxSettings} activity and returns, then
|
||||
// update the {@link TerminalView#TERMINAL_VIEW_KEY_LOGGING_ENABLED} value.
|
||||
mTerminalView.setIsTerminalViewKeyLoggingEnabled(mPreferences.getTerminalViewKeyLoggingEnabled());
|
||||
mTerminalView.setIsTerminalViewKeyLoggingEnabled(mPreferences.isTerminalViewKeyLoggingEnabled());
|
||||
|
||||
// The current terminal session may have changed while being away, force
|
||||
// a refresh of the displayed terminal.
|
||||
@@ -353,7 +353,7 @@ public final class TermuxActivity extends Activity implements ServiceConnection
|
||||
|
||||
private void setTerminalToolbarView(Bundle savedInstanceState) {
|
||||
final ViewPager terminalToolbarViewPager = findViewById(R.id.terminal_toolbar_view_pager);
|
||||
if (mPreferences.getShowTerminalToolbar()) terminalToolbarViewPager.setVisibility(View.VISIBLE);
|
||||
if (mPreferences.shouldShowTerminalToolbar()) terminalToolbarViewPager.setVisibility(View.VISIBLE);
|
||||
|
||||
ViewGroup.LayoutParams layoutParams = terminalToolbarViewPager.getLayoutParams();
|
||||
mTerminalToolbarDefaultHeight = layoutParams.height;
|
||||
@@ -441,10 +441,10 @@ public final class TermuxActivity extends Activity implements ServiceConnection
|
||||
mTerminalView.setTerminalViewClient(mTermuxTerminalViewClient);
|
||||
|
||||
mTerminalView.setTextSize(mPreferences.getFontSize());
|
||||
mTerminalView.setKeepScreenOn(mPreferences.getKeepScreenOn());
|
||||
mTerminalView.setKeepScreenOn(mPreferences.shouldKeepScreenOn());
|
||||
|
||||
// Set {@link TerminalView#TERMINAL_VIEW_KEY_LOGGING_ENABLED} value
|
||||
mTerminalView.setIsTerminalViewKeyLoggingEnabled(mPreferences.getTerminalViewKeyLoggingEnabled());
|
||||
mTerminalView.setIsTerminalViewKeyLoggingEnabled(mPreferences.isTerminalViewKeyLoggingEnabled());
|
||||
|
||||
mTermuxTerminalSessionClient.checkForFontAndColors();
|
||||
}
|
||||
@@ -508,7 +508,7 @@ public final class TermuxActivity extends Activity implements ServiceConnection
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_RESET_TERMINAL_ID, Menu.NONE, R.string.action_reset_terminal);
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_KILL_PROCESS_ID, Menu.NONE, getResources().getString(R.string.action_kill_process, getCurrentSession().getPid())).setEnabled(currentSession.isRunning());
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_STYLING_ID, Menu.NONE, R.string.action_style_terminal);
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_TOGGLE_KEEP_SCREEN_ON, Menu.NONE, R.string.action_toggle_keep_screen_on).setCheckable(true).setChecked(mPreferences.getKeepScreenOn());
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_TOGGLE_KEEP_SCREEN_ON, Menu.NONE, R.string.action_toggle_keep_screen_on).setCheckable(true).setChecked(mPreferences.shouldKeepScreenOn());
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_HELP_ID, Menu.NONE, R.string.action_open_help);
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_SETTINGS_ID, Menu.NONE, R.string.action_open_settings);
|
||||
menu.add(Menu.NONE, CONTEXT_MENU_REPORT_ID, Menu.NONE, R.string.action_report_issue);
|
||||
|
@@ -368,7 +368,7 @@ public class TermuxTerminalViewClient extends TermuxTerminalViewClientBase {
|
||||
// If soft keyboard toggle behaviour is show/hide
|
||||
else {
|
||||
// If soft keyboard is disabled by user for Termux
|
||||
if (!mActivity.getPreferences().getSoftKeyboardEnabled()) {
|
||||
if (!mActivity.getPreferences().isSoftKeyboardEnabled()) {
|
||||
Logger.logVerbose(LOG_TAG, "Maintaining disabled soft keyboard on toggle");
|
||||
KeyboardUtils.disableSoftKeyboard(mActivity, mActivity.getTerminalView());
|
||||
} else {
|
||||
@@ -382,8 +382,8 @@ public class TermuxTerminalViewClient extends TermuxTerminalViewClientBase {
|
||||
public void setSoftKeyboardState(boolean isStartup, boolean isReloadTermuxProperties) {
|
||||
// If soft keyboard is disabled by user for Termux (check function docs for Termux behaviour info)
|
||||
if (KeyboardUtils.shouldSoftKeyboardBeDisabled(mActivity,
|
||||
mActivity.getPreferences().getSoftKeyboardEnabled(),
|
||||
mActivity.getPreferences().getSoftKeyboardEnabledOnlyIfNoHardware())) {
|
||||
mActivity.getPreferences().isSoftKeyboardEnabled(),
|
||||
mActivity.getPreferences().isSoftKeyboardEnabledOnlyIfNoHardware())) {
|
||||
Logger.logVerbose(LOG_TAG, "Maintaining disabled soft keyboard");
|
||||
KeyboardUtils.disableSoftKeyboard(mActivity, mActivity.getTerminalView());
|
||||
} else {
|
||||
|
@@ -49,7 +49,7 @@ public class CrashUtils {
|
||||
|
||||
TermuxAppSharedPreferences preferences = new TermuxAppSharedPreferences(context);
|
||||
// If user has disabled notifications for crashes
|
||||
if (!preferences.getCrashReportNotificationsEnabled())
|
||||
if (!preferences.areCrashReportNotificationsEnabled())
|
||||
return;
|
||||
|
||||
new Thread() {
|
||||
|
@@ -141,7 +141,7 @@ public class PluginUtils {
|
||||
|
||||
TermuxAppSharedPreferences preferences = new TermuxAppSharedPreferences(context);
|
||||
// If user has disabled notifications for plugin, then just return
|
||||
if (!preferences.getPluginErrorNotificationsEnabled() && !forceNotification)
|
||||
if (!preferences.arePluginErrorNotificationsEnabled() && !forceNotification)
|
||||
return;
|
||||
|
||||
// Flash the errmsg
|
||||
|
@@ -76,7 +76,7 @@ public class PermissionUtils {
|
||||
|
||||
if (!PermissionUtils.checkDisplayOverOtherAppsPermission(context)) {
|
||||
TermuxAppSharedPreferences preferences = new TermuxAppSharedPreferences(context);
|
||||
if (preferences.getPluginErrorNotificationsEnabled())
|
||||
if (preferences.arePluginErrorNotificationsEnabled())
|
||||
Logger.showToast(context, context.getString(R.string.error_display_over_other_apps_permission_not_granted), true);
|
||||
return false;
|
||||
} else {
|
||||
|
@@ -38,7 +38,7 @@ public class TermuxAppSharedPreferences {
|
||||
|
||||
|
||||
|
||||
public boolean getShowTerminalToolbar() {
|
||||
public boolean shouldShowTerminalToolbar() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_SHOW_TERMINAL_TOOLBAR, TERMUX_APP.DEFAULT_VALUE_SHOW_TERMINAL_TOOLBAR);
|
||||
}
|
||||
|
||||
@@ -47,14 +47,14 @@ public class TermuxAppSharedPreferences {
|
||||
}
|
||||
|
||||
public boolean toogleShowTerminalToolbar() {
|
||||
boolean currentValue = getShowTerminalToolbar();
|
||||
boolean currentValue = shouldShowTerminalToolbar();
|
||||
setShowTerminalToolbar(!currentValue);
|
||||
return !currentValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean getSoftKeyboardEnabled() {
|
||||
public boolean isSoftKeyboardEnabled() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_SOFT_KEYBOARD_ENABLED, TERMUX_APP.DEFAULT_VALUE_KEY_SOFT_KEYBOARD_ENABLED);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TermuxAppSharedPreferences {
|
||||
SharedPreferenceUtils.setBoolean(mSharedPreferences, TERMUX_APP.KEY_SOFT_KEYBOARD_ENABLED, value, false);
|
||||
}
|
||||
|
||||
public boolean getSoftKeyboardEnabledOnlyIfNoHardware() {
|
||||
public boolean isSoftKeyboardEnabledOnlyIfNoHardware() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_SOFT_KEYBOARD_ENABLED_ONLY_IF_NO_HARDWARE, TERMUX_APP.DEFAULT_VALUE_KEY_SOFT_KEYBOARD_ENABLED_ONLY_IF_NO_HARDWARE);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TermuxAppSharedPreferences {
|
||||
|
||||
|
||||
|
||||
public boolean getKeepScreenOn() {
|
||||
public boolean shouldKeepScreenOn() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_KEEP_SCREEN_ON, TERMUX_APP.DEFAULT_VALUE_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class TermuxAppSharedPreferences {
|
||||
|
||||
|
||||
|
||||
public boolean getTerminalViewKeyLoggingEnabled() {
|
||||
public boolean isTerminalViewKeyLoggingEnabled() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_TERMINAL_VIEW_KEY_LOGGING_ENABLED, TERMUX_APP.DEFAULT_VALUE_TERMINAL_VIEW_KEY_LOGGING_ENABLED);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ public class TermuxAppSharedPreferences {
|
||||
|
||||
|
||||
|
||||
public boolean getPluginErrorNotificationsEnabled() {
|
||||
public boolean arePluginErrorNotificationsEnabled() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_PLUGIN_ERROR_NOTIFICATIONS_ENABLED, TERMUX_APP.DEFAULT_VALUE_PLUGIN_ERROR_NOTIFICATIONS_ENABLED);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public class TermuxAppSharedPreferences {
|
||||
|
||||
|
||||
|
||||
public boolean getCrashReportNotificationsEnabled() {
|
||||
public boolean areCrashReportNotificationsEnabled() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_CRASH_REPORT_NOTIFICATIONS_ENABLED, TERMUX_APP.DEFAULT_VALUE_CRASH_REPORT_NOTIFICATIONS_ENABLED);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user