From 6c97d5c501d2e331d91e35cdbd3eec9ec7157214 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 3 Oct 2013 23:33:33 -0500 Subject: [PATCH] Remove Astrid Locale plugin --- astrid/libs/locale_platform.jar | Bin 9415 -> 0 bytes astrid/src/main/AndroidManifest.xml | 15 - .../astrid/locale/LocaleEditAlerts.java | 341 ------------------ .../todoroo/astrid/locale/LocaleReceiver.java | 117 ------ .../todoroo/astrid/service/AddOnService.java | 32 +- .../astrid/service/MarketStrategy.java | 17 - astrid/src/main/res/drawable/icon_32.png | Bin 1720 -> 0 bytes astrid/src/main/res/drawable/icon_locale.png | Bin 3306 -> 0 bytes .../src/main/res/drawable/locale_border.9.png | Bin 1399 -> 0 bytes .../main/res/layout/locale_edit_alerts.xml | 63 ---- astrid/src/main/res/values/strings-core.xml | 3 - astrid/src/main/res/values/strings-locale.xml | 29 +- astrid/src/main/res/values/styles-locale.xml | 31 -- 13 files changed, 2 insertions(+), 646 deletions(-) delete mode 100644 astrid/libs/locale_platform.jar delete mode 100644 astrid/src/main/java/com/todoroo/astrid/locale/LocaleEditAlerts.java delete mode 100644 astrid/src/main/java/com/todoroo/astrid/locale/LocaleReceiver.java delete mode 100644 astrid/src/main/res/drawable/icon_32.png delete mode 100644 astrid/src/main/res/drawable/icon_locale.png delete mode 100644 astrid/src/main/res/drawable/locale_border.9.png delete mode 100644 astrid/src/main/res/layout/locale_edit_alerts.xml delete mode 100644 astrid/src/main/res/values/styles-locale.xml diff --git a/astrid/libs/locale_platform.jar b/astrid/libs/locale_platform.jar deleted file mode 100644 index cd7183aa04cd194d58b37a79d935ec813dca48af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9415 zcmbuF1x#FvwuaF{k>c*IgS(dEG87nGJ6LgdD^R>hafjkg(Sa69fx+F~-QD%I_uk~3 zdvfl3H+gHali8W%-;=#}{`D^2##oKnZ1e z8EKF@8&Kw{4+iEOIMA=82w)pUR|GH*4Gh<+aZGTp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{aT`o+Qr zPyI>KX8IWGbYE{rN%96>t&P(q>M>2D9xW--GsNY$d!N6K(P7-`-wEGYVN8*eb|UGP zZREF;X%S?~mtm{T3g`2LmYy{xgR;3TP?$UymKFDg>+U3pwrkwm&0ewK?Ai-{0$UW*c1#9Ipky(hM|wN)=B&C%pdhQtM>Vg-+KIPkFV8FQjZV z)SA$Fy1ms^Z56lpF1jqcvn$euOTkP5Zsyy z`7_MIi_kHj@Bn5Q@YjeOdGrp~Pctmq{Hg;6RdBzC)t;p7m=VOb{>&Wt9-BI>!W4ur z``q!9P>y#^MC~CoYa)Ey0rS}mxyw{^qem7M16jgAqwZWOKj|u-O_UGRC?-9cvQTXfD{LNqd z%fR8UdVlVd{jNLz2&7*V&cD(7`~Lc0W&d30{=2Lq=6@smua?_iW&d0c{k!Zc?tdfu subTO - - - - - - - - - - - - diff --git a/astrid/src/main/java/com/todoroo/astrid/locale/LocaleEditAlerts.java b/astrid/src/main/java/com/todoroo/astrid/locale/LocaleEditAlerts.java deleted file mode 100644 index 7a37fbbf7..000000000 --- a/astrid/src/main/java/com/todoroo/astrid/locale/LocaleEditAlerts.java +++ /dev/null @@ -1,341 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.astrid.locale; - -import android.app.Activity; -import android.app.AlertDialog; -import android.app.ListActivity; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.os.Bundle; -import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.widget.ListView; -import android.widget.Spinner; - -import org.tasks.R; -import com.todoroo.andlib.service.ContextManager; -import com.todoroo.andlib.utility.AndroidUtilities; -import com.todoroo.astrid.activity.AddOnActivity; -import com.todoroo.astrid.adapter.FilterAdapter; -import com.todoroo.astrid.api.Filter; -import com.todoroo.astrid.api.FilterCategory; -import com.todoroo.astrid.api.FilterListItem; -import com.todoroo.astrid.core.PluginServices; -import com.todoroo.astrid.service.StatisticsConstants; -import com.twofortyfouram.SharedResources; - -/** - * Activity to edit alerts from Locale - * - * @author Tim Su - * - */ -public final class LocaleEditAlerts extends ListActivity { - - // --- locale constants - - /** key name for filter title in bundle */ - public static final String KEY_FILTER_TITLE = "title"; - - /** key name for filter SQL in bundle */ - public static final String KEY_SQL = "sql"; - - /** key name for filter content-values in bundle */ - public static final String KEY_VALUES = "val"; - - /** key name for interval (integer, # of seconds) */ - public static final String KEY_INTERVAL = "interval"; - - // --- activity constants - - /** - * Indices for interval setting - */ - public static final int INTERVAL_ONE_HOUR = 0; - public static final int INTERVAL_SIX_HOURS = 1; - public static final int INTERVAL_TWELVE_HOURS = 2; - public static final int INTERVAL_ONE_DAY = 3; - public static final int INTERVAL_THREE_DAYS = 4; - public static final int INTERVAL_ONE_WEEK = 5; - - /** - * Intervals in seconds - */ - public static final int[] INTERVALS = new int[] { - 3600, 6 * 3600, 12 * 3600, 24 * 3600, 3 * 24 * 3600, 7 * 24 * 3600 - }; - - /** - * Menu ID of the save item. - */ - private static final int MENU_SAVE = 1; - - /** - * Menu ID of the don't save item. - */ - private static final int MENU_DONT_SAVE = 2; - - // --- implementation - - FilterAdapter adapter = null; - Spinner interval = null; - - /** - * Flag boolean that can only be set to true via the "Don't Save" menu item in {@link #onMenuItemSelected(int, MenuItem)}. If - * true, then this {@code Activity} should return {@link Activity#RESULT_CANCELED} in {@link #finish()}. - *

