mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 11:31:33 +01:00
Use binding in LoadFEN and EditPGN
This commit is contained in:
parent
0324409feb
commit
31d8ebab0e
|
@ -18,27 +18,12 @@
|
|||
|
||||
package org.petero.droidfish.activities;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.petero.droidfish.ColorTheme;
|
||||
import org.petero.droidfish.DroidFishApp;
|
||||
import org.petero.droidfish.ObjectCache;
|
||||
import org.petero.droidfish.R;
|
||||
import org.petero.droidfish.Util;
|
||||
import org.petero.droidfish.activities.PGNFile.GameInfo;
|
||||
import org.petero.droidfish.activities.PGNFile.GameInfoResult;
|
||||
import org.petero.droidfish.gamelogic.Pair;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.ListActivity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.DialogInterface.OnCancelListener;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
|
@ -49,14 +34,26 @@ import android.view.Menu;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView.OnItemLongClickListener;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import org.petero.droidfish.ColorTheme;
|
||||
import org.petero.droidfish.DroidFishApp;
|
||||
import org.petero.droidfish.ObjectCache;
|
||||
import org.petero.droidfish.R;
|
||||
import org.petero.droidfish.Util;
|
||||
import org.petero.droidfish.activities.PGNFile.GameInfo;
|
||||
import org.petero.droidfish.activities.PGNFile.GameInfoResult;
|
||||
import org.petero.droidfish.databinding.SelectGameBinding;
|
||||
import org.petero.droidfish.gamelogic.Pair;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
public abstract class EditPGN extends ListActivity {
|
||||
static ArrayList<GameInfo> gamesInFile = new ArrayList<>();
|
||||
|
@ -65,8 +62,6 @@ public abstract class EditPGN extends ListActivity {
|
|||
ProgressDialog progress;
|
||||
private GameInfo selectedGi = null;
|
||||
ArrayAdapter<GameInfo> aa = null;
|
||||
TextView hintText = null;
|
||||
EditText filterText = null;
|
||||
|
||||
SharedPreferences settings;
|
||||
int defaultItem = 0;
|
||||
|
@ -80,6 +75,8 @@ public abstract class EditPGN extends ListActivity {
|
|||
boolean loadGame; // True when loading game, false when saving
|
||||
String pgnToSave;
|
||||
|
||||
private SelectGameBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -124,7 +121,7 @@ public abstract class EditPGN extends ListActivity {
|
|||
});
|
||||
workThread.start();
|
||||
} else if ("org.petero.droidfish.loadFileNextGame".equals(action) ||
|
||||
"org.petero.droidfish.loadFilePrevGame".equals(action)) {
|
||||
"org.petero.droidfish.loadFilePrevGame".equals(action)) {
|
||||
pgnFile = new PGNFile(fileName);
|
||||
loadGame = true;
|
||||
boolean next = action.equals("org.petero.droidfish.loadFileNextGame");
|
||||
|
@ -227,9 +224,9 @@ public abstract class EditPGN extends ListActivity {
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.item_delete_file:
|
||||
reShowDialog(DELETE_PGN_FILE_DIALOG);
|
||||
break;
|
||||
case R.id.item_delete_file:
|
||||
reShowDialog(DELETE_PGN_FILE_DIALOG);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -237,7 +234,7 @@ public abstract class EditPGN extends ListActivity {
|
|||
private void showList() {
|
||||
progress = null;
|
||||
removeDialog(PROGRESS_DIALOG);
|
||||
setContentView(R.layout.select_game);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.select_game);
|
||||
Util.overrideViewAttribs(findViewById(android.R.id.content));
|
||||
aa = new ArrayAdapter<GameInfo>(this, R.layout.select_game_list_item, gamesInFile) {
|
||||
@Override
|
||||
|
@ -272,24 +269,26 @@ public abstract class EditPGN extends ListActivity {
|
|||
return true;
|
||||
});
|
||||
|
||||
filterText = findViewById(R.id.select_game_filter);
|
||||
filterText.addTextChangedListener(new TextWatcher() {
|
||||
binding.selectGameFilter.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) { }
|
||||
public void afterTextChanged(Editable s) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
aa.getFilter().filter(s);
|
||||
lastSearchString = s.toString();
|
||||
}
|
||||
});
|
||||
filterText.setText(lastSearchString);
|
||||
hintText = findViewById(R.id.select_game_hint);
|
||||
binding.selectGameFilter.setText(lastSearchString);
|
||||
if (loadGame) {
|
||||
hintText.setVisibility(View.GONE);
|
||||
binding.selectGameHint.setVisibility(View.GONE);
|
||||
} else {
|
||||
hintText.setText(R.string.save_game_hint);
|
||||
binding.selectGameHint.setText(R.string.save_game_hint);
|
||||
}
|
||||
lv.requestFocus();
|
||||
}
|
||||
|
@ -304,7 +303,9 @@ public abstract class EditPGN extends ListActivity {
|
|||
final static int SAVE_GAME_DIALOG = 2;
|
||||
final static int DELETE_PGN_FILE_DIALOG = 3;
|
||||
|
||||
/** Remove and show a dialog. */
|
||||
/**
|
||||
* Remove and show a dialog.
|
||||
*/
|
||||
private void reShowDialog(int id) {
|
||||
removeDialog(id);
|
||||
showDialog(id);
|
||||
|
@ -313,74 +314,81 @@ public abstract class EditPGN extends ListActivity {
|
|||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
switch (id) {
|
||||
case PROGRESS_DIALOG:
|
||||
progress = new ProgressDialog(this);
|
||||
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
progress.setTitle(R.string.reading_pgn_file);
|
||||
progress.setOnCancelListener(dialog -> {
|
||||
canceled = true;
|
||||
Thread thr = workThread;
|
||||
if (thr != null)
|
||||
thr.interrupt();
|
||||
});
|
||||
return progress;
|
||||
case DELETE_GAME_DIALOG: {
|
||||
final GameInfo gi = selectedGi;
|
||||
selectedGi = null;
|
||||
if (gi == null)
|
||||
case PROGRESS_DIALOG:
|
||||
progress = new ProgressDialog(this);
|
||||
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
progress.setTitle(R.string.reading_pgn_file);
|
||||
progress.setOnCancelListener(dialog -> {
|
||||
canceled = true;
|
||||
Thread thr = workThread;
|
||||
if (thr != null)
|
||||
thr.interrupt();
|
||||
});
|
||||
return progress;
|
||||
case DELETE_GAME_DIALOG: {
|
||||
final GameInfo gi = selectedGi;
|
||||
selectedGi = null;
|
||||
if (gi == null)
|
||||
return null;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.delete_game);
|
||||
String msg = gi.toString();
|
||||
builder.setMessage(msg);
|
||||
builder.setPositiveButton(R.string.yes, (dialog, id14) -> {
|
||||
deleteGame(gi);
|
||||
dialog.cancel();
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, (dialog, id13) -> dialog.cancel());
|
||||
return builder.create();
|
||||
}
|
||||
case SAVE_GAME_DIALOG: {
|
||||
final GameInfo gi = selectedGi;
|
||||
selectedGi = null;
|
||||
if (gi == null)
|
||||
return null;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.save_game_question);
|
||||
final CharSequence[] items = {
|
||||
getString(R.string.before_selected),
|
||||
getString(R.string.after_selected),
|
||||
getString(R.string.replace_selected),
|
||||
};
|
||||
builder.setItems(items, (dialog, item) -> {
|
||||
GameInfo giToReplace;
|
||||
switch (item) {
|
||||
case 0:
|
||||
giToReplace = new GameInfo().setNull(gi.startPos);
|
||||
break;
|
||||
case 1:
|
||||
giToReplace = new GameInfo().setNull(gi.endPos);
|
||||
break;
|
||||
case 2:
|
||||
giToReplace = gi;
|
||||
break;
|
||||
default:
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
pgnFile.replacePGN(pgnToSave, giToReplace);
|
||||
finish();
|
||||
});
|
||||
return builder.create();
|
||||
}
|
||||
case DELETE_PGN_FILE_DIALOG: {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.delete_file_question);
|
||||
String name = new File(pgnFile.getName()).getName();
|
||||
String msg = String.format(Locale.US, getString(R.string.delete_named_file), name);
|
||||
builder.setMessage(msg);
|
||||
builder.setPositiveButton(R.string.yes, (dialog, id12) -> {
|
||||
pgnFile.delete();
|
||||
finish();
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, (dialog, id1) -> dialog.cancel());
|
||||
return builder.create();
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.delete_game);
|
||||
String msg = gi.toString();
|
||||
builder.setMessage(msg);
|
||||
builder.setPositiveButton(R.string.yes, (dialog, id14) -> {
|
||||
deleteGame(gi);
|
||||
dialog.cancel();
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, (dialog, id13) -> dialog.cancel());
|
||||
return builder.create();
|
||||
}
|
||||
case SAVE_GAME_DIALOG: {
|
||||
final GameInfo gi = selectedGi;
|
||||
selectedGi = null;
|
||||
if (gi == null)
|
||||
return null;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.save_game_question);
|
||||
final CharSequence[] items = {
|
||||
getString(R.string.before_selected),
|
||||
getString(R.string.after_selected),
|
||||
getString(R.string.replace_selected),
|
||||
};
|
||||
builder.setItems(items, (dialog, item) -> {
|
||||
GameInfo giToReplace;
|
||||
switch (item) {
|
||||
case 0: giToReplace = new GameInfo().setNull(gi.startPos); break;
|
||||
case 1: giToReplace = new GameInfo().setNull(gi.endPos); break;
|
||||
case 2: giToReplace = gi; break;
|
||||
default:
|
||||
finish(); return;
|
||||
}
|
||||
pgnFile.replacePGN(pgnToSave, giToReplace);
|
||||
finish();
|
||||
});
|
||||
return builder.create();
|
||||
}
|
||||
case DELETE_PGN_FILE_DIALOG: {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.delete_file_question);
|
||||
String name = new File(pgnFile.getName()).getName();
|
||||
String msg = String.format(Locale.US, getString(R.string.delete_named_file), name);
|
||||
builder.setMessage(msg);
|
||||
builder.setPositiveButton(R.string.yes, (dialog, id12) -> {
|
||||
pgnFile.delete();
|
||||
finish();
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, (dialog, id1) -> dialog.cancel());
|
||||
return builder.create();
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -395,15 +403,15 @@ public abstract class EditPGN extends ListActivity {
|
|||
if (p.first != GameInfoResult.OK) {
|
||||
gamesInFile = new ArrayList<>();
|
||||
switch (p.first) {
|
||||
case OUT_OF_MEMORY:
|
||||
runOnUiThread(() -> DroidFishApp.toast(R.string.file_too_large, Toast.LENGTH_SHORT));
|
||||
break;
|
||||
case NOT_PGN:
|
||||
runOnUiThread(() -> DroidFishApp.toast(R.string.not_a_pgn_file, Toast.LENGTH_SHORT));
|
||||
break;
|
||||
case CANCEL:
|
||||
case OK:
|
||||
break;
|
||||
case OUT_OF_MEMORY:
|
||||
runOnUiThread(() -> DroidFishApp.toast(R.string.file_too_large, Toast.LENGTH_SHORT));
|
||||
break;
|
||||
case NOT_PGN:
|
||||
runOnUiThread(() -> DroidFishApp.toast(R.string.not_a_pgn_file, Toast.LENGTH_SHORT));
|
||||
break;
|
||||
case CANCEL:
|
||||
case OK:
|
||||
break;
|
||||
}
|
||||
setResult(RESULT_CANCELED);
|
||||
finish();
|
||||
|
@ -431,10 +439,10 @@ public abstract class EditPGN extends ListActivity {
|
|||
private void deleteGame(GameInfo gi) {
|
||||
if (pgnFile.deleteGame(gi, gamesInFile)) {
|
||||
ListView lv = getListView();
|
||||
int pos = lv.pointToPosition(0,0);
|
||||
int pos = lv.pointToPosition(0, 0);
|
||||
aa = new ArrayAdapter<>(this, R.layout.select_game_list_item, gamesInFile);
|
||||
setListAdapter(aa);
|
||||
String s = filterText.getText().toString();
|
||||
String s = binding.selectGameFilter.getText().toString();
|
||||
aa.getFilter().filter(s);
|
||||
lv.setSelection(pos);
|
||||
// Update lastModTime, since current change has already been handled
|
||||
|
|
|
@ -18,22 +18,6 @@
|
|||
|
||||
package org.petero.droidfish.activities;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import org.petero.droidfish.ChessBoardPlay;
|
||||
import org.petero.droidfish.ColorTheme;
|
||||
import org.petero.droidfish.DroidFishApp;
|
||||
import org.petero.droidfish.R;
|
||||
import org.petero.droidfish.Util;
|
||||
import org.petero.droidfish.activities.FENFile.FenInfo;
|
||||
import org.petero.droidfish.activities.FENFile.FenInfoResult;
|
||||
import org.petero.droidfish.gamelogic.ChessParseError;
|
||||
import org.petero.droidfish.gamelogic.Pair;
|
||||
import org.petero.droidfish.gamelogic.Position;
|
||||
import org.petero.droidfish.gamelogic.TextIO;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
|
@ -48,16 +32,30 @@ import android.content.res.Configuration;
|
|||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView.OnItemLongClickListener;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import org.petero.droidfish.ColorTheme;
|
||||
import org.petero.droidfish.DroidFishApp;
|
||||
import org.petero.droidfish.R;
|
||||
import org.petero.droidfish.Util;
|
||||
import org.petero.droidfish.activities.FENFile.FenInfo;
|
||||
import org.petero.droidfish.activities.FENFile.FenInfoResult;
|
||||
import org.petero.droidfish.databinding.LoadFenBinding;
|
||||
import org.petero.droidfish.gamelogic.ChessParseError;
|
||||
import org.petero.droidfish.gamelogic.Pair;
|
||||
import org.petero.droidfish.gamelogic.Position;
|
||||
import org.petero.droidfish.gamelogic.TextIO;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
public class LoadFEN extends ListActivity {
|
||||
private static ArrayList<FenInfo> fensInFile = new ArrayList<>();
|
||||
|
@ -76,8 +74,7 @@ public class LoadFEN extends ListActivity {
|
|||
private CountDownLatch progressLatch = null;
|
||||
private boolean canceled = false;
|
||||
|
||||
private ChessBoardPlay cb;
|
||||
private Button okButton;
|
||||
LoadFenBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -126,7 +123,7 @@ public class LoadFEN extends ListActivity {
|
|||
});
|
||||
workThread.start();
|
||||
} else if ("org.petero.droidfish.loadNextFen".equals(action) ||
|
||||
"org.petero.droidfish.loadPrevFen".equals(action)) {
|
||||
"org.petero.droidfish.loadPrevFen".equals(action)) {
|
||||
fenFile = new FENFile(fileName);
|
||||
boolean next = action.equals("org.petero.droidfish.loadNextFen");
|
||||
final int loadItem = defaultItem + (next ? 1 : -1);
|
||||
|
@ -192,17 +189,13 @@ public class LoadFEN extends ListActivity {
|
|||
progress = null;
|
||||
removeProgressDialog();
|
||||
setContentView(R.layout.load_fen);
|
||||
|
||||
cb = findViewById(R.id.loadfen_chessboard);
|
||||
okButton = findViewById(R.id.loadfen_ok);
|
||||
Button cancelButton = findViewById(R.id.loadfen_cancel);
|
||||
|
||||
okButton.setEnabled(false);
|
||||
okButton.setOnClickListener(v -> {
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.load_fen);
|
||||
binding.loadfenOk.setEnabled(false);
|
||||
binding.loadfenOk.setOnClickListener(v -> {
|
||||
if (selectedFi != null)
|
||||
sendBackResult(selectedFi, false);
|
||||
});
|
||||
cancelButton.setOnClickListener(v -> {
|
||||
binding.loadfenCancel.setOnClickListener(v -> {
|
||||
setResult(RESULT_CANCELED);
|
||||
finish();
|
||||
});
|
||||
|
@ -235,8 +228,8 @@ public class LoadFEN extends ListActivity {
|
|||
chessPos = e2.pos;
|
||||
}
|
||||
if (chessPos != null) {
|
||||
cb.setPosition(chessPos);
|
||||
okButton.setEnabled(true);
|
||||
binding.loadfenChessboard.setPosition(chessPos);
|
||||
binding.loadfenOk.setEnabled(true);
|
||||
}
|
||||
});
|
||||
lv.setOnItemLongClickListener((parent, view, pos, id) -> {
|
||||
|
@ -260,18 +253,18 @@ public class LoadFEN extends ListActivity {
|
|||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
if (cb != null) {
|
||||
Position pos = cb.pos;
|
||||
if (binding.loadfenChessboard != null) {
|
||||
Position pos = binding.loadfenChessboard.pos;
|
||||
showList();
|
||||
cb.setPosition(pos);
|
||||
okButton.setEnabled(selectedFi != null);
|
||||
binding.loadfenChessboard.setPosition(pos);
|
||||
binding.loadfenOk.setEnabled(selectedFi != null);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ProgressFragment extends DialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
LoadFEN a = (LoadFEN)getActivity();
|
||||
LoadFEN a = (LoadFEN) getActivity();
|
||||
ProgressDialog progress = new ProgressDialog(a);
|
||||
progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
progress.setTitle(R.string.reading_fen_file);
|
||||
|
@ -279,12 +272,13 @@ public class LoadFEN extends ListActivity {
|
|||
a.progressLatch.countDown();
|
||||
return progress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
Activity a = getActivity();
|
||||
if (a instanceof LoadFEN) {
|
||||
LoadFEN lf = (LoadFEN)a;
|
||||
LoadFEN lf = (LoadFEN) a;
|
||||
lf.canceled = true;
|
||||
Thread thr = lf.workThread;
|
||||
if (thr != null)
|
||||
|
@ -301,7 +295,7 @@ public class LoadFEN extends ListActivity {
|
|||
private void removeProgressDialog() {
|
||||
Fragment f = getFragmentManager().findFragmentByTag("progress");
|
||||
if (f instanceof DialogFragment)
|
||||
((DialogFragment)f).dismiss();
|
||||
((DialogFragment) f).dismiss();
|
||||
}
|
||||
|
||||
private boolean readFile() {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -44,6 +45,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@android:string/ok" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,54 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_weight="1"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:focusable="false">
|
||||
</ListView>
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="2"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<view
|
||||
class="org.petero.droidfish.ChessBoardPlay"
|
||||
android:id="@+id/loadfen_chessboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
</view>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
<Button
|
||||
android:id="@+id/loadfen_cancel"
|
||||
android:text="@string/cancel"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:focusable="false" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.petero.droidfish.ChessBoardPlay
|
||||
android:id="@+id/loadfen_chessboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
</Button>
|
||||
<Button
|
||||
android:id="@+id/loadfen_ok"
|
||||
android:text="@android:string/ok"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
</Button>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/loadfen_cancel"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/cancel" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/loadfen_ok"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@android:string/ok" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
|
|
|
@ -1,49 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false">
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<view
|
||||
class="org.petero.droidfish.ChessBoardPlay"
|
||||
android:id="@+id/loadfen_chessboard"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
</view>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
android:id="@+id/loadfen_cancel"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/cancel">
|
||||
</Button>
|
||||
<Button
|
||||
android:text="@android:string/ok"
|
||||
android:id="@+id/loadfen_ok"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:focusable="false">
|
||||
</ListView>
|
||||
</LinearLayout>
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.petero.droidfish.ChessBoardPlay
|
||||
android:id="@+id/loadfen_chessboard"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/loadfen_cancel"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/cancel" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/loadfen_ok"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@android:string/ok" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:focusable="false" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
|
|
|
@ -1,28 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/select_game_hint"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="true">
|
||||
</TextView>
|
||||
<EditText
|
||||
android:id="@+id/select_game_filter"
|
||||
android:hint="@string/filter_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_margin="10dp">
|
||||
</EditText>
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:focusable="false">
|
||||
</ListView>
|
||||
</LinearLayout>
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/select_game_hint"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="true" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/select_game_filter"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:hint="@string/filter_text"
|
||||
android:inputType="text"
|
||||
android:maxLines="1" />
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:focusable="false" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
android:gravity="center"
|
||||
android:text="Default Description"
|
||||
android:textColor="@color/White" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in New Issue
Block a user