Reorganized layout of repeat and calendar control in date dialog, updated some strings

pull/14/head
Sam Bosley 14 years ago
parent f215b77a24
commit 0029e881cb

@ -206,17 +206,11 @@ public class GCalControlSet extends PopupControlSet {
@Override
protected void refreshDisplayView() {
TextView t = (TextView) getDisplayView().findViewById(R.id.calendar_display_title);
if (hasEvent) {
t.setText(R.string.gcal_TEA_showCalendar_label);
TextView calendar = (TextView) getDisplayView().findViewById(R.id.calendar_display_which);
if (calendarSelector.getSelectedItemPosition() != 0) {
calendar.setText((String)calendarSelector.getSelectedItem());
} else {
t.setText(R.string.gcal_TEA_addToCalendar_label);
TextView calendar = (TextView) getDisplayView().findViewById(R.id.calendar_display_which);
if (calendarSelector.getSelectedItemPosition() != 0) {
calendar.setText((String)calendarSelector.getSelectedItem());
} else {
calendar.setText("");
}
calendar.setText(R.string.gcal_TEA_none_selected);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -9,28 +9,21 @@
android:id="@+id/gcal_body"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:paddingLeft="5dip"
android:gravity="center_vertical">
<ImageView
style="@style/EditRowImage"
android:src="@drawable/icn_edit_calendar"/>
<TextView
android:id="@+id/calendar_display_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dip"
android:text="@string/gcal_TEA_addToCalendar_label"
style="@style/TextAppearance.GEN_EditLabel.DLG_EditLabel" />
<TextView
android:id="@+id/calendar_display_which"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:gravity="left"
android:maxLines="1"
android:ellipsize="end"
android:paddingLeft="10dip"
android:paddingLeft="5dip"
style="@style/TextAppearance.EditRowDisplay" />
<include layout="@layout/task_edit_arrow"/>
</LinearLayout>
<View
android:layout_width="fill_parent"

@ -14,21 +14,18 @@
<ImageView
style="@style/EditRowImage"
android:src="@drawable/icn_edit_repeats"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dip"
android:text="@string/repeat_enabled"
style="@style/TextAppearance.GEN_EditLabel.DLG_EditLabel" />
<TextView
android:id="@+id/repeat_display"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:paddingLeft="10dip"
android:gravity="left"
android:paddingLeft="5dip"
style="@style/TextAppearance.EditRowDisplay" />
<include layout="@layout/task_edit_arrow"/>
<View
android:layout_width="1px"
android:layout_height="fill_parent"
style="@style/TEA_Separator" />
</LinearLayout>
<View
android:layout_width="fill_parent"

@ -13,10 +13,15 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/datetime_extras"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"/>
<com.todoroo.astrid.ui.CalendarView
android:id="@+id/calendar"
android:layout_width="fill_parent"
android:layout_height="280dip"
android:layout_height="250dip"
android:layout_weight="1" />
<LinearLayout
android:layout_width="fill_parent"

@ -27,6 +27,8 @@
<!-- No calendar label (don't add option) -->
<string name="gcal_TEA_nocal">Don\'t add</string>
<string name="gcal_TEA_none_selected">Add to cal...</string>
<!-- ======================================================== Calendars == -->
<!-- Calendar event name when task is completed (%s => task title) -->

@ -19,7 +19,7 @@
<!-- hint when opening repeat interval -->
<string name="repeat_interval_prompt">Repeat Interval</string>
<string name="repeat_never">Never</string>
<string name="repeat_never">No Repeat</string>
<string name="repeat_dont">Don\'t repeat</string>

@ -282,20 +282,20 @@ public final class TaskEditActivity extends Activity {
RepeatControlSet repeatControls = new RepeatControlSet(
TaskEditActivity.this, R.layout.control_set_repeat,
R.layout.control_set_repeat_display, R.string.repeat_enabled);
controls.add(repeatControls);
GCalControlSet gcalControl = new GCalControlSet(TaskEditActivity.this,
R.layout.control_set_gcal, R.layout.control_set_gcal_display,
R.string.gcal_TEA_addToCalendar_label);
//The deadline control set contains the repeat controls and the calendar controls.
//NOTE: we add the gcalControl to the list AFTER the deadline control, because
//NOTE: we add the gcalControl and repeatControl to the list AFTER the deadline control, because
//otherwise the correct date may not be written to the calendar event. Order matters!
DeadlineControlSet deadlineControl = new DeadlineControlSet(
TaskEditActivity.this, R.layout.control_set_deadline,
R.layout.control_set_deadline_display, repeatControls.getDisplayView(), gcalControl.getDisplayView());
controls.add(deadlineControl);
controlSetMap.put(getString(R.string.TEA_ctrl_when_pref), deadlineControl);
controls.add(repeatControls);
controls.add(gcalControl);
ImportanceControlSet importanceControl = new ImportanceControlSet(

@ -4,6 +4,7 @@ import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -20,9 +21,10 @@ public class DeadlineControlSet extends PopupControlSet {
super(activity, viewLayout, displayViewLayout, 0);
dateAndTimePicker = (DateAndTimePicker) getView().findViewById(R.id.date_and_time);
LinearLayout body = (LinearLayout) getView().findViewById(R.id.datetime_body);
LinearLayout extras = (LinearLayout) getView().findViewById(R.id.datetime_extras);
for (View v : extraViews) {
body.addView(v);
LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 1.0f);
extras.addView(v, lp);
}
Button okButton = (Button) LayoutInflater.from(activity).inflate(R.layout.control_dialog_ok, null);
@ -33,6 +35,7 @@ public class DeadlineControlSet extends PopupControlSet {
DialogUtilities.dismissDialog(DeadlineControlSet.this.activity, DeadlineControlSet.this.dialog);
}
});
LinearLayout body = (LinearLayout) getView().findViewById(R.id.datetime_body);
body.addView(okButton);
}

Loading…
Cancel
Save