diff --git a/DroidFish/res/layout/create_pgn_file.xml b/DroidFish/res/layout/create_pgn_file.xml index 7a58479..f1200ea 100644 --- a/DroidFish/res/layout/create_pgn_file.xml +++ b/DroidFish/res/layout/create_pgn_file.xml @@ -1,45 +1,21 @@ - + android:orientation="horizontal" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp"> + android:paddingRight="10dp" + android:text="@string/filename"> - - - - - - + \ No newline at end of file diff --git a/DroidFish/res/layout/edit_comments.xml b/DroidFish/res/layout/edit_comments.xml index 2b77945..b6717c5 100644 --- a/DroidFish/res/layout/edit_comments.xml +++ b/DroidFish/res/layout/edit_comments.xml @@ -15,7 +15,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:paddingRight="10dp" - android:text="Before"> + android:text="Before:"> + android:text="Move:"> + android:text="After:"> + android:text="Event:"> + android:text="Site:"> + android:text="Date:"> + android:text="White:"> + android:text="Black:"> + android:text="@string/halfmove"> + android:text="@string/fullmove"> + android:inputType="text" + android:layout_margin="10dp"> diff --git a/DroidFish/res/layout/select_percentage.xml b/DroidFish/res/layout/select_percentage.xml index 0fa7f6e..6086a89 100644 --- a/DroidFish/res/layout/select_percentage.xml +++ b/DroidFish/res/layout/select_percentage.xml @@ -8,7 +8,7 @@ Load Next Game No previous game No next game + Ok + Cancel + Move number: + Filename: + Halfmove clock: + Fullmove counter: + Filter text diff --git a/DroidFish/src/org/petero/droidfish/DroidFish.java b/DroidFish/src/org/petero/droidfish/DroidFish.java index 7190749..1b60404 100644 --- a/DroidFish/src/org/petero/droidfish/DroidFish.java +++ b/DroidFish/src/org/petero/droidfish/DroidFish.java @@ -1078,12 +1078,12 @@ public class DroidFish extends Activity implements GUIInterface { } } }; - builder.setPositiveButton("Ok", new Dialog.OnClickListener() { + builder.setPositiveButton(R.string.ok, new Dialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { gotoMove.run(); } }); - builder.setNegativeButton("Cancel", null); + builder.setNegativeButton(R.string.cancel, null); final AlertDialog dialog = builder.create(); @@ -1217,12 +1217,11 @@ public class DroidFish extends Activity implements GUIInterface { return alert; } case SELECT_PGN_SAVE_NEWFILE_DIALOG: { - final Dialog dialog = new Dialog(this); - dialog.setContentView(R.layout.create_pgn_file); - dialog.setTitle(R.string.select_pgn_file_save); - final EditText fileNameView = (EditText)dialog.findViewById(R.id.create_pgn_filename); - Button ok = (Button)dialog.findViewById(R.id.create_pgn_ok); - Button cancel = (Button)dialog.findViewById(R.id.create_pgn_cancel); + View content = View.inflate(this, R.layout.create_pgn_file, null); + final AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setView(content); + builder.setTitle(R.string.select_pgn_file_save); + final EditText fileNameView = (EditText)content.findViewById(R.id.create_pgn_filename); fileNameView.setText(""); final Runnable savePGN = new Runnable() { public void run() { @@ -1230,28 +1229,26 @@ public class DroidFish extends Activity implements GUIInterface { if ((pgnFile.length() > 0) && !pgnFile.contains(".")) pgnFile += ".pgn"; savePGNToFile(ctrl.getPGN(), pgnFile, false); - dialog.cancel(); } }; + builder.setPositiveButton(R.string.ok, new Dialog.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + savePGN.run(); + } + }); + builder.setNegativeButton(R.string.cancel, null); + + final Dialog dialog = builder.create(); fileNameView.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) { savePGN.run(); + dialog.cancel(); return true; } return false; } }); - ok.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - savePGN.run(); - } - }); - cancel.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - dialog.cancel(); - } - }); return dialog; } @@ -1363,8 +1360,8 @@ public class DroidFish extends Activity implements GUIInterface { white.setText(headers.get("White")); black.setText(headers.get("Black")); - builder.setNegativeButton("Cancel", null); - builder.setPositiveButton("Ok", new Dialog.OnClickListener() { + builder.setNegativeButton(R.string.cancel, null); + builder.setPositiveButton(R.string.ok, new Dialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { headers.put("Event", event.getText().toString().trim()); headers.put("Site", site .getText().toString().trim()); @@ -1401,8 +1398,8 @@ public class DroidFish extends Activity implements GUIInterface { nagStr = String.format("%d", commInfo.nag); nag.setText(nagStr); - builder.setNegativeButton("Cancel", null); - builder.setPositiveButton("Ok", new Dialog.OnClickListener() { + builder.setNegativeButton(R.string.cancel, null); + builder.setPositiveButton(R.string.ok, new Dialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { String pre = preComment.getText().toString().trim(); String post = postComment.getText().toString().trim(); diff --git a/DroidFish/src/org/petero/droidfish/SeekBarPreference.java b/DroidFish/src/org/petero/droidfish/SeekBarPreference.java index a36d86c..f3f4b6a 100644 --- a/DroidFish/src/org/petero/droidfish/SeekBarPreference.java +++ b/DroidFish/src/org/petero/droidfish/SeekBarPreference.java @@ -43,8 +43,7 @@ public class SeekBarPreference extends Preference protected View onCreateView(ViewGroup parent) { TextView name = new TextView(getContext()); name.setText(getTitle()); - name.setTextSize(20); - name.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); + name.setTextAppearance(getContext(), android.R.style.TextAppearance_Large); name.setGravity(Gravity.LEFT); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,