mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 19:34:08 +01:00
DroidFish: Preparations for supporting one more button.
This commit is contained in:
parent
1ec674197c
commit
4753286aeb
BIN
DroidFish/res/drawable/custom.png
Normal file
BIN
DroidFish/res/drawable/custom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
DroidFish/res/drawable/custom_large.png
Normal file
BIN
DroidFish/res/drawable/custom_large.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
|
@ -19,6 +19,13 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content">
|
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
|
<ImageButton
|
||||||
android:id="@+id/flipButton"
|
android:id="@+id/flipButton"
|
||||||
android:contentDescription="@string/buttonDesc_flip"
|
android:contentDescription="@string/buttonDesc_flip"
|
||||||
|
|
|
@ -22,6 +22,13 @@
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:textSize="10dip"/>
|
android:textSize="10dip"/>
|
||||||
<ImageButton
|
<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:id="@+id/flipButton"
|
||||||
android:contentDescription="@string/buttonDesc_flip"
|
android:contentDescription="@string/buttonDesc_flip"
|
||||||
android:layout_width="36dp"
|
android:layout_width="36dp"
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content">
|
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
|
<ImageButton
|
||||||
android:id="@+id/flipButton"
|
android:id="@+id/flipButton"
|
||||||
android:contentDescription="@string/buttonDesc_flip"
|
android:contentDescription="@string/buttonDesc_flip"
|
||||||
|
|
|
@ -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_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_title">GTB Directory</string>
|
||||||
<string name="prefs_gtbPath_summary">Directory where Gaviota tablebases are installed. Leave blank to use default 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_flip">Flip board button</string>
|
||||||
<string name="buttonDesc_mode">Mode button</string>
|
<string name="buttonDesc_mode">Mode button</string>
|
||||||
<string name="buttonDesc_back">Backward button</string>
|
<string name="buttonDesc_back">Backward button</string>
|
||||||
|
|
|
@ -167,7 +167,7 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||||
private ScrollView moveListScroll;
|
private ScrollView moveListScroll;
|
||||||
private TextView moveList;
|
private TextView moveList;
|
||||||
private TextView thinking;
|
private TextView thinking;
|
||||||
private ImageButton flipButton, modeButton, undoButton, redoButton;
|
private ImageButton custButton, flipButton, modeButton, undoButton, redoButton;
|
||||||
private TextView whiteClock, blackClock, titleText;
|
private TextView whiteClock, blackClock, titleText;
|
||||||
|
|
||||||
SharedPreferences settings;
|
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 = (ImageButton)findViewById(R.id.flipButton);
|
||||||
flipButton.setOnClickListener(new OnClickListener() {
|
flipButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -635,21 +641,26 @@ public class DroidFish extends Activity implements GUIInterface {
|
||||||
if (largeButtons) {
|
if (largeButtons) {
|
||||||
bWidth = bWidth * 3 / 2;
|
bWidth = bWidth * 3 / 2;
|
||||||
bHeight = bHeight * 3 / 2;
|
bHeight = bHeight * 3 / 2;
|
||||||
|
custButton.setImageResource(R.drawable.custom_large);
|
||||||
flipButton.setImageResource(R.drawable.flip_large);
|
flipButton.setImageResource(R.drawable.flip_large);
|
||||||
modeButton.setImageResource(R.drawable.mode_large);
|
modeButton.setImageResource(R.drawable.mode_large);
|
||||||
undoButton.setImageResource(R.drawable.left_large);
|
undoButton.setImageResource(R.drawable.left_large);
|
||||||
redoButton.setImageResource(R.drawable.right_large);
|
redoButton.setImageResource(R.drawable.right_large);
|
||||||
} else {
|
} else {
|
||||||
|
custButton.setImageResource(R.drawable.custom);
|
||||||
flipButton.setImageResource(R.drawable.flip);
|
flipButton.setImageResource(R.drawable.flip);
|
||||||
modeButton.setImageResource(R.drawable.mode);
|
modeButton.setImageResource(R.drawable.mode);
|
||||||
undoButton.setImageResource(R.drawable.left);
|
undoButton.setImageResource(R.drawable.left);
|
||||||
redoButton.setImageResource(R.drawable.right);
|
redoButton.setImageResource(R.drawable.right);
|
||||||
}
|
}
|
||||||
|
custButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
|
||||||
flipButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
|
flipButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
|
||||||
modeButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
|
modeButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
|
||||||
undoButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
|
undoButton.setLayoutParams(new LinearLayout.LayoutParams(bWidth, bHeight));
|
||||||
redoButton.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.filename = settings.getString("bookFile", "");
|
||||||
bookOptions.maxLength = getIntSetting("bookMaxLength", 1000000);
|
bookOptions.maxLength = getIntSetting("bookMaxLength", 1000000);
|
||||||
bookOptions.preferMainLines = settings.getBoolean("bookPreferMainLines", false);
|
bookOptions.preferMainLines = settings.getBoolean("bookPreferMainLines", false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user