Remove edit toasts based on the results of the ab test

pull/14/head
Sam Bosley 13 years ago
parent ffc96fa63c
commit 73c5b65064

@ -43,7 +43,6 @@ import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.commonsware.cwac.merge.MergeAdapter;
import com.timsu.astrid.R;
@ -796,7 +795,6 @@ public class EditPeopleControlSet extends PopupControlSet {
activity.getString(R.string.actfm_EPA_login_to_share), R.string.actfm_EPA_login_button,
R.string.actfm_EPA_dont_share_button, android.R.drawable.ic_dialog_alert,
okListener, cancelListener);
showSaveToast(toast);
return false;
}
@ -811,8 +809,6 @@ public class EditPeopleControlSet extends PopupControlSet {
else if (task.getValue(Task.USER_ID) != Task.USER_ID_SELF)
StatisticsService.reportEvent(StatisticsConstants.TASK_ASSIGNED_PICKER);
showSaveToast(toast);
return true;
} catch (JSONException e) {
exceptionService.displayAndReportError(activity, "save-people", e);
@ -832,14 +828,6 @@ public class EditPeopleControlSet extends PopupControlSet {
assignToMe();
}
private void showSaveToast(String saveToast) {
if(saveToast == null || !Preferences.getBoolean(R.string.p_showEditToasts, false))
return;
int length = saveToast.contains("\n") ? //$NON-NLS-1$
Toast.LENGTH_LONG : Toast.LENGTH_SHORT;
Toast.makeText(activity, saveToast, length).show();
}
@SuppressWarnings("nls")
protected Object[] buildSharingArgs(JSONArray emails) throws JSONException {
ArrayList<Object> values = new ArrayList<Object>();

@ -70,9 +70,6 @@
<!-- account status section key -->
<string name="p_account">account</string>
<!-- show edit task confirmation toasts -->
<string name="p_showEditToasts">show_edit_toasts</string>
<string-array name="TEA_reminder_random_hours">
<!-- values (in hours) associated with items above. -->
<item>1</item>

@ -93,11 +93,6 @@
android:key="@string/p_show_featured_lists_labs"
android:defaultValue="false"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_showEditToasts"
android:title="@string/EPr_showEditToasts_title"
android:defaultValue="false" />
<CheckBoxPreference
android:key="@string/p_use_contact_picker"
android:title="@string/EPr_use_contact_picker"/>

@ -995,19 +995,9 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
}
removeExtrasFromIntent(getActivity().getIntent());
showCancelToast();
getActivity().onBackPressed();
}
/**
* Show toast for task edit canceling
*/
private void showCancelToast() {
if (Preferences.getBoolean(R.string.p_showEditToasts, false))
Toast.makeText(getActivity(), R.string.TEA_onTaskCancel,
Toast.LENGTH_SHORT).show();
}
protected void deleteButtonClick() {
new AlertDialog.Builder(getActivity()).setTitle(
R.string.DLG_confirm_title).setMessage(
@ -1018,7 +1008,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
taskService.delete(model);
TimerPlugin.updateTimer(getActivity(), model, false);
shouldSaveState = false;
showDeleteToast();
Activity a = getActivity();
if (a instanceof TaskEditActivity) {
@ -1034,15 +1023,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
}).setNegativeButton(android.R.string.cancel, null).show();
}
/**
* Show toast for task edit deleting
*/
private void showDeleteToast() {
if (Preferences.getBoolean(R.string.p_showEditToasts, false))
Toast.makeText(getActivity(), R.string.TEA_onTaskDelete,
Toast.LENGTH_SHORT).show();
}
private void startAttachFile() {
ArrayList<String> options = new ArrayList<String>();
options.add(getString(R.string.file_add_picture));

@ -119,8 +119,6 @@ public class ABTests {
bundles.put(testKey, bundle);
}
public static final String AB_TASK_EDIT_TOAST = "android_task_edit_toast"; //$NON-NLS-1$
public static final String AB_SWIPE_BETWEEN = "android_swipe_v3"; //$NON-NLS-1$
public static final String AB_SIMPLE_TASK_ROW = "android_simple_task_row"; //$NON-NLS-1$
@ -128,8 +126,6 @@ public class ABTests {
public static final String AB_ADVANCED_EDIT = "android_advanced_edit"; //$NON-NLS-1$
private void initialize() {
addTest(AB_TASK_EDIT_TOAST, new int[] { 1, 1 },
new int[] { 1, 1 }, new String[] { "dont-show-toasts", "show-toasts" }); //$NON-NLS-1$ //$NON-NLS-2$
addTest(AB_SIMPLE_TASK_ROW, new int[] { 1, 1 },
new int[] { 1, 0 }, new String[] { "original-row-style", "simple-row-style" });//$NON-NLS-1$ //$NON-NLS-2$

@ -72,9 +72,6 @@ public class AstridPreferences {
Preferences.setIfUnset(prefs, editor, r, R.string.p_ideas_tab_enabled, true);
Preferences.setIfUnset(prefs, editor, r, R.string.p_showEditToasts,
ABChooser.readChoiceForTest(ABTests.AB_TASK_EDIT_TOAST) != 0);
Preferences.setIfUnset(prefs, editor, r, R.string.p_taskRowStyle,
ABChooser.readChoiceForTest(ABTests.AB_SIMPLE_TASK_ROW) != 0);

Loading…
Cancel
Save