From 9a6b37485612f4fb9165a28e73f0873d41020ba0 Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sun, 14 Oct 2018 09:16:39 +0200 Subject: [PATCH] DroidFish: Show toast when quick loading FEN from file. When loading a position from a file using the quick next/previous key actions, display a toast containing the whole line from the EPD/FEN file. --- .../src/org/petero/droidfish/activities/LoadFEN.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DroidFish/src/org/petero/droidfish/activities/LoadFEN.java b/DroidFish/src/org/petero/droidfish/activities/LoadFEN.java index 1126597..78a6418 100644 --- a/DroidFish/src/org/petero/droidfish/activities/LoadFEN.java +++ b/DroidFish/src/org/petero/droidfish/activities/LoadFEN.java @@ -152,7 +152,7 @@ public class LoadFEN extends ListActivity { finish(); } else { defaultItem = loadItem; - sendBackResult(fensInFile.get(loadItem)); + sendBackResult(fensInFile.get(loadItem), true); } } }); @@ -210,7 +210,7 @@ public class LoadFEN extends ListActivity { okButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (selectedFi != null) - sendBackResult(selectedFi); + sendBackResult(selectedFi, false); } }); cancelButton.setOnClickListener(new OnClickListener() { @@ -269,7 +269,7 @@ public class LoadFEN extends ListActivity { chessPos = e2.pos; } if (chessPos != null) - sendBackResult(selectedFi); + sendBackResult(selectedFi, false); return true; } }); @@ -352,9 +352,11 @@ public class LoadFEN extends ListActivity { return true; } - private final void sendBackResult(FenInfo fi) { + private final void sendBackResult(FenInfo fi, boolean toast) { String fen = fi.fen; if (fen != null) { + if (toast) + DroidFishApp.toast(String.valueOf(fi.gameNo) + ": " + fen, Toast.LENGTH_SHORT); setResult(RESULT_OK, (new Intent()).setAction(fen)); finish(); } else {