Add preference for idea auto

pull/14/head
Tim Su 14 years ago
parent e661f4d574
commit c29c2cd103

@ -328,6 +328,9 @@
<!-- Anonymous usage statistics -->
<string name="p_statistics">statistics</string>
<!-- Ideas tab autoloading -->
<string name="p_autoIdea">ideaauto</string>
<!-- ================================================= NEW USER EXPERIENCE -->
<!-- Preference Keys (do not translate) -->

@ -490,6 +490,11 @@
<string name="EPr_fullTask_desc_enabled">Full task title will be shown</string>
<string name="EPr_fullTask_desc_disabled">First two lines of task title will be shown</string>
<!-- Preferences: Auto-load Ideas Tab -->
<string name="EPr_ideaAuto_title">Show full task title</string>
<string name="EPr_ideaAuto_desc_enabled">Full task title will be shown</string>
<string name="EPr_ideaAuto_desc_disabled">First two lines of task title will be shown</string>
<!-- Preference: Theme -->
<string name="EPr_theme_title">Color Theme</string>
<!-- Preference: Theme Description (%s => value) -->

@ -59,6 +59,7 @@
<PreferenceCategory
android:title="@string/EPr_powerpack_header">
<PreferenceScreen
android:title="@string/EPr_voice_header">
@ -66,11 +67,13 @@
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" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_voiceRemindersEnabled"
android:title="@string/EPr_voiceRemindersEnabled_title"
@ -82,6 +85,12 @@
android:key="@string/p_statistics"
android:title="@string/EPr_statistics_title"
android:defaultValue="true" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_ideaAuto"
android:title="@string/EPr_ideaAuto_title"
android:defaultValue="true" />
</PreferenceCategory>

@ -308,13 +308,15 @@ public class EditPreferences extends TodorooPreferenceActivity {
r.getStringArray(R.array.EPr_themes)[index]));
}
}
// statistics service
else if (r.getString(R.string.p_statistics).equals(preference.getKey())) {
if (value != null && !(Boolean)value)
preference.setSummary(R.string.EPr_statistics_desc_disabled);
else
preference.setSummary(R.string.EPr_statistics_desc_enabled);
}
// pp preferences
else if (booleanPreference(preference, value, R.string.p_statistics,
R.string.EPr_statistics_desc_disabled, R.string.EPr_statistics_desc_enabled))
;
else if (booleanPreference(preference, value, R.string.p_idea_autoload,
R.string.EPr_ideaAuto_desc_disabled, R.string.EPr_ideaAuto_desc_enabled))
;
// voice input and output
if(!addOnService.hasPowerPack())
@ -340,6 +342,18 @@ public class EditPreferences extends TodorooPreferenceActivity {
}
}
protected boolean booleanPreference(Preference preference, Object value,
int key, int disabledString, int enabledString) {
if(getString(key).equals(preference.getKey())) {
if (value != null && !(Boolean)value)
preference.setSummary(disabledString);
else
preference.setSummary(enabledString);
return true;
}
return false;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
try {

Loading…
Cancel
Save