DroidFish: In edit board portrait mode, use only a single title bar line.

This commit is contained in:
Peter Osterlund 2012-09-29 23:28:30 +00:00
parent 9858697da2
commit c43d652207
3 changed files with 17 additions and 14 deletions

View File

@ -13,6 +13,7 @@
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:layout_gravity="center_vertical"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="2dp" > android:paddingLeft="2dp" >
<LinearLayout <LinearLayout
@ -29,6 +30,7 @@
style="?android:attr/windowTitleStyle" style="?android:attr/windowTitleStyle"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="true" android:focusable="true"
@ -39,10 +41,11 @@
android:singleLine="true" android:singleLine="true"
android:tag="title" /> android:tag="title" />
<TextView <TextView
android:id="@+id/title_text" android:id="@+id/title_text_summary"
style="?android:attr/windowTitleStyle" style="?android:attr/windowTitleStyle"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:tag="title" android:tag="title"
@ -52,6 +55,7 @@
style="?android:attr/windowTitleStyle" style="?android:attr/windowTitleStyle"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="2dp"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="true" android:focusable="true"
@ -127,7 +131,7 @@
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/title_text_summary" android:id="@+id/title_text"
style="?android:attr/windowTitleStyle" style="?android:attr/windowTitleStyle"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -13,7 +13,8 @@
class="org.petero.droidfish.activities.ChessBoardEdit" class="org.petero.droidfish.activities.ChessBoardEdit"
android:id="@+id/eb_chessboard" android:id="@+id/eb_chessboard"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"/> android:layout_height="fill_parent">
</view>
<TextView <TextView
android:text="" android:text=""
android:id="@+id/eb_status" android:id="@+id/eb_status"
@ -21,7 +22,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:includeFontPadding="true" android:includeFontPadding="true"
android:typeface="monospace" android:typeface="monospace"
android:textSize="10dip"/> android:textSize="10dip">
</TextView>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:id="@+id/LinearLayout02" android:id="@+id/LinearLayout02"

View File

@ -65,13 +65,11 @@ public class EditBoard extends Activity {
private TextView status; private TextView status;
private Button okButton; private Button okButton;
private Button cancelButton; private Button cancelButton;
private TextView whiteTitleText, blackTitleText, engineTitleText;
private boolean egtbHints; private boolean egtbHints;
private boolean autoScrollTitle; private boolean autoScrollTitle;
private TextView whiteFigText; private TextView whiteFigText;
private TextView blackFigText; private TextView blackFigText;
private TextView summaryTitleText;
private Typeface figNotation; private Typeface figNotation;
@Override @Override
@ -125,11 +123,11 @@ public class EditBoard extends Activity {
okButton = (Button)findViewById(R.id.eb_ok); okButton = (Button)findViewById(R.id.eb_ok);
cancelButton = (Button)findViewById(R.id.eb_cancel); cancelButton = (Button)findViewById(R.id.eb_cancel);
whiteTitleText = (TextView)findViewById(R.id.white_clock); TextView whiteTitleText = (TextView)findViewById(R.id.white_clock);
whiteTitleText.setText(R.string.edit_board); whiteTitleText.setVisibility(View.GONE);
blackTitleText = (TextView)findViewById(R.id.black_clock); TextView blackTitleText = (TextView)findViewById(R.id.black_clock);
blackTitleText.setVisibility(View.GONE); blackTitleText.setVisibility(View.GONE);
engineTitleText = (TextView)findViewById(R.id.title_text); TextView engineTitleText = (TextView)findViewById(R.id.title_text);
engineTitleText.setVisibility(View.GONE); engineTitleText.setVisibility(View.GONE);
whiteFigText = (TextView) findViewById(R.id.white_pieces); whiteFigText = (TextView) findViewById(R.id.white_pieces);
whiteFigText.setTypeface(figNotation); whiteFigText.setTypeface(figNotation);
@ -139,13 +137,12 @@ public class EditBoard extends Activity {
blackFigText.setTypeface(figNotation); blackFigText.setTypeface(figNotation);
blackFigText.setSelected(true); blackFigText.setSelected(true);
blackFigText.setTextColor(blackTitleText.getTextColors()); blackFigText.setTextColor(blackTitleText.getTextColors());
summaryTitleText = (TextView) findViewById(R.id.title_text_summary); TextView summaryTitleText = (TextView) findViewById(R.id.title_text_summary);
summaryTitleText.setVisibility(View.GONE); summaryTitleText.setText(R.string.edit_board);
TextUtils.TruncateAt where = autoScrollTitle ? TextUtils.TruncateAt.MARQUEE TextUtils.TruncateAt where = autoScrollTitle ? TextUtils.TruncateAt.MARQUEE
: TextUtils.TruncateAt.END; : TextUtils.TruncateAt.END;
whiteTitleText.setEllipsize(where); engineTitleText.setEllipsize(where);
blackTitleText.setEllipsize(where);
whiteFigText.setEllipsize(where); whiteFigText.setEllipsize(where);
blackFigText.setEllipsize(where); blackFigText.setEllipsize(where);