Merge and resolve conflicts from upstream/master

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

@ -149,7 +149,10 @@
<string name="SyP_progress_toast">Synchronizing...</string>
<!-- Sync Label: used in menu to denote synchronization -->
<string name="SyP_label">Synchronization</string>
<string name="SyP_label">Sync &amp; Backup</string>
<!-- Sync label subtitle -->
<string name="SyP_summary">Astrid.com, Google Tasks, Saved Data &amp; Local Backup</string>
<!-- Error msg when io exception -->
<string name="SyP_ioerror">Connection Error! Check your Internet connection.</string>

@ -268,6 +268,8 @@
<activity android:name="com.todoroo.astrid.core.DefaultsPreferences"
android:theme="@android:style/Theme"
android:label="@string/EPr_defaults_header">
<meta-data android:name="summary"
android:resource="@string/EPr_defaults_summary" />
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
@ -276,24 +278,6 @@
<activity android:name="com.todoroo.astrid.activity.BeastModePreferences"
android:theme="@android:style/Theme">
</activity>
<activity android:name="com.todoroo.astrid.core.OldTaskPreferences"
android:theme="@android:style/Theme"
android:label="@string/EPr_manage_header">
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.todoroo.astrid.core.LabsPreferences"
android:theme="@android:style/Theme"
android:label="@string/EPr_labs_header">
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.todoroo.astrid.calls.MissedCallActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
@ -379,6 +363,8 @@
android:label="@string/actfm_APr_header">
<meta-data android:name="category"
android:resource="@string/SyP_label" />
<meta-data android:name="syncAction"
android:value="true" />
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
@ -459,6 +445,8 @@
android:label="@string/gtasks_GPr_header">
<meta-data android:name="category"
android:resource="@string/SyP_label" />
<meta-data android:name="syncAction"
android:value="true" />
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
@ -505,6 +493,18 @@
</intent-filter>
</receiver>
<!-- old tasks -->
<activity android:name="com.todoroo.astrid.core.OldTaskPreferences"
android:theme="@android:style/Theme"
android:label="@string/EPr_manage_header">
<meta-data android:name="category"
android:resource="@string/SyP_label" />
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- backup -->
<service android:name="com.todoroo.astrid.backup.BackupService"/>
<activity android:name="com.todoroo.astrid.backup.BackupActivity"
@ -512,6 +512,8 @@
<activity android:name="com.todoroo.astrid.backup.BackupPreferences"
android:theme="@android:style/Theme"
android:label="@string/backup_BPr_header">
<meta-data android:name="category"
android:resource="@string/SyP_label" />
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
@ -585,6 +587,8 @@
<activity android:name="com.todoroo.astrid.reminders.ReminderPreferences"
android:theme="@android:style/Theme"
android:label="@string/rmd_EPr_alerts_header">
<meta-data android:name="summary"
android:resource="@string/rmd_EPr_alerts_summary" />
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
@ -621,6 +625,8 @@
android:label="@string/producteev_PPr_header">
<meta-data android:name="category"
android:resource="@string/SyP_label" />
<meta-data android:name="syncAction"
android:value="true" />
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />

@ -30,7 +30,7 @@ import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.core.LabsPreferences;
import com.todoroo.astrid.activity.EditPreferences;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.reminders.NotificationFragment.SnoozeDialog;
import com.todoroo.astrid.reminders.Notifications;
@ -168,7 +168,7 @@ public class MissedCallActivity extends Activity {
ignoreSettingsButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent labsPreferences = new Intent(MissedCallActivity.this, LabsPreferences.class);
Intent labsPreferences = new Intent(MissedCallActivity.this, EditPreferences.class);
startActivity(labsPreferences);
finish();
}

