Commit Graph

212 Commits

Author SHA1 Message Date
Peter Osterlund
33dfafd18c Fix accidental integer division in HSV color test code 2020-04-18 20:36:01 +02:00
Peter Osterlund
05a8322ce7 Move activity utility classes to separate package 2020-04-18 20:30:34 +02:00
Peter Osterlund
cab87d7ab4 Remove FIXME!! items from source code
This is better handled outside of the source code.
2020-04-18 02:56:22 +02:00
Peter Osterlund
7d73f25a2f Remove not needed inheritDoc comments 2020-04-18 02:50:29 +02:00
Peter Osterlund
7610745dc5 Reduce maxNPS when UCI_LimitStrength is enabled 2020-04-13 16:56:42 +02:00
Peter Osterlund
ed47fc0888 Add UCI_Elo support to CuckooChess engine in DroidFish.
Same implementation as for CuckooChess Java program.
2020-04-13 16:56:37 +02:00
Peter Osterlund
67e03495dc Implement maxNPS UCI option for CuckooChess
This is an alternative way to limit the engine strength. It also has
the advantage of reducing heat and battery drain.
2020-04-11 02:26:28 +02:00
Peter Osterlund
29d605af99 Change version to 1.81 2020-04-10 16:33:03 +02:00
Peter Osterlund
3ae05affb0 Fix auto-scrolling of the move list
It did not work correctly when figurine notation was used.
2020-04-10 11:35:30 +02:00
Peter Osterlund
951c67dcb3 Remove GUI stuff from gamelogic.Piece class 2020-04-10 11:10:29 +02:00
Peter Osterlund
a7aacdc1bb Add button action "Load game from PGN file" 2020-04-10 00:19:16 +02:00
Peter Osterlund
01e77c3963 Update translations 2020-04-07 23:31:43 +02:00
Peter Osterlund
303d535bcc Fix color picker layout problems for some screen sizes 2020-04-07 23:00:44 +02:00
Peter Osterlund
d0d6049554 Split line to try to understand crash reports 2020-04-07 19:55:24 +02:00
Peter Osterlund
8c491fffd1 Whitespace fix 2020-04-06 07:39:37 +02:00
Peter Osterlund
a96e9254ff Change version to 1.80 2020-04-05 21:27:08 +02:00
Peter Osterlund
29a864de05 Remove "64" and "POPCNT" information from Stockfish name
This information does not really help the typical user and also gets
included in the White/Black fields in the PGN header section.
2020-04-05 16:29:58 +02:00
Peter Osterlund
7100ec8a06 Disable "showThinking" setting by default
It does not make much sense to see the computer's thinking output when
playing a game. Information is still visible when analyzing though.
2020-04-05 16:19:19 +02:00
Peter Osterlund
6d481732a0 Made comment editing easier to use
In many cases the pre-comment of one move is displayed at the same
position in the move text as the post-comment of the previous move.
When this is the case, don't make a distinction between pre and post
comments in the "Edit Comments" dialog.
2020-04-05 16:19:11 +02:00
Peter Osterlund
392ac334dc Small optimization 2020-04-05 09:38:27 +02:00
Peter Osterlund
93213f826f Don't allow '}' in comments
The PGN standard does not allow the '}' character inside a comment,
because it is used to end the comment.

Therefore this character is now replaced with '}' (fullwidth right
curly bracket) when editing comments. This does not look great but is
better than making the PGN data invalid.
2020-04-05 07:16:51 +02:00
Peter Osterlund
bd28d178ad Remove accidental float math 2020-04-02 19:19:14 +02:00
Peter Osterlund
e2bfb57304 Update .gitignore 2020-03-31 21:46:21 +02:00
Hamidreza Bayat
ceea0cddea Remove unused imports 2020-03-29 15:53:20 +04:30
Hamidreza Bayat
c4575a67d9 Java language level migrations 2020-03-29 15:53:20 +04:30
Hamidreza Bayat
16b57176b6 Update dependencies across modules 2020-03-29 15:53:19 +04:30
Peter Osterlund
3969a9e841 More accurate conversion between HSV and RGB color spaces
This is needed to avoid problems when dragging one of the R/G/B
sliders. With the default Android conversion code, the other R/G/B
sliders sometimes move during dragging.
2020-03-28 23:10:46 +01:00
Peter Osterlund
4dcc24cee7 Improve color picker
* Add RGB sliders to manipulate only the red, green or blue color
  component.

