DroidFish: Made it possible to disable automatic move list scrolling.

This commit is contained in:
Peter Osterlund 2016-12-03 10:39:41 +01:00
parent 64e19c005b
commit 1e061d288b
3 changed files with 11 additions and 1 deletions

View File

@ -306,6 +306,8 @@ you are not actively using the program.\
<string name="prefs_scrollSensitivity_summary">Scrolling speed for game navigation</string>
<string name="prefs_invertScrollDirection_title">Invert Scroll Direction</string>
<string name="prefs_invertScrollDirection_summary">Enable this if you think scrolling moves in the wrong direction</string>
<string name="prefs_autoScrollMoveList_title">Auto scroll move list</string>
<string name="prefs_autoScrollMoveList_summary">Automatically scroll the move list to the current board position</string>
<string name="prefs_discardVariations_title">Discard variations</string>
<string name="prefs_discardVariations_summary">Discard non-mainline moves from move list</string>
<string name="prefs_leftHanded_title">Left-handed mode</string>

View File

@ -521,6 +521,12 @@
android:summary="@string/prefs_invertScrollDirection_summary"
android:defaultValue="false">
</CheckBoxPreference>
<CheckBoxPreference
android:key="autoScrollMoveList"
android:title="@string/prefs_autoScrollMoveList_title"
android:summary="@string/prefs_autoScrollMoveList_summary"
android:defaultValue="true">
</CheckBoxPreference>
<ListPreference
android:key="autoDelay"
android:title="@string/prefs_autoDelay_title"

View File

@ -212,6 +212,7 @@ public class DroidFish extends Activity
private float scrollSensitivity;
private boolean invertScrollDirection;
private boolean autoScrollMoveList;
private boolean leftHanded;
private boolean soundEnabled;
@ -1182,6 +1183,7 @@ public class DroidFish extends Activity
scrollSensitivity = Float.parseFloat(settings.getString("scrollSensitivity", "2"));
invertScrollDirection = settings.getBoolean("invertScrollDirection", false);
autoScrollMoveList = settings.getBoolean("autoScrollMoveList", true);
discardVariations = settings.getBoolean("discardVariations", false);
Util.setFullScreenMode(this, settings);
useWakeLock = settings.getBoolean("wakeLock", false);
@ -1903,7 +1905,7 @@ public class DroidFish extends Activity
moveList.setText(gameTextListener.getText());
int currPos = gameTextListener.getCurrPos();
int line = moveList.getLineForOffset(currPos);
if (line >= 0) {
if (line >= 0 && autoScrollMoveList) {
int y = (line - 1) * moveList.getLineHeight();
moveListScroll.scrollTo(0, y);
}