@ -1,103 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import android.content.res.Resources;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.activity.EditPreferences;
import com.todoroo.astrid.utility.Constants;
public class LabsPreferences extends TodorooPreferenceActivity {
@Override
public int getPreferenceResource() {
return R.xml.preferences_labs;
}
public static final int RESULT_TLA_NEEDS_REFRESH = 3;
public static final int RESULT_NEEDS_SYNC = 4;
private class SetResultOnPreferenceChangeListener implements OnPreferenceChangeListener {
private final int resultCode;
public SetResultOnPreferenceChangeListener(int resultCode) {
this.resultCode = resultCode;
}
@Override
public boolean onPreferenceChange(Preference p, Object newValue) {
setResult(resultCode);
updatePreferences(p, newValue);
return true;
}
}
@Override
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EditPreferences.removeForbiddenPreferences(getPreferenceScreen(), getResources());
if (!AndroidUtilities.isTabletSized(this)) {
PreferenceScreen screen = getPreferenceScreen();
screen.removePreference(screen.findPreference(getString(R.string.p_force_phone_layout)));
}
}
@Override
public void updatePreferences(Preference preference, Object value) {
final Resources r = getResources();
String key = preference.getKey();
if (r.getString(R.string.p_swipe_lists_performance_key).equals(key)) {
preference.setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_TLA_NEEDS_REFRESH));
int index = 0;
if(value instanceof String && !TextUtils.isEmpty((String)value))
index = AndroidUtilities.indexOf(r.getStringArray(R.array.EPr_swipe_lists_performance_mode_values), (String)value);
if (index < 0)
index = 0;
String name = r.getStringArray(R.array.EPr_swipe_lists_performance_mode)[index];
String desc = r.getStringArray(R.array.EPr_swipe_lists_performance_desc)[index];
preference.setSummary(r.getString(R.string.EPr_swipe_lists_display, name, desc));
} else if (r.getString(R.string.p_field_missed_calls).equals(key)) {
setEnabledSummary(preference, value,
R.string.MCA_missed_calls_pref_desc_enabled, R.string.MCA_missed_calls_pref_desc_disabled);
} else if (r.getString(R.string.p_use_contact_picker).equals(key)) {
setEnabledSummary(preference, value,
R.string.EPr_use_contact_picker_desc_enabled, R.string.EPr_use_contact_picker_desc_disabled);
} 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();
screen.removePreference(preference);
}
} else if (r.getString(R.string.p_force_phone_layout).equals(key)) {
preference.setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_TLA_NEEDS_REFRESH));
} else if (r.getString(R.string.p_show_featured_lists_labs).equals(key)) {
preference.setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_NEEDS_SYNC));
}
}
private void setEnabledSummary(Preference preference, Object value, int enabledStr, int disabledStr) {
if (value != null && (Boolean) value) {
preference.setSummary(enabledStr);
} else {
preference.setSummary(disabledStr);
}
}
}

@ -8,7 +8,7 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/asAbBackgroundColor"
android:background="?attr/asQuickaddBackgroundColor"
android:orientation="vertical">
<View
android:layout_width="fill_parent"

@ -38,6 +38,7 @@
<attr name="asMainMenu" format="reference" />
<attr name="asPeopleMenu" format="reference" />
<attr name="asAbBackgroundColor" format="color"/>
<attr name="asQuickaddBackgroundColor" format="color" />
<attr name="asListPopoverBg" format="reference"/>
<attr name="asListArrowUp" format="reference"/>
<attr name="asFilterSelectedIcon" format="reference"/>

@ -67,6 +67,9 @@
<!-- show featured lists -->
<string name="p_show_featured_lists_labs">show_featured_lists_labs</string>
<!-- account status section key -->
<string name="p_account">account</string>
<string-array name="TEA_reminder_random_hours">
<!-- values (in hours) associated with items above. -->
<item>1</item>

@ -306,6 +306,11 @@
<string name="actfm_dual_sync_warning">You are currently synchronizing with Google Tasks.
Be advised that synchronizing with both services can in some cases lead to unexpected results.
Are you sure you want to sync with Astrid.com?</string>
<!-- account types -->
<string name="actfm_account_premium">Premium</string>
<string name="actfm_account_basic">Basic</string>
<string name="actfm_account_none">None</string>
</resources>

@ -138,7 +138,7 @@
<string name="TLA_menu_tutorial">Tutorial</string>
<!-- Menu: Settings -->
<string name="TLA_menu_settings">Settings</string>
<string name="TLA_menu_settings">Account &amp; Settings</string>
<!-- slide 30b: Menu: Support -->
<string name="TLA_menu_support">Support</string>
@ -574,6 +574,21 @@
<!-- slide 30i: Preference Category: Appearance Title -->
<string name="EPr_appearance_header">Appearance</string>
<!-- Preference Category: Appearance Summary -->
<string name="EPr_appearance_summary">Themes, Widgets, Task Rows, Edit Screen</string>
<!-- FAQ Preference title -->
<string name="EPr_faq_title">FAQ</string>
<!-- Account status preference (%s -> account type) -->
<string name="EPr_account_title">Account: %s</string>
<!-- Account status description -->
<string name="EPr_account_desc">Cloud sync status and options</string>
<!-- Support preferences summary -->
<string name="EPr_support_summary">Tutorial, FAQ, About Astrid</string>
<!-- slide 34a: Preference: Task List Font Size Title -->
<string name="EPr_fontSize_title">Task List Size</string>