* Add hexadecimal input field to let user specify the ARGB value.
2020-03-28 20:40:09 +01:00
Peter Osterlund
47b093446c GradientPanel cleanup
Move common functionality to the base class.
2020-03-28 09:12:04 +01:00
Peter Osterlund
fca44e4262 Refactor ColorPickerView
Create class GradientPanel and suitable subclasses to handle rendering
and input processing in the color picker.
2020-03-22 23:12:35 +01:00
Peter Osterlund
d3c4be4737 Code cleanup 2020-03-22 16:48:53 +01:00
Peter Osterlund
7ea6a9862f In color picker, move color space conversion to separate class 2020-03-22 16:22:07 +01:00
Peter Osterlund
ae4d2a4f16 Always show alpha slider in ColorPicker
Also some code cleanup.
2020-03-22 15:14:40 +01:00
Peter Osterlund
f61396b1f9 Remove unused functionality from ColorPicker
Also some cleanup.
2020-03-22 02:08:33 +01:00
Peter Osterlund
647be33b48 Cleanup in ColorPicker code
Also remove trackball event support from ColorPickerView.
2020-03-22 01:55:53 +01:00
Peter Osterlund
0c2884ddf8 Update translations 2020-03-22 00:01:57 +01:00
Peter Osterlund
9548d56356 Make color picker handle configuration changes correctly 2020-03-21 21:19:11 +01:00
Peter Osterlund
4b9eb9ba6a Cleanup in ColorPicker code 2020-03-21 19:38:46 +01:00
Peter Osterlund
b35437dd3e Handle configuration changes in preferences activity 2020-03-21 19:09:26 +01:00
Peter Osterlund
287f2dae4a Minor cleanup 2020-03-21 19:09:06 +01:00
Peter Osterlund
06bf2ab17f Remove star from browse button icon 2020-03-21 14:45:06 +01:00
Peter Osterlund
f02e7763e4 Use file browser for file/directory settings
The following settings can now be changed using the OI file manager:
* Opening Book Settings -> Book Filename
* Endgame Tablebases -> GTB Directory
* Endgame Tablebases -> Syzygy Directory
2020-03-21 13:56:19 +01:00
Peter Osterlund
eaced74b3a Add file browser support when setting UCI options
For string UCI options containing "file" or "path" in their names, add
a button that opens a file browser to set the value of the option.

The browse button is only available if "OI file manager" or a
compatible app is installed. The button is not available for network
engines because there is no way to browse the remote filesystem where
the network engine runs.
2020-03-15 14:29:44 +01:00
Peter Osterlund
9880654006 Split large method 2020-03-15 10:50:48 +01:00
Peter Osterlund
ed400e39ce Remove progress dialog when parsing EPD file
Current devices are so fast that it is hard to see this dialog even if
the file contains 100000 positions.
2020-03-15 08:15:14 +01:00
Peter Osterlund
bcfc4ab64b Move file utility methods to FileUtil class 2020-03-14 23:31:33 +01:00
Peter Osterlund
4cfbc0da6c Fix crash when reading from a broken SCID database 2020-03-08 08:30:09 +01:00
Peter Osterlund
f99e24efda Update translations 2020-02-27 19:50:46 +01:00
Peter Osterlund
1e2d79cd9a Update translations 2020-02-23 22:50:59 +01:00
Peter Osterlund
69172a832f Change version to 1.79 2020-02-23 07:45:17 +01:00
Peter Osterlund
e595e6c92e Update translations 2020-02-22 17:03:16 +01:00
Peter Osterlund
aa6ba09675 Fix possible NPE in game filtering code 2020-02-15 08:56:17 +01:00
Peter Osterlund
b354b32bb7 Fix possible NPE in color picker dialog 2020-02-13 22:37:19 +01:00
Peter Osterlund
c4621b0de3 Improve landscape layout of the "load position" activity 2020-02-13 22:37:19 +01:00
Peter Osterlund
8789e8f9c0 White space changes and warning fixes in color picker code 2020-02-13 22:37:11 +01:00
Peter Osterlund
421aeb8a30 Fix NPE in LoadFEN.onConfigurationChanged() 2020-02-13 20:28:20 +01:00
Peter Osterlund
f912806c70 Update translations 2020-02-11 19:24:53 +01:00
Peter Osterlund
65537e70f8 New file action "load deleted game"
The new action "load deleted game" loads a recently deleted game from
the autosave file, without affecting the "last used file" and "current
position in last used file" properties.
2020-02-10 21:17:49 +01:00
Peter Osterlund
683a238bff Implement auto-save of old game when starting a new game
The 20 most recently auto-saved games are kept in the file
DroidFish/pgn/.autosave.pgn.

