Skip to content

Commit

Permalink
Cleaned up the layouts to work with the new EditText view for the num…
Browse files Browse the repository at this point in the history
…ber of participants
  • Loading branch information
John Wood committed Feb 25, 2010
1 parent bfda6f8 commit 54178bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 6 additions & 4 deletions standup-timer/res/layout-land/main.xml
Expand Up @@ -7,9 +7,11 @@
<TableRow android:gravity="center">
<TextView android:text="@string/number_of_participants" android:padding="3dp" android:textSize="17dp"/>
<View android:layout_width="30dp" android:layout_height="1dp" />
<EditText android:id="@+id/num_participants" android:digits="0123456789"
android:inputType="phone" android:padding="10dp" android:layout_width="200dp"
android:gravity="center" />
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/num_participants" android:digits="0123456789"
android:inputType="phone" android:layout_width="60dp" android:layout_height="wrap_content"
android:gravity="center" />
</LinearLayout>
</TableRow>

<TableRow android:gravity="center" android:paddingTop="10dp">
Expand All @@ -23,7 +25,7 @@
<TextView android:text="@string/team" android:padding="3dp" android:textSize="17dp"/>
<View android:layout_width="30dp" android:layout_height="1dp" />
<Spinner android:id="@+id/team_names" android:drawSelectorOnTop="true"
android:prompt="@string/team" android:padding="10dp" />
android:prompt="@string/team" android:layout_width="wrap_content" />
</TableRow>

<TableRow android:gravity="center" android:paddingTop="10dp">
Expand Down
3 changes: 2 additions & 1 deletion standup-timer/res/layout/main.xml
Expand Up @@ -23,7 +23,8 @@

<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:id="@+id/meeting_length_container"
android:layout_marginLeft="100dp" android:layout_marginRight="100dp" />
android:layout_marginLeft="100dp" android:layout_marginRight="100dp"
android:gravity="center" />

<TextView android:text="@string/team"
android:layout_width="wrap_content" android:layout_height="wrap_content"
Expand Down
Expand Up @@ -165,7 +165,7 @@ private View createMeetingLengthTextBox() {
meetingLengthEditText.setGravity(Gravity.CENTER);
meetingLengthEditText.setKeyListener(new DigitsKeyListener());
meetingLengthEditText.setRawInputType(InputType.TYPE_CLASS_PHONE);
meetingLengthEditText.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
meetingLengthEditText.setLayoutParams(new LayoutParams(dipsToPixels(60), LayoutParams.WRAP_CONTENT));
meetingLengthEditText.setText(Integer.toString(meetingLength));

meetingLengthSpinner = null;
Expand Down Expand Up @@ -310,6 +310,10 @@ private int getSpinnerPositionFromMeetingLength(int meetingLength) {
return pos;
}

private int dipsToPixels(int dips) {
return (int) (dips * getResources().getDisplayMetrics().density);
}

protected int getMeetingLength() {
return meetingLength;
}
Expand Down

0 comments on commit 54178bb

Please sign in to comment.