@ -8,6 +8,7 @@
<!-- slide 32g: Preference Category: Defaults Title -->
<string name="EPr_defaults_header">New Task Defaults</string>
<string name="EPr_defaults_summary">Importance, Due Date, Add to Calendar</string>
<!-- slide 41f: Preference: Default Urgency Title -->
<string name="EPr_default_urgency_title">Default Urgency</string>

@ -9,7 +9,8 @@
<!-- ================================================== EditPreferences == -->
<!-- slide 32j: Preference Category: Power Pack -->
<string name="EPr_powerpack_header">Astrid Power Pack</string>
<string name="EPr_powerpack_header">Premium and Misc. Settings</string>
<string name="EPr_powerpack_summary">Missed call reminders, voice input and miscellaneous settings</string>
<!-- slide 32e: Preference: Anonymous User Statistics -->
<string name="EPr_statistics_title">Anonymous Usage Stats</string>

@ -105,6 +105,7 @@
<!-- slide 33d: Reminder Preference Screen Title -->
<string name="rmd_EPr_alerts_header">Reminder Settings</string>
<string name="rmd_EPr_alerts_summary">Quiet hours, snooze options, persistence level</string>
<!-- Reminder Preference: Reminders Enabled Title -->
<string name="rmd_EPr_enabled_title">Reminders Enabled?</string>

@ -36,6 +36,7 @@
<item name="asThemeTextColor">@color/blue_theme_color</item>
<item name="asListsDisclosure">@drawable/lists_disclosure_blue</item>
<item name="asAbBackgroundColor">#000000</item>
<item name="asQuickaddBackgroundColor">?attr/asAbBackgroundColor</item>
<item name="asTaskEditArrow">@drawable/taskedit_arrow_up_white</item>
<item name="asRepeatIcon">@drawable/icn_edit_repeats_blue</item>
<item name="asListPopoverBg">@drawable/list_popover_bg_white</item>
@ -53,6 +54,7 @@
<style name="Theme.Transparent" parent="Theme">
<item name="asContentBackground">#22000000</item>
<item name="abBackground">#aa000000</item>
<item name="asQuickaddBackgroundColor">#22000000</item>
<item name="asEditBackground">#33272327</item>
<item name="asEditRowBackground">@drawable/task_edit_background_transparent_black</item>
<item name="asMembersHeaderBackground">@android:color/transparent</item>
@ -117,6 +119,7 @@
<style name="Theme.TransparentWhite" parent="Theme.White">
<item name="asContentBackground">#22ffffff</item>
<item name="abBackground">#aaffffff</item>
<item name="asQuickaddBackgroundColor">#22ffffff</item>
<item name="asEditBackground">#33f7f3f7</item>
<item name="asEditRowBackground">@drawable/task_edit_background_transparent_white</item>
<item name="asMembersHeaderBackground">@android:color/transparent</item>

@ -8,13 +8,19 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/EPr_title">
<PreferenceScreen android:title="@string/p_about" android:key="@string/p_about" />
<PreferenceScreen android:title="@string/welcome_setting" android:key="@string/p_tutorial"/>
<PreferenceScreen android:title="@string/p_help" android:key="@string/p_help"/>
<PreferenceScreen android:title="@string/p_premium" android:key="@string/p_premium"/>
<PreferenceScreen android:title="@string/EPr_account_title"
android:key="@string/p_account"
android:summary="@string/EPr_account_desc"/>
<PreferenceCategory
android:title="@string/EPr_appearance_header">
<PreferenceScreen android:title="@string/p_help" android:summary="@string/EPr_support_summary">
<PreferenceScreen android:title="@string/p_about" android:key="@string/p_about" />
<PreferenceScreen android:title="@string/welcome_setting" android:key="@string/p_tutorial"/>
<PreferenceScreen android:title="@string/EPr_faq_title" android:key="@string/p_help"/>
</PreferenceScreen>
<PreferenceScreen
android:title="@string/EPr_appearance_header"
android:summary="@string/EPr_appearance_summary">
<PreferenceScreen android:title="@string/EPr_taskRowPrefs_title" android:key="@string/p_taskRowPrefs">
@ -49,7 +55,8 @@
</PreferenceScreen>
<PreferenceScreen android:title="" android:key="@string/p_beastMode"/>
<PreferenceScreen android:title="@string/EPr_beastMode_title"
android:key="@string/p_beastMode"/>
<com.todoroo.astrid.ui.MultilineListPreference
android:key="@string/p_theme"
@ -72,43 +79,39 @@
android:key="@string/p_autoIdea"
android:title="@string/EPr_ideaAuto_title"
android:defaultValue="true" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/EPr_powerpack_header">
<PreferenceScreen android:title="@string/p_files_dir" android:key="@string/p_files_dir" />
<CheckBoxPreference
android:title="@string/EPr_force_phone_layout"
android:key="@string/p_force_phone_layout"
android:defaultValue="false"/>
<PreferenceScreen
android:key="@string/p_voicePrefSection"
android:title="@string/EPr_voice_header">
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_voiceInputEnabled"
android:title="@string/EPr_voiceInputEnabled_title"
android:defaultValue="true" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_voiceInputCreatesTask"
android:title="@string/EPr_voiceInputCreatesTask_title"
android:dependency="@string/p_voiceInputEnabled"
android:defaultValue="false" />
<CheckBoxPreference
android:title="@string/EPr_show_featured_lists"
android:key="@string/p_show_featured_lists_labs"
android:defaultValue="false"/>
<CheckBoxPreference
android:key="@string/p_use_contact_picker"
android:title="@string/EPr_use_contact_picker"/>
<ListPreference
android:key="@string/p_swipe_lists_performance_key"
android:title="@string/EPr_swipe_lists_performance_title"
android:entries="@array/EPr_swipe_lists_performance_mode"
android:entryValues="@array/EPr_swipe_lists_performance_mode_values"
android:summary="@string/EPr_swipe_lists_performance_subtitle" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_voiceInputEnabled"
android:title="@string/EPr_voiceInputEnabled_title"
android:defaultValue="true" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_voiceRemindersEnabled"
android:title="@string/EPr_voiceRemindersEnabled_title"
android:defaultValue="false" />
</PreferenceScreen>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_statistics"
android:title="@string/EPr_statistics_title"
android:defaultValue="true" />
</PreferenceCategory>
android:key="@string/p_voiceInputCreatesTask"
android:title="@string/EPr_voiceInputCreatesTask_title"
android:dependency="@string/p_voiceInputEnabled"
android:defaultValue="false" />
</PreferenceScreen>
</PreferenceScreen>

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/EPr_labs_header"
android:summary="@string/EPr_labs_desc">
<ListPreference
android:key="@string/p_swipe_lists_performance_key"
android:title="@string/EPr_swipe_lists_performance_title"
android:entries="@array/EPr_swipe_lists_performance_mode"
android:entryValues="@array/EPr_swipe_lists_performance_mode_values"
android:summary="@string/EPr_swipe_lists_performance_subtitle" />
<CheckBoxPreference
android:key="@string/p_use_contact_picker"
android:title="@string/EPr_use_contact_picker"/>
<CheckBoxPreference
android:key="@string/p_field_missed_calls"
android:title="@string/MCA_missed_calls_pref_title"/>
<CheckBoxPreference
android:key="@string/p_third_party_addons"
android:title="@string/EPr_third_party_addons" />
<CheckBoxPreference
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" />
<CheckBoxPreference
android:title="@string/EPr_force_phone_layout"
android:key="@string/p_force_phone_layout"
android:defaultValue="false"/>
<CheckBoxPreference
android:title="@string/EPr_show_featured_lists"
android:key="@string/p_show_featured_lists_labs"
android:defaultValue="false"/>
</PreferenceScreen>

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/EPr_powerpack_header">
<PreferenceScreen
android:title="@string/EPr_powerpack_header"
android:summary="@string/EPr_powerpack_summary">
<PreferenceScreen android:title="@string/p_files_dir" android:key="@string/p_files_dir" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_voiceRemindersEnabled"
android:title="@string/EPr_voiceRemindersEnabled_title"
android:defaultValue="false" />
<CheckBoxPreference
android:key="@string/p_field_missed_calls"
android:title="@string/MCA_missed_calls_pref_title"/>
<CheckBoxPreference
android:key="@string/p_third_party_addons"
android:title="@string/EPr_third_party_addons" />
<CheckBoxPreference
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" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_statistics"
android:title="@string/EPr_statistics_title"
android:defaultValue="true" />
</PreferenceScreen>
</PreferenceScreen>