- * There is no need to save/restore this field's state when the {@code Activity} is paused. - */ - private boolean isCancelled = false; - private boolean isRemoved = false; - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - setTheme(R.style.Theme); - super.onCreate(savedInstanceState); - setContentView(R.layout.locale_edit_alerts); - - ContextManager.setContext(this); - - /* - * Locale guarantees that the breadcrumb string will be present, but checking for null anyway makes your Activity more - * robust and re-usable - */ - final String breadcrumbString = getIntent().getStringExtra(com.twofortyfouram.Intent.EXTRA_STRING_BREADCRUMB); - if (breadcrumbString != null) { - setTitle(String.format("%s%s%s", breadcrumbString, com.twofortyfouram.Intent.BREADCRUMB_SEPARATOR, //$NON-NLS-1$ - getString(R.string.locale_edit_alerts_title))); - } - - /* - * Load the Locale background frame from Locale - */ -// ((LinearLayout) findViewById(R.id.frame)).setBackgroundDrawable( -// SharedResources.getDrawableResource(getPackageManager(), -// SharedResources.DRAWABLE_LOCALE_BORDER)); - - // set up UI components - interval = (Spinner) findViewById(R.id.intervalSpinner); - interval.setSelection(INTERVAL_ONE_DAY); - String selectionToMatch = null; - - try { - /* - * if savedInstanceState == null, then we are entering the Activity directly from Locale and we need to check whether the - * Intent has forwarded a Bundle extra (e.g. whether we editing an old setting or creating a new one) - */ - if (savedInstanceState == null) - { - final Bundle forwardedBundle = getIntent().getBundleExtra(com.twofortyfouram.Intent.EXTRA_BUNDLE); - - /* - * the forwardedBundle would be null if this was a new setting - */ - if (forwardedBundle != null) - { - final int intervalValue = forwardedBundle.getInt(KEY_INTERVAL, INTERVALS[interval.getSelectedItemPosition()]); - for(int i = 0; i < INTERVALS.length; i++) { - if(intervalValue == INTERVALS[i]) { - interval.setSelection(i); - break; - } - } - selectionToMatch = forwardedBundle.getString(KEY_SQL); - } - } - } catch (Exception e) { - selectionToMatch = null; - Log.e("astrid-locale", "Error loading bundle", e); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // if we match a selection, make it selected - final String finalSelection = selectionToMatch; - adapter = new FilterAdapter(this, getListView(), R.layout.filter_adapter_row, true) { - @Override - public void onReceiveFilter(FilterListItem item) { - if(adapter.getSelection() != null || finalSelection == null) { - return; - } - if(item instanceof Filter) { - if(finalSelection.equals(((Filter)item).getSqlQuery())) { - adapter.setSelection(item); - } - } else if(item instanceof FilterCategory) { - Filter[] filters = ((FilterCategory)item).children; - if(filters == null) { - return; - } - for(Filter filter : filters) { - if (finalSelection.equals(filter.getSqlQuery())) { - adapter.setSelection(filter); - break; - } - } - } - } - }; - adapter.filterStyle = R.style.TextAppearance_LEA_Filter; - adapter.headerStyle = R.style.TextAppearance_LEA_Header; - setListAdapter(adapter); - - // check for plugin - if(!PluginServices.getAddOnService().hasLocalePlugin()) { - isRemoved = true; - new AlertDialog.Builder(this) - .setTitle(R.string.DLG_information_title) - .setMessage(R.string.locale_plugin_required) - .setCancelable(false) - .setPositiveButton(android.R.string.ok, - AddOnActivity.createAddOnClicker(LocaleEditAlerts.this, true)) - .show(); - } - } - - @Override - public void onListItemClick(ListView parent, View v, int position, long id) { - Filter item = adapter.getItem(position); - adapter.setSelection(item); - } - - /** - * Called when the {@code Activity} is being terminated. This method determines the state of the {@code Activity} and what - * sort of result should be returned to Locale. - */ - @Override - public void finish() - { - if(isRemoved) { - setResult(com.twofortyfouram.Intent.RESULT_REMOVE); - } else if (isCancelled) { - setResult(RESULT_CANCELED); - } else - { - final FilterListItem selected = adapter.getSelection(); - final int intervalIndex = interval.getSelectedItemPosition(); - - if (selected == null) - { - /* - * If nothing is selected, return as if user had canceled - */ - setResult(RESULT_CANCELED); - } - else - { - /* - * This is the return Intent, into which we'll put all the required extras - */ - final Intent returnIntent = new Intent(); - - /* - * This extra is the data to ourselves: either for the Activity or the BroadcastReceiver. Note that anything - * placed in this bundle must be available to Locale's class loader. So storing String, int, and other basic - * objects will work just fine. You cannot store an object that only exists in your project, as Locale will be - * unable to serialize it. - */ - final Bundle storeAndForwardExtras = new Bundle(); - - Filter filterItem = (Filter) selected; - storeAndForwardExtras.putString(KEY_FILTER_TITLE, filterItem.title); - storeAndForwardExtras.putString(KEY_SQL, filterItem.getSqlQuery()); - if(filterItem.valuesForNewTasks != null) { - storeAndForwardExtras.putString(KEY_VALUES, AndroidUtilities.contentValuesToSerializedString(filterItem.valuesForNewTasks)); - } - storeAndForwardExtras.putInt(KEY_INTERVAL, INTERVALS[intervalIndex]); - - returnIntent.putExtra(com.twofortyfouram.Intent.EXTRA_BUNDLE, storeAndForwardExtras); - - /* - * This is the blurb concisely describing what your setting's state is. This is simply used for display in the UI. - */ - if (filterItem.title != null && filterItem.title.length() > com.twofortyfouram.Intent.MAXIMUM_BLURB_LENGTH) { - returnIntent.putExtra(com.twofortyfouram.Intent.EXTRA_STRING_BLURB, filterItem.title.substring(0, com.twofortyfouram.Intent.MAXIMUM_BLURB_LENGTH)); - } else { - returnIntent.putExtra(com.twofortyfouram.Intent.EXTRA_STRING_BLURB, filterItem.title); - } - - setResult(RESULT_OK, returnIntent); - } - } - - super.finish(); - } - - // --- boring stuff - - @Override - protected void onResume() { - super.onResume(); - adapter.registerRecevier(); - } - - @Override - protected void onPause() { - super.onPause(); - adapter.unregisterRecevier(); - } - - @Override - protected void onStart() { - super.onStart(); - } - - @Override - protected void onStop() { - super.onStop(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean onCreateOptionsMenu(final Menu menu) - { - super.onCreateOptionsMenu(menu); - - final PackageManager manager = getPackageManager(); - - /* - * We are dynamically loading resources from Locale's APK. This will only work if Locale is actually installed - */ - menu.add(0, MENU_DONT_SAVE, 0, SharedResources.getTextResource(manager, SharedResources.STRING_MENU_DONTSAVE)) - .setIcon(SharedResources.getDrawableResource(manager, SharedResources.DRAWABLE_MENU_DONTSAVE)).getItemId(); - - menu.add(0, MENU_SAVE, 0, SharedResources.getTextResource(manager, SharedResources.STRING_MENU_SAVE)) - .setIcon(SharedResources.getDrawableResource(manager, SharedResources.DRAWABLE_MENU_SAVE)).getItemId(); - - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean onMenuItemSelected(final int featureId, final MenuItem item) - { - switch (item.getItemId()) - { - case MENU_SAVE: - { - finish(); - return true; - } - case MENU_DONT_SAVE: - { - isCancelled = true; - finish(); - return true; - } - } - - return super.onOptionsItemSelected(item); - } - -} diff --git a/astrid/src/main/java/com/todoroo/astrid/locale/LocaleReceiver.java b/astrid/src/main/java/com/todoroo/astrid/locale/LocaleReceiver.java deleted file mode 100644 index 1c8d270f7..000000000 --- a/astrid/src/main/java/com/todoroo/astrid/locale/LocaleReceiver.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.astrid.locale; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.res.Resources; -import android.os.Bundle; -import android.text.TextUtils; -import android.util.Log; - -import org.tasks.R; -import com.todoroo.andlib.data.TodorooCursor; -import com.todoroo.andlib.service.ContextManager; -import com.todoroo.andlib.service.DependencyInjectionService; -import com.todoroo.andlib.utility.AndroidUtilities; -import com.todoroo.andlib.utility.DateUtilities; -import com.todoroo.andlib.utility.Preferences; -import com.todoroo.astrid.activity.ShortcutActivity; -import com.todoroo.astrid.api.Filter; -import com.todoroo.astrid.core.PluginServices; -import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.reminders.Notifications; -import com.todoroo.astrid.utility.Constants; - -/** - * Receiver is activated when Locale conditions are triggered - * - * @author timsu - * - */ -public class LocaleReceiver extends BroadcastReceiver { - - /** - * Create a preference key for storing / retrieving last interval time - * @param filterTitle - * @param interval - * @return - */ - private String makePreferenceKey(String filterTitle, int interval) { - return "LOCALE:" + filterTitle + interval; //$NON-NLS-1$ - } - - @Override - /** Called when the system is started up */ - public void onReceive(Context context, Intent intent) { - ContextManager.setContext(context); - - try { - if (com.twofortyfouram.Intent.ACTION_FIRE_SETTING.equals(intent.getAction())) { - if(!PluginServices.getAddOnService().hasLocalePlugin()) { - return; - } - - final Bundle forwardedBundle = intent.getBundleExtra(com.twofortyfouram.Intent.EXTRA_BUNDLE); - - final String title = forwardedBundle.getString(LocaleEditAlerts.KEY_FILTER_TITLE); - final String sql = forwardedBundle.getString(LocaleEditAlerts.KEY_SQL); - final String values = forwardedBundle.getString(LocaleEditAlerts.KEY_VALUES); - final int interval = forwardedBundle.getInt(LocaleEditAlerts.KEY_INTERVAL, 24*3600); - - if(TextUtils.isEmpty(title) || TextUtils.isEmpty(sql) || - sql.contains("--") || sql.contains(";") || interval == 0) { - return; - } - - // check if we've already made a notification recently - String preferenceKey = makePreferenceKey(title, interval); - long lastNotifyTime = Preferences.getLong(preferenceKey, 0); - if(DateUtilities.now() - lastNotifyTime < interval * 1000L) { - Log.i("astrid-locale-rx", title + ": Too soon, need " + (interval - - (DateUtilities.now() - lastNotifyTime)/1000) + " more seconds"); - return; - } - - // find out if we have active tasks with this tag - DependencyInjectionService.getInstance().inject(this); - Filter filter = new Filter(title, title, sql, null); - TodorooCursor cursor = PluginServices.getTaskService().fetchFiltered( - sql, null, Task.ID); - try { - if(cursor.getCount() == 0) { - return; - } - - if(values != null) { - filter.valuesForNewTasks = AndroidUtilities.contentValuesFromSerializedString(values); - } - - Resources r = context.getResources(); - String reminder = r.getString(R.string.locale_notification). - replace("$NUM", r.getQuantityString(R.plurals.Ntasks, - cursor.getCount(), cursor.getCount())). - replace("$FILTER", title); - - // show a reminder - String notificationTitle = r.getString(R.string.locale_edit_alerts_title); - Intent notifyIntent = ShortcutActivity.createIntent(filter); - notifyIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - Notifications.showNotification(Constants.NOTIFICATION_LOCALE, - notifyIntent, 0, notificationTitle, reminder, 1); - - Preferences.setLong(preferenceKey, DateUtilities.now()); - } finally { - cursor.close(); - } - } - } catch (Exception e) { - Log.i("astrid-locale-rx", "Error receiving intent", e); - } - } - -} diff --git a/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java b/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java index ca089e4ac..af0056ceb 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/AddOnService.java @@ -5,13 +5,8 @@ */ package com.todoroo.astrid.service; -import java.util.ArrayList; - import android.content.Context; -import android.content.res.Resources; -import android.graphics.drawable.BitmapDrawable; -import org.tasks.R; import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.Preferences; @@ -32,24 +27,11 @@ public class AddOnService { /** Astrid Power Pack package */ public static final String POWER_PACK_PACKAGE = "com.todoroo.astrid.ppack"; - /** Astrid Locale package */ - public static final String LOCALE_PACKAGE = "com.todoroo.astrid.locale"; - /** Checks whether power pack should be enabled */ public boolean hasPowerPack() { return true; } - /** Checks whether locale plugin should be enabled */ - public boolean hasLocalePlugin() { - if (Preferences.getBoolean(PREF_OEM, false)) { - return true; - } else if(isInstalled(LOCALE_PACKAGE, true)) { - return true; - } - return false; - } - /** * Record that a version was an OEM install */ @@ -132,19 +114,7 @@ public class AddOnService { * @return available add-ons */ public AddOn[] getAddOns() { - Resources r = ContextManager.getContext().getResources(); - - // temporary temporary - ArrayList list = new ArrayList(3); - - if(Constants.MARKET_STRATEGY.includesLocalePlugin()) { - list.add(new AddOn(false, true, r.getString(R.string.AOA_locale_title), null, - r.getString(R.string.AOA_locale_description), - LOCALE_PACKAGE, - ((BitmapDrawable) r.getDrawable(R.drawable.icon_locale)).getBitmap())); - } - - return list.toArray(new AddOn[list.size()]); + return new AddOn[0]; } } diff --git a/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java b/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java index e72c1ba84..1d5f3104e 100644 --- a/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java +++ b/astrid/src/main/java/com/todoroo/astrid/service/MarketStrategy.java @@ -20,13 +20,6 @@ public abstract class MarketStrategy { abstract public String strategyId(); - /** - * @return if this market has locale plugin - */ - public boolean includesLocalePlugin() { - return true; - } - public int[] excludedSettings() { return null; } @@ -98,11 +91,6 @@ public abstract class MarketStrategy { packageName)); } - @Override - public boolean includesLocalePlugin() { - return false; - } - /** * @return true if the device is a kindle fire and needs special treatment */ @@ -136,11 +124,6 @@ public abstract class MarketStrategy { packageName)); } - @Override - public boolean includesLocalePlugin() { - return false; - } - @Override public boolean allowIdeasTab() { return false; diff --git a/astrid/src/main/res/drawable/icon_32.png b/astrid/src/main/res/drawable/icon_32.png deleted file mode 100644 index 8da7133d7a04e02a3d274ba7d7a83c55a72ecf52..0000000000000000000000000000000000000000 GIT binary patch literal 0 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y>+#tyJxez#kH&`W-AyLHG%os+-Ml$dt-yXq4_kF7M2#BCT1)T}p z`9Sqf^7`xE&^hmipcQLPqQucgB))nyj@tKCy*IcPUqkz%cCa=Tb9EpQ#(GV{g}|2< zy4{w{e`qYRNu(^Gj{~*SEzt?7EyT6i>w0HgoF9R=tNp#uYlQknZ%#AoMU(YXCeI|Ah5G&}#O&4rs?T*8s%X`1`SdBN%S zL!nlF+HGLe=M( diff --git a/astrid/src/main/res/drawable/icon_locale.png b/astrid/src/main/res/drawable/icon_locale.png deleted file mode 100644 index 1d120188e212b75e1ad9f687c11752a507e54895..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3306 zcmVEWy9*ZeEu-It&i@Vt!SpPS3yZ^!@(l z`_8%NbPFjZ|H>$wC8XE>|IyOIfddEFzJ2>?2b;8Qx=5KbAQT!BsIMQ0u6GB7^!cjo zyu5AYy8dA;)P+?Q!P)2Ln{Os3CkLdIUVG`Km-sf^plJ`SA2jG_eDrAPOqn9(j2T{Y zo_ta!#*C344<20o@4?`I@*PoLUhc)Mr3IhQ$LaD=LBUh=F1u{1&@|Y+8%z_t{|8~3 zgk1gV?ChdHUw{1zPkj1m&smj~k8+k#6s2=>;G$q~;EM$XQ$<-BY~2dIdcot5!|d5G zXAX=X4}JT>jvcr)$@JXZUtSrB-1fbh#G~@^9t$5i0*M4HSOAL_!QFSmz=6oCuZBDC zgx6n(B})KM4;|u>yu8VP_D?sUK;Xx!dL8jNOqvA4h9QC0(o$OAc!Pu+czpG09Ls_m zZh+tX29imxhXEnDjPC&LG-^#`Wo2~%C{We&yBbDeA`~L@zykm@PoGZYt+%{6gb-M| zPVDyE$(}U};btb`8qG>1D9O(se8e=5@GWp0N5*2YhBGp7*Ijo#I&tE}sVU3CsHo7) zhaOU6J$ev6=Nwvg?nIe66D^s7RxtG z6S{OE+RhU=(|ykbQuXyz`u%duq)C4;ggAnf%4uc*H+X+jQ`5#XDk0mpV~vfCGt)wu z-(S$DrDb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MJ|`ab=@V0F@|h5%k1ndH*enLz<~ou z;^fJb%+1YVt+l|(7x?(S|9i9{aY;lqaSNkUA^R# zTDx{FEiEmaIB|l}(NSF2#ahe6!~~H@gkUg8E|&waz&AimDIjftab1@qM~)B*g-EB< z06cyAl-}N6YHMrDULRi6)YNe3&>^O#rZC1ZHa5nF4I3C79Q0PqS;&~8AYTJEkx1b8 z`-w)QSZm2-GPJd|EgQh=(b3Vt?CdPoT5jLIO?7oO@p#;;mrqLpNm^?;d-g1Q_wL1U z9J1Lg`}gmEYY<)>K72S|JK=DcOP4O;x~>I&ECs|^YYBxyM59rRF+6zi;H^V=X*NDS zj(CMW&$oB2qF~;!f)vLTG!2AtF691H1#uygv<)Kz8)~#EYuaiO`H7X*Hb|v-l zkzQ*_6_ zY^trTEjp&?iny*TNosCxUb>@ysg{-&Nz(lMd_kx;g4Ea7Yi4FffcpCS%I~m59XxnY zfTpLX6$k{p%g$fN6aty|`Fz^8ZJX}jzn`D1uC8wR+!oN9HEYz<(<4c`ckiA$J3GBw zzyEDufiB8~wbov^aDm;scazO#aU6&K{{FY#co-ZU#Bm%lnG8F3?&R|2%ZqBzePOM& zV`F2~)zxw9)-4>zA(2S1XV0Fu2GQHw%goFSj^i*qJWNwl6R}tfYpn}>QVPg6;FU4P z4h#&?-rmmW=qLblb940d^({L@e}BK%edqDx#{`2xPMtdCwSs;Hf~9~6_|95uQ>hez zK!9Dlc9BY@^2Z8Ko;>07>C<#|b^i0zCl0K6(S?r - - - - - - - - - - - - - - - - - - - - - diff --git a/astrid/src/main/res/values/strings-core.xml b/astrid/src/main/res/values/strings-core.xml index 5394d3dab..85b5dd15b 100644 --- a/astrid/src/main/res/values/strings-core.xml +++ b/astrid/src/main/res/values/strings-core.xml @@ -663,9 +663,6 @@ Empty List! - Tasks Locale Plugin - Allows Tasks to make use of the Locale application to send you notifications based on filter conditions. Requires Locale. - diff --git a/astrid/src/main/res/values/strings-locale.xml b/astrid/src/main/res/values/strings-locale.xml index b9d1d2630..bc1b988a0 100644 --- a/astrid/src/main/res/values/strings-locale.xml +++ b/astrid/src/main/res/values/strings-locale.xml @@ -1,34 +1,7 @@ - - - - Tasks Filter Alert - - - Tasks will send you a reminder - when you have any tasks in the following filter: - - - - - Limit notifications to: - - - - once an hour - once every six hours - once every twelve hours - once a day - once every three days - once a week - - - + You have $NUM matching: $FILTER - - Please install the Tasks Locale plugin! - diff --git a/astrid/src/main/res/values/styles-locale.xml b/astrid/src/main/res/values/styles-locale.xml deleted file mode 100644 index 6a71b49f3..000000000 --- a/astrid/src/main/res/values/styles-locale.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - -