Merge branch '120710_js_cal_ab_test'

pull/14/head
Sam Bosley 12 years ago
commit c19a87a0a6

@ -55,6 +55,8 @@ public class LabsPreferences extends TodorooPreferenceActivity {
} else if (r.getString(R.string.p_third_party_addons).equals(key)) {
setEnabledSummary(preference, value,
R.string.EPr_third_party_addons_desc_enabled, R.string.EPr_third_party_addons_desc_disabled);
} else if (r.getString(R.string.p_end_at_deadline).equals(key)){
setEnabledSummary(preference, value, R.string.EPr_cal_start_at_due_time, R.string.EPr_cal_end_at_due_time);
} else if (r.getString(R.string.p_ideas_tab_enabled).equals(key)) {
if (!Constants.MARKET_STRATEGY.allowIdeasTab()) {
PreferenceScreen screen = getPreferenceScreen();

@ -181,8 +181,13 @@ public class GCalHelper {
long estimatedTime = task.getValue(Task.ESTIMATED_SECONDS) * 1000;
if(estimatedTime <= 0)
estimatedTime = DEFAULT_CAL_TIME;
values.put("dtstart", dueDate - estimatedTime);
values.put("dtend", dueDate);
if (Preferences.getBoolean(R.string.p_end_at_deadline, true)) {
values.put("dtstart", dueDate);
values.put("dtend", dueDate + estimatedTime);
}else{
values.put("dtstart", dueDate - estimatedTime);
values.put("dtend", dueDate);
}
// setting a duetime to a previously timeless event requires explicitly setting allDay=0
values.put("allDay", "0");
values.put("eventTimezone", TimeZone.getDefault().getID());

@ -305,6 +305,9 @@
<!-- use new contact picker setting -->
<string name="p_use_contact_picker">p_use_contact_picker</string>
<!-- on calendar end at dealline if true, start at deadline if false -->
<string name="p_end_at_deadline">p_end_at_deadline</string>
<string-array name="EPr_default_addtocalendar_values">
<!-- addtocalendar: labels that map EPr_default_addtocalendar items to calendar selection in settings. -->
<item>-1</item>

@ -647,6 +647,12 @@
<string name="EPr_ideas_tab_enabled">Task Ideas</string>
<string name="EPr_ideas_tab_description">Get ideas to help you complete tasks</string>
<!-- Preferences: calendar event start time -->
<string name = "EPr_cal_end_or_start_at_due_time">Calendar event time</string>
<string name = "EPr_cal_end_at_due_time">End calendar events at due time</string>
<string name = "EPr_cal_start_at_due_time">Start calendar events at due time</string>
<string name="EPr_swipe_lists_restart_alert">You will need to restart Astrid for this change to take effect</string>
<string-array name="EPr_swipe_lists_performance_mode">
@ -656,6 +662,7 @@
<item>High Performance</item>
</string-array>
<string-array name="EPr_swipe_lists_performance_desc">
<!-- slide 49a -->
<item>Swipe between lists is disabled</item>

@ -22,4 +22,8 @@
android:key="@string/p_ideas_tab_enabled"
android:title="@string/EPr_ideas_tab_enabled"
android:summary="@string/EPr_ideas_tab_description" />
<CheckBoxPreference
android:title="@string/EPr_cal_end_or_start_at_due_time"
android:key = "@string/p_end_at_deadline" />
</PreferenceScreen>

@ -114,7 +114,10 @@ public class ABTests {
bundles.put(testKey, bundle);
}
private void initialize() { // Set up
public static final String AB_TEST_CAL_KEY = "cal_ab_test"; //$NON-NLS-1$
private void initialize() {
addTest(AB_TEST_CAL_KEY, new int[] {1, 1}, new int[] {1, 1},
new String[] {"end-at-due-time", "start-at-due-time"}); //$NON-NLS-1$ //$NON-NLS-2$
}
}

@ -15,6 +15,8 @@ import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.User;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
public class AstridPreferences {
@ -57,6 +59,8 @@ public class AstridPreferences {
Preferences.setIfUnset(prefs, editor, r, R.string.p_third_party_addons, false);
Preferences.setIfUnset(prefs, editor, r, R.string.p_ideas_tab_enabled, true);
Preferences.setIfUnset(prefs, editor, r, R.string.p_end_at_deadline,
ABChooser.readChoiceForTest(ABTests.AB_TEST_CAL_KEY) != 0);
if ("white-blue".equals(Preferences.getStringValue(R.string.p_theme))) { //$NON-NLS-1$ migrate from when white-blue wasn't the default
Preferences.setString(R.string.p_theme, ThemeService.THEME_WHITE);

Loading…
Cancel
Save