DroidFish: Preparations for supporting one more button.

This commit is contained in:
Peter Osterlund 2012-05-12 17:42:56 +00:00
parent 1ec674197c
commit 4753286aeb
7 changed files with 34 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -19,6 +19,13 @@
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/customButton"
android:contentDescription="@string/buttonDesc_custom"
android:layout_width="36dp"
android:layout_height="32dp"
android:src="@drawable/custom">
</ImageButton>
<ImageButton
android:id="@+id/flipButton"
android:contentDescription="@string/buttonDesc_flip"

View File

@ -22,6 +22,13 @@
android:typeface="monospace"
android:textSize="10dip"/>
<ImageButton
android:id="@+id/customButton"
android:contentDescription="@string/buttonDesc_custom"
android:layout_width="36dp"
android:layout_height="32dp"
android:src="@drawable/custom">
</ImageButton>
<ImageButton
android:id="@+id/flipButton"
android:contentDescription="@string/buttonDesc_flip"
android:layout_width="36dp"

View File

@ -14,6 +14,13 @@
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/customButton"
android:contentDescription="@string/buttonDesc_custom"
android:layout_width="36dp"
android:layout_height="32dp"
android:src="@drawable/custom">
</ImageButton>
<ImageButton
android:id="@+id/flipButton"
android:contentDescription="@string/buttonDesc_flip"

View File

@ -321,6 +321,7 @@ you are not actively using the program.\
<string name="prefs_tbEngineProbe_summary">Enable tablebase probing in engine, when supported. Takes effect next time engine is started</string>
<string name="prefs_gtbPath_title">GTB Directory</string>
<string name="prefs_gtbPath_summary">Directory where Gaviota tablebases are installed. Leave blank to use default directory</string>
<string name="buttonDesc_custom">Custom button</string>
<string name="buttonDesc_flip">Flip board button</string>
<string name="buttonDesc_mode">Mode button</string>
<string name="buttonDesc_back">Backward button</string>

View File

@ -167,7 +167,7 @@ public class DroidFish extends Activity implements GUIInterface {
private ScrollView moveListScroll;
private TextView moveList;
private TextView thinking;
private ImageButton flipButton, modeButton, undoButton, redoButton;
private ImageButton custButton, flipButton, modeButton, undoButton, redoButton;
private TextView whiteClock, blackClock, titleText;
SharedPreferences settings;
@ -480,6 +480,12 @@ public class DroidFish extends Activity implements GUIInterface {
}
});
custButton = (ImageButton)findViewById(R.id.customButton);
custButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
}
});
flipButton = (ImageButton)findViewById(R.id.flipButton);
flipButton.setOnClickListener(new OnClickListener() {
@Override
@ -635,21 +641,26 @@ public class DroidFish extends Activity implements GUIInterface {
if (largeButtons) {
bWidth = bWidth * 3 / 2;
bHeight = bHeight * 3 / 2;
custButton.setImageResource(R.drawable.custom_large);
flipButton.setImageResource(R.drawable.flip_large);
modeButton.setImageResource(R.drawable.mode_large);
undoButton.setImageResource(R.drawable.left_large);
redoButton.setImageResource(R.drawable.right_large);
} else {
custButton.setImageResource(R.drawable.custom);
flipButton.setImageResource(R.drawable.flip);
modeButton.setImageResource(R.drawable.mode);
undoButton.setImageResource(R.drawable.left);
redoButton.setImageResource(R.drawable.right);
}
custButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
flipButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
modeButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
undoButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
redoButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
custButton.setVisibility(true ? View.GONE : View.VISIBLE);
bookOptions.filename = settings.getString("bookFile", "");
bookOptions.maxLength = getIntSetting("bookMaxLength", 1000000);
bookOptions.preferMainLines = settings.getBoolean("bookPreferMainLines", false);