Moved 'about' strings to strings-core

pull/14/head
Joshua Gross 14 years ago
parent d78fb39c0c
commit b449fc3ef1

@ -8,10 +8,10 @@ import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceGroup;
import android.preference.RingtonePreference;
import android.preference.Preference.OnPreferenceChangeListener;
import com.todoroo.andlib.service.DependencyInjectionService;

@ -424,6 +424,23 @@
<!-- Widget configuration activity title: select a filter -->
<string name="WCA_title">Select tasks to view...</string>
<!-- ============================================================= About == -->
<!-- Title of "About" option in settings -->
<string name="p_about">About Astrid</string>
<!-- About text -->
<string name="p_about_text">Astrid Tasks\n\n
Current version: %s\n\n
Astrid is open-source and proudly maintained by Todoroo, Inc.\n\n
Source: <a href="http://github.com/todoroo/astrid">http://github.com/todoroo/astrid</a>\n
Privacy Policy: http://www.todoroo.com/privacy\n
Terms of Use: http://www.todoroo.com/terms\n
Visit http://weloveastrid.com for more information, to add translations or help make Astrid better!</string>
<!-- ============================================================= Misc == -->

@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/EPr_title">
<PreferenceScreen android:title="" android:key="@string/p_about"></PreferenceScreen>
<PreferenceCategory
android:title="@string/EPr_appearance_header">
<ListPreference
@ -45,4 +46,5 @@
android:title="@string/EPr_statistics_title"
android:defaultValue="true" />
</PreferenceScreen>

@ -16,6 +16,7 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.net.Uri;
@ -56,7 +57,8 @@ import com.todoroo.astrid.voice.VoiceOutputService;
*/
public class EditPreferences extends TodorooPreferences {
private static final int POWER_PACK_PREFERENCE = 1;
private static final int ABOUT_PREFERENCE = 0; // see preferences.xml for order of prefs
private static final int POWER_PACK_PREFERENCE = 2;
// --- instance variables
@ -90,11 +92,30 @@ public class EditPreferences extends TodorooPreferences {
screen.getPreference(POWER_PACK_PREFERENCE).setEnabled(addOnService.hasPowerPack());
final Resources r = getResources();
// About pref
Preference preference = screen.getPreference(ABOUT_PREFERENCE);
preference.setTitle(r.getString(R.string.p_about));
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference p) {
showAbout();
return true;
}
});
addDebugPreferences();
addPreferenceListeners();
}
private void showAbout ()
{
try {
About.showAbout(this, getResources(), getPackageManager().getPackageInfo("com.timsu.astrid", 0).versionName);
} catch (NameNotFoundException e) {
}
}
private void addPluginPreferences(PreferenceScreen screen) {
Intent queryIntent = new Intent(AstridApiConstants.ACTION_SETTINGS);
PackageManager pm = getPackageManager();
@ -193,6 +214,8 @@ public class EditPreferences extends TodorooPreferences {
@Override
public void updatePreferences(final Preference preference, Object value) {
final Resources r = getResources();
if (r.getString(R.string.p_showNotes).equals(preference.getKey())) {
if (value != null && !(Boolean)value)
preference.setSummary(R.string.EPr_showNotes_desc_disabled);
@ -204,6 +227,7 @@ public class EditPreferences extends TodorooPreferences {
}
}
// statistics service
else if (r.getString(R.string.p_statistics).equals(preference.getKey())) {
if (value != null && !(Boolean)value)

Loading…
Cancel
Save