diff options
| author | Jules Aguillon | 2023-07-19 23:28:33 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-07-19 23:30:58 +0200 |
| commit | 8b2c07c9cbb783149bfa58c2d375472d87aa2e57 (patch) | |
| tree | 6c8eb924b519fad4a21c86dbc596fa6580827a23 /srcs/juloo.keyboard2/Keyboard2.java | |
| parent | 458e17bf31c9ef6b4dfadd56dd0c0dfb709eb32c (diff) | |
| download | unexpected-keyboard-8b2c07c9cbb783149bfa58c2d375472d87aa2e57.tar.gz unexpected-keyboard-8b2c07c9cbb783149bfa58c2d375472d87aa2e57.zip | |
Refactor: Centralize logging in a static class
This new class will help write more logs. The LogPrinter is no longer
created everytime the keyboard is opened.
An error log is added if failing to load the custom extra keys.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2.java | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 4b82c33..48e60db 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -26,8 +26,6 @@ import java.util.Set; public class Keyboard2 extends InputMethodService implements SharedPreferences.OnSharedPreferenceChangeListener { - static private final String TAG = "Keyboard2"; - private Keyboard2View _keyboardView; private KeyEventHandler _keyeventhandler; // If not 'null', the layout to use instead of [_currentTextLayout]. @@ -40,8 +38,6 @@ public class Keyboard2 extends InputMethodService private Config _config; - private boolean _debug_logs = false; - /** Layout currently visible. */ KeyboardData current_layout() { @@ -87,7 +83,7 @@ public class Keyboard2 extends InputMethodService _config = Config.globalConfig(); _keyboardView = (Keyboard2View)inflate_view(R.layout.keyboard); _keyboardView.reset(); - _debug_logs = getResources().getBoolean(R.bool.debug_logs); + Logs.set_debug_logs(getResources().getBoolean(R.bool.debug_logs)); } private List<InputMethodSubtype> getEnabledSubtypes(InputMethodManager imm) @@ -239,16 +235,6 @@ public class Keyboard2 extends InputMethodService return null; } - private void log_editor_info(EditorInfo info) - { - LogPrinter p = new LogPrinter(Log.DEBUG, TAG); - info.dump(p, ""); - if (info.extras != null) - Log.d(TAG, "extras: "+info.extras.toString()); - Log.d(TAG, "swapEnterActionKey: "+_config.swapEnterActionKey); - Log.d(TAG, "actionLabel: "+_config.actionLabel); - } - private void refresh_special_layout(EditorInfo info) { switch (info.inputType & InputType.TYPE_MASK_CLASS) @@ -274,8 +260,7 @@ public class Keyboard2 extends InputMethodService _keyboardView.setKeyboard(current_layout()); _keyeventhandler.started(info); setInputView(_keyboardView); - if (_debug_logs) - log_editor_info(info); + Logs.debug_startup_input_view(info, _config); } @Override |
