Commit Graph

219 Commits

Author SHA1 Message Date
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
Peter Osterlund
6a9af8206b Prevent crash if engine produces an invalid PV
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.
2019-07-25 13:34:26 +02:00
Peter Osterlund
6c6db65f18 Change version to 1.76 2019-07-21 08:59:37 +02:00
Peter Osterlund
9efe811d12 Revert "Use SwitchPreference"
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
2019-07-21 02:27:36 +02:00
Peter Osterlund
5be49388c1 Change version to 1.75 2019-07-20 10:59:44 +02:00
Peter Osterlund
f463990029 Fix potential NPE in startup guide
DroidFish.reInitUI() could potentially set tourGuide to null while tap
events are already queued but not yet processed. Avoid NPE in this
situation.
2019-07-20 08:42:19 +02:00
Peter Osterlund
0dd276ba22 Fix potential crash when sharing an image of the board
DroidFish.shareImage() can theoretically be called before the chess
board widget measurement has been finished, which would crash the
app.
2019-07-20 08:42:10 +02:00
Peter Osterlund
4411b7f8b6 Make changing languages work in Android 9
Based on information from:

https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758
2019-07-19 21:37:53 +02:00
Peter Osterlund
ddf5209109 Remove unnecessary exception declarations 2019-07-19 20:36:36 +02:00
Peter Osterlund
eed9d1a76a Remove unused imports 2019-07-19 19:28:57 +02:00
Peter Osterlund
408cb78272 Make class fields in EditPGN private 2019-07-19 19:26:43 +02:00
Peter Osterlund
bdd577bb93 Translation update 2019-07-19 08:36:26 +02:00
Peter Osterlund
2145f67e91 Whitespace fix 2019-07-17 08:38:12 +02:00
Peter Osterlund
7da4b21d9b Add missing copyright headers 2019-06-15 20:30:47 +02:00
Peter Osterlund
93b3434af9 Disable language setting code for API >= 28
The existing code does not work for API >= 28 and it is unknown how to
make it work.
2019-06-15 11:27:04 +02:00
Peter Osterlund
0ca5a1092d Don't try to use a non-existing directory for external processes 2019-06-11 17:30:04 +02:00
Peter Osterlund
be1b667f35 Set working directory for external engines
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.
2019-06-10 20:06:15 +02:00
Peter Osterlund
71221314e6 Use vector graphics for "silhouette" icon
This icon is used for notifications.
2019-06-09 13:10:05 +02:00
Peter Osterlund
f3c1a6289d Fix formatting of CPU warning dialog text 2019-06-09 12:28:50 +02:00
Peter Osterlund
010e01589d Make CPU usage notification work for Android 26 2019-06-09 11:12:08 +02:00
Peter Osterlund
b60105780b Update app icon
New icons for android 26 and later. Also add round icons.
2019-06-09 08:57:46 +02:00
Peter Osterlund
3363b1d9c0 Use try-with-resources 2019-05-25 09:05:57 +02:00
Peter Osterlund
16e7c34337 Move "new game" action to the left drawer menu
Only use the right drawer menu for less common actions.
2019-05-25 06:56:38 +02:00
Peter Osterlund
5573b2be2f Don't truncate game history when sending moves to the chess engine
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.
2019-05-25 06:54:31 +02:00
Peter Osterlund
fe0de534a0 Update information about network engine server software 2019-05-19 00:38:14 +02:00
Peter Osterlund
5d599c2782 Code reformatting 2019-04-24 23:43:46 +02:00
Peter Osterlund
068b97ac85 Reformat XML files 2019-04-24 23:43:46 +02:00
Peter Osterlund
39d4c91bbd Adjust titlebar padding 2019-04-23 21:54:39 +02:00
Peter Osterlund
2b5e88d8c0 Simplify TourGuide.java using getToolTip() 2019-04-23 21:39:21 +02:00
Ebrahim Byagowi
31d8ebab0e Use binding in LoadFEN and EditPGN 2019-04-23 20:09:12 +02:00
Ebrahim Byagowi
0324409feb Use binding in SeekBarPreference 2019-04-23 20:09:12 +02:00
Ebrahim Byagowi
7e4a0314c9 Use binding in EditOptions root also 2019-04-23 20:09:12 +02:00
Ebrahim Byagowi
a912458ffb Use binding in EditOptions and TourGuide of DroidFishApp 2019-04-23 20:09:12 +02:00
Ebrahim Byagowi
80e8183757 Use more idiomatic and implicit pointer dereference 2019-04-22 20:04:37 +02:00
Peter Osterlund
53c1618010 Adjust titlebar layout. 2019-04-22 10:14:30 +02:00
Ebrahim Byagowi
d92aa005b1 Remove Holo's titlebar uses 2019-04-22 09:09:24 +02:00
Ebrahim Byagowi
a03e64af6d Replace CheckBoxPreference uses with SwitchPreference 2019-04-22 10:50:02 +04:30
Peter Osterlund
93809f5b91 Avoid NPE in ColorPickerPreference.java. 2019-04-22 04:32:18 +02:00
Peter Osterlund
b1f6cae789 Move SeekBarPreference layout to xml file. 2019-04-22 04:28:44 +02:00
Ebrahim Byagowi
0144b0b02d Remove Holo theme remainees from the app 2019-04-22 00:54:12 +02:00
Hamidreza Bayat
0ea27cbfbd Replace anonymous classes with lambda 2019-04-22 02:27:42 +04:30
Hamidreza Bayat
d9bbc01d19 Use Java 8 2019-04-22 02:27:19 +04:30
Hamidreza Bayat
6a2876f825 Update dependencies(Avoid using alpha & beta versions) 2019-04-21 21:35:54 +02:00
Peter Osterlund
d0fb56e03e Migrate to AndroidX support libraries. 2019-04-20 13:21:19 +02:00
Peter Osterlund
026b3ca9f0 Remove incorrect null check.
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.
2019-04-20 13:21:19 +02:00
Peter Osterlund
d292f0604c Fix "engine error" after delivering mate in ponder-on game.
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.
2019-04-20 13:21:07 +02:00
Peter Osterlund
d6011531d8 Update version code for re-release of 1.74. 2019-04-19 07:53:59 +02:00
Peter Osterlund
0d7b7fd395 Update translations. 2019-04-19 07:48:18 +02:00
Peter Osterlund
a44da0b223 Change version to 1.74. 2019-04-17 19:59:58 +02:00
Peter Osterlund
e9d579a049 Update translations. 2019-04-17 19:40:35 +02:00
Peter Osterlund
062b37e885 Update translations. 2019-04-15 21:57:57 +02:00
Peter Osterlund
2d3414dabc Add button action to toggle TB hints.
Add a configurable button action to toggle display of tablebase hints.
2019-04-14 18:27:07 +02:00
Peter Osterlund
3b7a751e7b Add new piece sets.
Add new piece sets from PyChess and from Wikimedia Commons.
2019-04-14 01:34:47 +02:00
Peter Osterlund
3c361195d8 Switch to androidsvg SVG library.
This library has much better support for the SVG standard.
2019-04-14 01:27:58 +02:00
Peter Osterlund
1fd3492edd Fix stockfish crash.
Merge commit 4e2bb8fa44fe03a2fdb2d3448ac93986354bf9ae from
https://github.com/official-stockfish.
2019-04-10 20:32:19 +02:00
Peter Osterlund
7c660323f0 Use SVG graphics to draw chess pieces.
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.
2019-04-07 18:47:17 +02:00
Peter Osterlund
a133a77510 Don't flip the board based on "player name" when toggling analysis.
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.
2019-03-31 03:11:14 +02:00
Peter Osterlund
78b4ac2762 Fix some Android Studio warnings. 2019-03-30 15:44:35 +01:00
Peter Osterlund
8a0a495830 Update link to syzygy tablebases. 2019-03-24 21:24:58 +01:00
Peter Osterlund
7568fad3c3 Commit missing change from "Remove unneeded code from buildSrc". 2019-03-24 21:23:23 +01:00
Peter Osterlund
1a533ca1fb Fix some Android Studio warnings. 2019-03-17 22:35:02 +01:00
Peter Osterlund
eaadffa6b0 Fix some Android Studio warnings. 2019-03-17 12:52:54 +01:00
Peter Osterlund
bd99154def Convert project to Android Studio. 2019-03-17 09:11:36 +01:00