AB test calendar scheduling

pull/14/head
Jimmy Scott 12 years ago
parent e721e03bc3
commit 913702d5e9

@ -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.Cal_end_at_due_time, R.string.Cal_start_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 - estimatedTime);
values.put("dtend", dueDate);
}else{
values.put("dtstart", dueDate);
values.put("dtend", dueDate + estimatedTime);
}
// 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>

@ -656,6 +656,12 @@
<item>High Performance</item>
</string-array>
<string name = "Cal_end_or_start_at_due_time">Calendar Events</string>
<string name = "Cal_end_at_due_time">End Calendar Events at Due Time</string>
<string name = "Cal_start_at_due_time">Starts Calendar Events at Due Time</string>
<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/Cal_end_or_start_at_due_time"
android:key = "@string/p_end_at_deadline" />
</PreferenceScreen>

@ -114,7 +114,19 @@ 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 static final int[] calTestNewUserProbs = new int[] {1, 1};
private static final int[] calTestExistingUserProbs = new int[] {1, 1};
private static final String[] calTestDescriptions = new String[] {"Start at due time", "End at due time"}; //$NON-NLS-1$//$NON-NLS-2$
private void initialize() {
addTest(AB_TEST_CAL_KEY, calTestNewUserProbs, calTestExistingUserProbs, calTestDescriptions);
}
}

@ -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