Add new setting (default true) to allow input of moves by dragging a
piece from its source square to the target square.
This setting partially overlaps with scroll gestures on the chess
board, so when this setting is enabled, scroll gestures will only
happen if the starting square is empty or contains a piece of the
color not to make the next move.
After the engine plays a move in a game, a thread could get into a
state where it would poll for engine output every millisecond while
waiting for the human player to make the next move.
Even though this was not a busy wait, it would still use more CPU
resources than necessary, so the logic has been changed to prevent
this situation.
Move the margin between the move list and the button row to the button
row container, so that the margin does not interfere with the
calculation in MoveListView.onMeasure().
Adjusted the MoveListView content size so that the last row can be
scrolled to a position where the previous line is completely hidden.
When computing the autoscroll Y position the parts of characters
descending below the font baseline were visible for the line before
the first line that was supposed to be visible.
Also add a small margin above the move list to separate it somewhat
from the button row.
En passant fixup requires generating a list of legal moves, which can
fail with an array index out of bounds exception if there is a pawn on
the first/last rank.
When loading a PGN game from a file a list is displayed with one item
for each game in the file. Filtering of this list has been improved in
several ways:
* Made it possible to search for part of a word and to include space
characters in the search.
* While changing the search string keep the top list element unchanged
when possible.
* When using the "load from last file" action to go to the game list,
start at the position in the list corresponding to the previously
loaded game.
* Make the "load next/previous game" actions load the correct game
also when a filter is in effect.
* Use correct text color after a game has been deleted from the game
list.
If an engine produces an invalid PV during analysis and the "add
analysis" function is used to add the PV to the game tree, the app
could crash. Fixed this by ignoring the invalid PV move and any
following moves in the PV.
Change back to using CheckBoxPreference instead of SwitchPreference in
DroidFish. In Android 4.x the switch can be so big that the text does
not fit, since it uses on/off texts for the switch, and those texts
are translated. Russian language is known to be affected.
See a03e64af6d
When running an external engine set the working directory of the
engine process to .../DroidFish/uci/logs. This makes it possible for
the engine to create log files or other auxiliary files in that
directory.
This is useful for the OpenCL version of LC0, which needs to create a
tuning file somewhere. With this change it can be placed in the
current working directory.
The LC0 engine evaluation function depends on the move history.
Null moves are still truncated though, since a UCI engine is not
expected to be able to handle null moves.
The check for move == null in DroidFish.movePlayed() is wrong because this case
happens if the computer move is a draw claim involving a move to be played but
not actually being played.
When the human player delivers check mate in a ponder-on game, the GUI sometimes
reported "engine error". This happened when the computer was pondering a move
that ended the game, so that there were no valid moves after the ponder move.
Use SVG graphics to draw chess pieces instead of a custom font. This should fix
the problem where some android devices ignore the requested font so the chess
pieces are drawn as two overlapping regular letters.
This should also make it easier to add alternative piece sets in the future.
Automatic board flip based on "player name" is only supposed to happen when
loading a new game or similar. If you for some reason want to have the board
flipped compared to the "player name" orientation, it is annoying that the board
flips back every time you toggle analysis mode.