Overwriting an existing game when saving a new game also auto-saves
the old game.
2020-02-09 20:58:50 +01:00
Peter Osterlund
ce544c6be8 Better ClipData label 2020-02-08 17:51:31 +01:00
Peter Osterlund
e65b3a9812 Update translations 2020-02-08 14:40:53 +01:00
Peter Osterlund
9face3a9f7 Make it possible to copy analysis information to the clipboard
The analysis information is copied as text to the clipboard. The full
text is copied, so the "truncate variations" and "hide statistics"
settings have no effect on the text put in the clipboard.
2020-02-08 14:39:36 +01:00
Peter Osterlund
2e7b345de0 Update translations 2020-02-03 21:16:01 +01:00
Peter Osterlund
a595c8922b Make it possible to enter moves by dragging
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.
2020-02-03 20:45:25 +01:00
Peter Osterlund
514d81b8fe Improve en passant capture animation
The captured pawn is not removed from the board until the moving pawn
has reached its target square.
2020-02-02 11:31:19 +01:00
Peter Osterlund
546c3a7251 Remove onTrackballEvent support
Only very old devices have a trackball/trackstick and those run a too
old Android version to be supported anyway.
2020-02-02 10:38:51 +01:00
Peter Osterlund
b9f9dff315 Move chessboard input event handler code to separate file 2020-01-28 20:19:37 +01:00
Peter Osterlund
b2946d8dba Update translations 2020-01-26 09:48:22 +01:00
Peter Osterlund
979b23cf02 Separate settings for "move sound" and "move speech" 2020-01-26 08:51:46 +01:00
Peter Osterlund
d6e7771eab Change version to 1.78 2020-01-18 14:55:24 +01:00
Peter Osterlund
c39c260239 Use less CPU while waiting for human player to 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.
2020-01-18 13:30:08 +01:00
Peter Osterlund
48dda9d634 Update translations 2020-01-18 08:14:35 +01:00
Peter Osterlund
9c1d76faa1 Update to Stockfish 11 2020-01-18 08:00:03 +01:00
Peter Osterlund
c19a3b3777 Improve scrolling behavior of the MoveList area
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.
2020-01-13 21:42:08 +01:00
Peter Osterlund
9fbf7ff212 Fix autoscroll position calculation in the MoveListView
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.
2020-01-12 01:13:37 +01:00
Peter Osterlund
1afda36d85 Don't try to fixup invalid e.p. square if the position is invalid
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.
2020-01-03 10:32:49 +01:00
Peter Osterlund
61317fa78d Update translations 2019-10-08 21:04:30 +02:00
Peter Osterlund
de33b2c98f Add button action "force computer move" 2019-10-08 20:55:09 +02:00
Peter Osterlund
ac63a0125d Enable USE_POPCNT for arm64 2019-10-05 16:17:28 +02:00
Peter Osterlund
ee7ad3c434 Change version to 1.77 2019-09-29 07:47:09 +02:00
Peter Osterlund
8e42ee8022 Don't pass negative values to setSelectionFromTop() 2019-09-28 08:15:09 +02:00
Peter Osterlund
3ff78c2cbf Better handling of IO errors when reading/writing PGN files 2019-09-27 21:26:41 +02:00
Peter Osterlund
08e266a789 Update translations 2019-09-25 19:12:10 +02:00
Peter Osterlund
b2c9a79080 Remove unused import 2019-09-23 21:34:04 +02:00
Peter Osterlund
6531917212 Handle pasting of multiple PGN games into DroidFish 2019-09-23 21:19:34 +02:00
Peter Osterlund
26d03e7d91 Make it possible to read PGN games from a String 2019-09-23 20:51:27 +02:00
Peter Osterlund
152f9600b5 Move progress handling details out of PGNFile.getGameInfo() 2019-09-23 20:17:56 +02:00
Peter Osterlund
061eaf1869 Update translations 2019-09-22 10:41:41 +02:00
Peter Osterlund
1088d66b22 Include link to source code in about/help dialog text 2019-09-22 10:09:05 +02:00
Peter Osterlund
50f651225e Fix inconsistent menu item capitalization 2019-09-22 08:58:28 +02:00
Peter Osterlund
fbb2091d45 Support regular expression search in game load/save activity
Standard Java regular expression syntax is supported. The search is
case insensitive.
2019-09-22 08:48:42 +02:00
Peter Osterlund
15b62e9bc2 Show action bar in load/save game activities
This makes the "delete file" action accessible again. (Broke in
version 1.75.)
2019-09-22 00:48:18 +02:00
Peter Osterlund
da38bed581 Move PgnScreenText class to a new file 2019-09-21 21:06:25 +02:00
Peter Osterlund
5a0493a4e6 Improve behavior when searching/filtering PGN games
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.
2019-09-21 15:37:26 +02:00
Peter Osterlund
11843578d5 Cosmetic change 2019-09-01 16:42:43 +02:00
Peter Osterlund
514f2900bd Don't vibrate when human player makes a move
The vibration is primarily intended to make the user aware that the
computer has played a move, so vibrating when the user plays a move is
not useful.
2019-08-31 23:43:53 +02:00
Peter Osterlund
b86e7d31f7 Remove vibration when opening board context menu 2019-08-31 23:20:10 +02:00
Peter Osterlund
2a01797dfa Use android.util.Pair
Use the Android builtin Pair class instead of a DroidFish specific
class that does the same thing.
2019-08-10 23:38:17 +02:00
Peter Osterlund
6c4ff122ac Handle IllegalArgumentException thrown from openInputStream() 2019-08-10 18:10:14 +02:00
Peter Osterlund
7c4f43c156 Don't try to draw chess pieces with size 0
Trying to create a 0 size bitmap fails with IllegalArgumentException.
2019-07-28 09:24:13 +02:00