|
|
|
@ -27,6 +27,8 @@ import inc.flide.vim8.geometry.Dimension; |
|
|
|
|
import inc.flide.vim8.keyboardActionListners.MainKeypadActionListener; |
|
|
|
|
import inc.flide.vim8.preferences.SharedPreferenceHelper; |
|
|
|
|
import inc.flide.vim8.structures.FingerPosition; |
|
|
|
|
import io.vavr.collection.List; |
|
|
|
|
import io.vavr.control.Option; |
|
|
|
|
|
|
|
|
|
public class XpadView extends View { |
|
|
|
|
private final Random rnd = new Random(); |
|
|
|
@ -346,18 +348,25 @@ public class XpadView extends View { |
|
|
|
|
|
|
|
|
|
int iconCenterX = (int) Math.max(sectorLineBounds.left, 0); |
|
|
|
|
int iconCenterY = centerYValue; |
|
|
|
|
canvas.drawText("completion 1", iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
String lastWord = actionListener.getLastWord(); |
|
|
|
|
List<String> completions = MainKeyboardView.completions.get(lastWord).getOrElse(List.empty()); |
|
|
|
|
|
|
|
|
|
String completion1 = completions.size() > 0 ? completions.get(0) : ""; |
|
|
|
|
String completion2 = completions.size() > 1 ? completions.get(1) : ""; |
|
|
|
|
String completion3 = completions.size() > 2 ? completions.get(2) : ""; |
|
|
|
|
String completion4 = completions.size() > 3 ? completions.get(3) : ""; |
|
|
|
|
canvas.drawText(completion1, iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
|
|
|
|
|
iconCenterX = (int) Math.min(sectorLineBounds.right, canvas.getWidth()); |
|
|
|
|
|
|
|
|
|
canvas.drawText("completion 2", iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
canvas.drawText(completion2, iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
iconCenterX = centerXValue; |
|
|
|
|
iconCenterY = (int) Math.min(sectorLineBounds.bottom, canvas.getHeight()); |
|
|
|
|
|
|
|
|
|
canvas.drawText("completion 3", iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
canvas.drawText(completion3, iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
iconCenterY = (int) Math.max(sectorLineBounds.top, 0); |
|
|
|
|
|
|
|
|
|
canvas.drawText("completion 4", iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
canvas.drawText(completion4, iconCenterX, iconCenterY, foregroundPaint); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setupSectorIcons(int centreXValue, int centreYValue, Canvas canvas) { |
|
|
|
|