@ -29,11 +29,11 @@ import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.widget.Toast;
import com.crittercism.NewFeedbackSpringboardActivity;
import com.crittercism.app.Crittercism;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
@ -45,10 +45,9 @@ import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.andlib.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.actfm.ActFmPreferences;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.billing.BillingActivity;
import com.todoroo.astrid.core.LabsPreferences;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.files.FileExplore;
@ -60,7 +59,6 @@ import com.todoroo.astrid.producteev.ProducteevUtilities;
import com.todoroo.astrid.service.AddOnService;
import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.sync.SyncProviderPreferences;
@ -83,11 +81,9 @@ public class EditPreferences extends TodorooPreferenceActivity {
private static final String SUPPORT_URL = "http://blog.astrid.com/topics/support/android"; //$NON-NLS-1$
private static final int APPEARANCE_PREFERENCE = 4;
private static final int POWER_PACK_PREFERENCE = 5;
private static final int APPEARANCE_PREFERENCE = 2;
private static final int REQUEST_CODE_SYNC = 0;
private static final int REQUEST_CODE_LABS = 1;
private static final int REQUEST_CODE_FILES_DIR = 2;
public static final int RESULT_CODE_THEME_CHANGED = 1;
@ -97,6 +93,7 @@ public class EditPreferences extends TodorooPreferenceActivity {
@Autowired private TaskService taskService;
@Autowired private AddOnService addOnService;
@Autowired private ActFmPreferenceService actFmPreferenceService;
@Autowired
private Database database;
@ -107,6 +104,20 @@ public class EditPreferences extends TodorooPreferenceActivity {
DependencyInjectionService.getInstance().inject(this);
}
private class SetResultOnPreferenceChangeListener implements OnPreferenceChangeListener {
private final int resultCode;
public SetResultOnPreferenceChangeListener(int resultCode) {
this.resultCode = resultCode;
}
@Override
public boolean onPreferenceChange(Preference p, Object newValue) {
setResult(resultCode);
updatePreferences(p, newValue);
return true;
}
}
@Override
public int getPreferenceResource() {
return R.xml.preferences;
@ -123,7 +134,7 @@ public class EditPreferences extends TodorooPreferenceActivity {
addPluginPreferences(screen);
screen.getPreference(POWER_PACK_PREFERENCE).setEnabled(addOnService.hasPowerPack());
addPreferencesFromResource(R.xml.preferences_misc);
final Resources r = getResources();
@ -157,21 +168,17 @@ public class EditPreferences extends TodorooPreferenceActivity {
}
});
preference = screen.findPreference(getString(R.string.p_premium));
if (ActFmPreferenceService.isPremiumUser())
screen.removePreference(preference);
else
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference p) {
showPremium();
return true;
}
});
preference = screen.findPreference(getString(R.string.p_account));
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference p) {
showAccountPrefs();
return true;
}
});
PreferenceCategory appearance = (PreferenceCategory) screen.getPreference(APPEARANCE_PREFERENCE);
PreferenceScreen appearance = (PreferenceScreen) screen.getPreference(APPEARANCE_PREFERENCE);
Preference beastMode = appearance.getPreference(1);
beastMode.setTitle(r.getString(R.string.EPr_beastMode_title));
beastMode.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference p) {
@ -195,6 +202,12 @@ public class EditPreferences extends TodorooPreferenceActivity {
addPreferenceListeners();
disablePremiumPrefs();
if (!AndroidUtilities.isTabletSized(this)) {
screen.removePreference(screen.findPreference(getString(R.string.p_force_phone_layout)));
}
removeForbiddenPreferences(screen, r);
}
@ -227,6 +240,13 @@ public class EditPreferences extends TodorooPreferenceActivity {
return false;
}
private void disablePremiumPrefs() {
boolean hasPowerPack = addOnService.hasPowerPack();
findPreference(getString(R.string.p_files_dir)).setEnabled(ActFmPreferenceService.isPremiumUser());
findPreference(getString(R.string.p_voiceRemindersEnabled)).setEnabled(hasPowerPack);
findPreference(getString(R.string.p_statistics)).setEnabled(hasPowerPack);
}
/** Show about dialog */
private void showAbout () {
String version = "unknown"; //$NON-NLS-1$
@ -243,27 +263,22 @@ public class EditPreferences extends TodorooPreferenceActivity {
startActivity(intent);
}
private void showForums() {
StatisticsService.reportEvent(StatisticsConstants.TLA_MENU_HELP);
Intent intent = new Intent(this, NewFeedbackSpringboardActivity.class);
startActivity(intent);
}
private void showBeastMode() {
Intent intent = new Intent(this, BeastModePreferences.class);
intent.setAction(AstridApiConstants.ACTION_SETTINGS);
startActivity(intent);
}
private void showPremium() {
Intent intent = new Intent(this, BillingActivity.class);
startActivity(intent);
private void showAccountPrefs() {
Intent intent = new Intent(this, ActFmPreferences.class);
intent.setAction(AstridApiConstants.ACTION_SETTINGS);
startActivityForResult(intent, REQUEST_CODE_SYNC);
}
private static final HashMap<Class<?>, Integer> PREFERENCE_REQUEST_CODES = new HashMap<Class<?>, Integer>();
static {
PREFERENCE_REQUEST_CODES.put(SyncProviderPreferences.class, REQUEST_CODE_SYNC);
PREFERENCE_REQUEST_CODES.put(LabsPreferences.class, REQUEST_CODE_LABS);
// PREFERENCE_REQUEST_CODES.put(LabsPreferences.class, REQUEST_CODE_LABS);
}
private void addPluginPreferences(PreferenceScreen screen) {
@ -277,7 +292,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
// Loop through a list of all packages (including plugins, addons)
// that have a settings action
String labsTitle = getString(R.string.EPr_labs_header);
for(int i = 0; i < length; i++) {
ResolveInfo resolveInfo = resolveInfoList.get(i);
final Intent intent = new Intent(AstridApiConstants.ACTION_SETTINGS);
@ -298,8 +312,12 @@ public class EditPreferences extends TodorooPreferenceActivity {
Preference preference = new Preference(this);
preference.setTitle(resolveInfo.activityInfo.loadLabel(pm));
if (labsTitle.equals(preference.getTitle()))
preference.setSummary(R.string.EPr_labs_desc);
Bundle metadata = resolveInfo.activityInfo.metaData;
if (metadata != null) {
int resource = metadata.getInt("summary", 0); //$NON-NLS-1$
if (resource > 0)
preference.setSummary(resource);
}
try {
Class<?> intentComponent = Class.forName(intent.getComponent().getClassName());
if (intentComponent.getSuperclass().equals(SyncProviderPreferences.class))
@ -329,13 +347,22 @@ public class EditPreferences extends TodorooPreferenceActivity {
}
for(Entry<String, ArrayList<Preference>> entry : categoryPreferences.entrySet()) {
Preference header = new Preference(this);
header.setLayoutResource(android.R.layout.preference_category);
header.setTitle(entry.getKey());
screen.addPreference(header);
if (entry.getKey().equals(getString(R.string.app_name))) {
for(Preference preference : entry.getValue())
screen.addPreference(preference);
} else {
PreferenceManager manager = getPreferenceManager();
PreferenceScreen header = manager.createPreferenceScreen(this);
header.setTitle(entry.getKey());
if (entry.getKey().equals(getString(R.string.SyP_label)))
header.setSummary(R.string.SyP_summary);
screen.addPreference(header);
for(Preference preference : entry.getValue())
header.addPreference(preference);
}
for(Preference preference : entry.getValue())
screen.addPreference(preference);
}
}
@ -405,7 +432,17 @@ public class EditPreferences extends TodorooPreferenceActivity {
public void updatePreferences(final Preference preference, Object value) {
final Resources r = getResources();
if (r.getString(R.string.p_showNotes).equals(preference.getKey())) {
if (r.getString(R.string.p_account).equals(preference.getKey())) {
String accountType;
if (ActFmPreferenceService.isPremiumUser()) {
accountType = getString(R.string.actfm_account_premium);
} else if (actFmPreferenceService.isLoggedIn()) {
accountType = getString(R.string.actfm_account_premium);
} else {
accountType = getString(R.string.actfm_account_none);
}
preference.setTitle(getString(R.string.EPr_account_title, accountType));
} else if (r.getString(R.string.p_showNotes).equals(preference.getKey())) {
if (value != null && !(Boolean)value)
preference.setSummary(R.string.EPr_showNotes_desc_disabled);
else
@ -460,13 +497,33 @@ public class EditPreferences extends TodorooPreferenceActivity {
R.string.EPr_statistics_desc_disabled, R.string.EPr_statistics_desc_enabled));
else if (booleanPreference(preference, value, R.string.p_autoIdea,
R.string.EPr_ideaAuto_desc_disabled, R.string.EPr_ideaAuto_desc_enabled));
// voice input and output
if(!addOnService.hasPowerPack())
return;
if (r.getString(R.string.p_voiceInputEnabled).equals(preference.getKey())) {
else if (r.getString(R.string.p_swipe_lists_performance_key).equals(preference.getKey())) {
preference.setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED));
int index = 0;
if(value instanceof String && !TextUtils.isEmpty((String)value))
index = AndroidUtilities.indexOf(r.getStringArray(R.array.EPr_swipe_lists_performance_mode_values), (String)value);
if (index < 0)
index = 0;
String name = r.getStringArray(R.array.EPr_swipe_lists_performance_mode)[index];
String desc = r.getStringArray(R.array.EPr_swipe_lists_performance_desc)[index];
preference.setSummary(r.getString(R.string.EPr_swipe_lists_display, name, desc));
}
else if (booleanPreference(preference, value, R.string.p_field_missed_calls,
R.string.MCA_missed_calls_pref_desc_enabled, R.string.MCA_missed_calls_pref_desc_disabled));
else if (booleanPreference(preference, value, R.string.p_use_contact_picker,
R.string.EPr_use_contact_picker_desc_enabled, R.string.EPr_use_contact_picker_desc_disabled));
else if (booleanPreference(preference, value, R.string.p_third_party_addons,
R.string.EPr_third_party_addons_desc_enabled, R.string.EPr_third_party_addons_desc_disabled));
else if (booleanPreference(preference, value, R.string.p_end_at_deadline,
R.string.EPr_cal_start_at_due_time, R.string.EPr_cal_end_at_due_time));
else if (r.getString(R.string.p_force_phone_layout).equals(preference.getKey())) {
preference.setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED));
} else if (r.getString(R.string.p_show_featured_lists_labs).equals(preference.getKey())) {
preference.setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(SyncProviderPreferences.RESULT_CODE_SYNCHRONIZE));
}
else if (r.getString(R.string.p_voiceInputEnabled).equals(preference.getKey())) {
if (value != null && !(Boolean)value)
preference.setSummary(R.string.EPr_voiceInputEnabled_desc_disabled);
else
@ -504,13 +561,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
setResult(SyncProviderPreferences.RESULT_CODE_SYNCHRONIZE);
finish();
return;
} else if (requestCode == REQUEST_CODE_LABS && resultCode == LabsPreferences.RESULT_TLA_NEEDS_REFRESH) {
setResult(RESULT_CODE_PERFORMANCE_PREF_CHANGED);
return;
} else if (requestCode == REQUEST_CODE_LABS && resultCode == LabsPreferences.RESULT_NEEDS_SYNC) {
if (Preferences.getBoolean(R.string.p_show_featured_lists_labs, false))
setResult(SyncProviderPreferences.RESULT_CODE_SYNCHRONIZE);
return;
} else if (requestCode == REQUEST_CODE_FILES_DIR && resultCode == RESULT_OK) {
if (data != null) {
String dir = data.getStringExtra(FileExplore.RESULT_DIR_SELECTED);

@ -103,6 +103,7 @@ import com.todoroo.astrid.ui.WebServicesView;
import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.utility.Flags;
import com.todoroo.astrid.voice.VoiceInputAssistant;
import com.todoroo.astrid.voice.VoiceRecognizer;
import com.viewpagerindicator.TabPageIndicator;
/**
@ -670,18 +671,16 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
public void onUiThread() {
// prepare and set listener for voice-button
if (getActivity() != null) {
if (addOnService.hasPowerPack()) {
voiceAddNoteButton = (ImageButton) notesControlSet.getView().findViewById(
R.id.voiceAddNoteButton);
voiceAddNoteButton.setVisibility(View.VISIBLE);
int prompt = R.string.voice_edit_note_prompt;
voiceNoteAssistant = new VoiceInputAssistant(TaskEditFragment.this,
voiceAddNoteButton, notesEditText, REQUEST_VOICE_RECOG);
voiceNoteAssistant.setAppend(true);
voiceNoteAssistant.setLanguageModel(RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
voiceNoteAssistant.configureMicrophoneButton(prompt);
}
if (getActivity() != null && VoiceRecognizer.voiceInputAvailable(getActivity())) {
voiceAddNoteButton = (ImageButton) notesControlSet.getView().findViewById(
R.id.voiceAddNoteButton);
voiceAddNoteButton.setVisibility(View.VISIBLE);
int prompt = R.string.voice_edit_note_prompt;
voiceNoteAssistant = new VoiceInputAssistant(TaskEditFragment.this,
voiceAddNoteButton, notesEditText, REQUEST_VOICE_RECOG);
voiceNoteAssistant.setAppend(true);
voiceNoteAssistant.setLanguageModel(RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
voiceNoteAssistant.configureMicrophoneButton(prompt);
loadMoreContainer();
}

@ -39,6 +39,7 @@ import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.TagSettingsActivity;
import com.todoroo.astrid.actfm.TagUpdatesFragment;
import com.todoroo.astrid.actfm.TagViewFragment;
import com.todoroo.astrid.adapter.FilterAdapter;
import com.todoroo.astrid.adapter.TaskListFragmentPagerAdapter;
@ -451,6 +452,10 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
public void onTaskListItemClicked(long taskId) {
if (fragmentLayout != LAYOUT_SINGLE)
getIntent().putExtra(OPEN_TASK, taskId);
TagUpdatesFragment tuf = getTagUpdatesFragment();
if (tuf != null)
tuf.getView().setVisibility(View.INVISIBLE);
super.onTaskListItemClicked(taskId);
}
@ -534,6 +539,10 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
}
Flags.set(Flags.TLA_DISMISSED_FROM_TASK_EDIT);
onPostResume();
TagUpdatesFragment tuf = getTagUpdatesFragment();
if (tuf != null)
tuf.getView().setVisibility(View.VISIBLE);
}
super.onBackPressed();
}

@ -434,16 +434,16 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
tla.getMainMenuPopover().clear();
}
// --- sync
if (tla == null || tla.getTaskEditFragment() == null)
addSyncRefreshMenuItem(menu, isTablet ? ThemeService.FLAG_INVERT : 0);
// --- sort
if (allowResorting()) {
addMenuItem(menu, R.string.TLA_menu_sort,
ThemeService.getDrawable(R.drawable.icn_menu_sort_by_size, isTablet ? ThemeService.FLAG_FORCE_DARK: 0), MENU_SORT_ID, false);
}
// --- sync
if (tla == null || tla.getTaskEditFragment() == null)
addSyncRefreshMenuItem(menu, isTablet ? ThemeService.FLAG_INVERT : 0);
// --- new filter
addMenuItem(menu, R.string.FLA_new_filter,
ThemeService.getDrawable(R.drawable.icn_menu_filters, isTablet ? ThemeService.FLAG_FORCE_DARK: 0), MENU_NEW_FILTER_ID, false);

@ -216,6 +216,12 @@ public class SyncActionHelper {
&& !ProducteevUtilities.INSTANCE.isLoggedIn() && !Preferences.getBoolean(R.string.p_third_party_addons, false))
continue;
if (resolveInfo.activityInfo.metaData != null) {
Bundle metadata = resolveInfo.activityInfo.metaData;
if (!metadata.getBoolean("syncAction")) //$NON-NLS-1$
continue;
}
if (category.equals(desiredCategory)) {
syncIntents.add(new IntentWithLabel(intent,
resolveInfo.activityInfo.loadLabel(pm).toString()));

@ -171,7 +171,8 @@ public abstract class MarketStrategy {
R.string.p_voicePrefSection,
R.string.p_end_at_deadline,
R.string.p_swipe_lists_performance_key,
R.string.p_field_missed_calls
R.string.p_field_missed_calls,
R.string.p_ideas_tab_enabled
};
}

@ -107,6 +107,10 @@ public class MainMenuPopover extends FragmentPopover implements InterceptTouchLi
private void addFixedItems() {
int themeFlags = isTablet ? ThemeService.FLAG_FORCE_DARK : 0;
addMenuItem(R.string.TLA_menu_search,
ThemeService.getDrawable(R.drawable.icn_menu_search, themeFlags),
MAIN_MENU_ITEM_SEARCH, null, topFixed);
addMenuItem(R.string.TLA_menu_lists,
ThemeService.getDrawable(R.drawable.icn_menu_lists, themeFlags),
MAIN_MENU_ITEM_LISTS, null, topFixed); // Lists item
@ -121,9 +125,6 @@ public class MainMenuPopover extends FragmentPopover implements InterceptTouchLi
ThemeService.getDrawable(R.drawable.icn_featured_lists, themeFlags),
MAIN_MENU_ITEM_FEATURED_LISTS, null, topFixed);
addMenuItem(R.string.TLA_menu_search,
ThemeService.getDrawable(R.drawable.icn_menu_search, themeFlags),
MAIN_MENU_ITEM_SEARCH, null, topFixed);
addMenuItem(R.string.TLA_menu_settings,
ThemeService.getDrawable(R.drawable.icn_menu_settings, themeFlags),
MAIN_MENU_ITEM_SETTINGS, null, bottomFixed); // Settings item

@ -186,8 +186,7 @@ public class QuickAddBar extends LinearLayout implements RecognizerApiListener {
}
});
if (addOnService.hasPowerPack()
&& Preferences.getBoolean(R.string.p_voiceInputEnabled, true)
if (Preferences.getBoolean(R.string.p_voiceInputEnabled, true)
&& VoiceRecognizer.voiceInputAvailable(activity)) {
voiceAddButton.setVisibility(View.VISIBLE);
} else {

Loading…
Cancel
Save