abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
diff options
context:
space:
mode:
authorJules Aguillon2026-02-01 23:25:38 +0100
committerGitHub2026-02-01 23:25:38 +0100
commit2ecf93d9904544ee73159e9f0ee74b49057bca6c (patch)
treeb574489e776a9ca665c7cc97b75f127527e59cd1 /srcs/juloo.keyboard2/Keyboard2.java
parentb9072daaf62d5decb3377beeb281790a7512ae02 (diff)
downloadunexpected-keyboard-2ecf93d9904544ee73159e9f0ee74b49057bca6c.tar.gz
unexpected-keyboard-2ecf93d9904544ee73159e9f0ee74b49057bca6c.zip
Candidates view improvements (#1168)
* Refactor: Create subpackage 'suggestions' * Candidates view: Status message when no dictionary installed Show a message on the candidates view instead of leaving it empty. A button points to the dictionary installation activity. * Add an option to disable the suggestions * Refactor: Remove Config.should_show_candidates_view This was moved to EditorConfig. * Don't disable text suggestions in some text boxes * Suggestion text size matching settings The candidates view height is based on the height of keyboard rows and the suggestion text size is based on the size of labels on the keys. This is influenced by symbol size and keyboard height options.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java
index 4d008d9..25af0d0 100644
--- a/srcs/juloo.keyboard2/Keyboard2.java
+++ b/srcs/juloo.keyboard2/Keyboard2.java
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import juloo.keyboard2.prefs.LayoutsPreference;
+import juloo.keyboard2.suggestions.CandidatesView;
public class Keyboard2 extends InputMethodService
implements SharedPreferences.OnSharedPreferenceChangeListener
@@ -164,7 +165,11 @@ public class Keyboard2 extends InputMethodService
private void refresh_candidates_view()
{
- boolean should_show = _config.editor_config.should_show_candidates_view;
+ boolean should_show =
+ _config.suggestions_enabled
+ && _config.editor_config.should_show_candidates_view;
+ if (should_show)
+ _candidates_view.refresh_config(_config);
_candidates_view.setVisibility(should_show ? View.VISIBLE : View.GONE);
}
@@ -185,6 +190,7 @@ public class Keyboard2 extends InputMethodService
// Set keyboard background opacity
_container_view.getBackground().setAlpha(_config.keyboardOpacity);
_keyboardView.reset();
+ refresh_candidates_view();
}
private KeyboardData refresh_special_layout()
@@ -205,7 +211,6 @@ public class Keyboard2 extends InputMethodService
{
_config.editor_config.refresh(info, getResources());
refresh_config();
- refresh_candidates_view();
_currentSpecialLayout = refresh_special_layout();
_keyboardView.setKeyboard(current_layout());
_keyeventhandler.started(_config);