Skip to content
Snippets Groups Projects
Commit e980343f authored by Aleksandras Kostarevas's avatar Aleksandras Kostarevas
Browse files

Do not add duplicates in KeyboardTextsMultiSet

parent 08d844a9
No related branches found
Tags 0.1.24.2-rc1
No related merge requests found
......@@ -39,11 +39,14 @@ public final class KeyboardTextsMultiSet extends KeyboardTextsSet {
public String getText(String name) {
// TODO: Blacklist certain ones like period key, comma key, since they break it. Should disable duplication too
if(name.startsWith("morekeys_")) {
StringBuilder combined = new StringBuilder(base.getText(name));
ArrayList<String> texts = new ArrayList<>();
texts.add(base.getText(name));
for(KeyboardTextsSet extra : this.extra) {
combined.append(",").append(extra.getText(name));
String extraText = extra.getText(name);
if(!texts.contains(extraText)) texts.add(extraText);
}
return combined.toString();
return String.join(",", texts);
} else {
return base.getText(name);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment