From 2ecf93d9904544ee73159e9f0ee74b49057bca6c Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 1 Feb 2026 23:25:38 +0100 Subject: 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.--- srcs/juloo.keyboard2/suggestions/Suggestions.java | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 srcs/juloo.keyboard2/suggestions/Suggestions.java (limited to 'srcs/juloo.keyboard2/suggestions/Suggestions.java') diff --git a/srcs/juloo.keyboard2/suggestions/Suggestions.java b/srcs/juloo.keyboard2/suggestions/Suggestions.java new file mode 100644 index 0000000..50c64e0 --- /dev/null +++ b/srcs/juloo.keyboard2/suggestions/Suggestions.java @@ -0,0 +1,36 @@ +package juloo.keyboard2.suggestions; + +import java.util.Arrays; +import java.util.List; + +/** Keep track of the word being typed and provide suggestions for + [CandidatesView]. */ +public final class Suggestions +{ + Callback _callback; + + public Suggestions(Callback c) + { + _callback = c; + } + + public void currently_typed_word(String word) + { + if (word.equals("")) + { + _callback.set_suggestions(NO_SUGGESTIONS); + } + else + { + // TODO + _callback.set_suggestions(Arrays.asList(word)); + } + } + + static final List NO_SUGGESTIONS = Arrays.asList(); + + public static interface Callback + { + public void set_suggestions(List suggestions); + } +} -- cgit v1.2.3