From 47d0222d2ebc90befc211f17ddc617d6ac4e5c19 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Tue, 27 Jul 2010 17:07:51 -0700 Subject: [PATCH] spaces for tabs --- .../astrid/locale/LocaleEditAlerts.java | 14 +-- .../todoroo/astrid/locale/LocaleReceiver.java | 86 +++++++++---------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java index d8db18120..951b87686 100644 --- a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java +++ b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleEditAlerts.java @@ -86,13 +86,13 @@ public final class LocaleEditAlerts extends ExpandableListActivity { */ private boolean isCancelled = false; - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.locale_edit_alerts); + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.locale_edit_alerts); - /* + /* * Locale guarantees that the breadcrumb string will be present, but checking for null anyway makes your Activity more * robust and re-usable */ @@ -166,7 +166,7 @@ public final class LocaleEditAlerts extends ExpandableListActivity { adapter.headerStyle = R.style.TextAppearance_LEA_Header; adapter.categoryStyle = R.style.TextAppearance_LEA_Category; setListAdapter(adapter); - } + } @Override public boolean onChildClick(ExpandableListView parent, View v, diff --git a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java index ff9b4398c..253fa19a3 100644 --- a/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java +++ b/astrid/plugin-src/com/todoroo/astrid/locale/LocaleReceiver.java @@ -45,54 +45,54 @@ public class LocaleReceiver extends BroadcastReceiver { @Override /** Called when the system is started up */ public void onReceive(Context context, Intent intent) { - try { - if (com.twofortyfouram.Intent.ACTION_FIRE_SETTING.equals(intent.getAction())) { - final String title = intent.getStringExtra(LocaleEditAlerts.KEY_FILTER_TITLE); - final String sql = intent.getStringExtra(LocaleEditAlerts.KEY_SQL); - final int interval = intent.getIntExtra(LocaleEditAlerts.KEY_INTERVAL, 24*3600); + try { + if (com.twofortyfouram.Intent.ACTION_FIRE_SETTING.equals(intent.getAction())) { + final String title = intent.getStringExtra(LocaleEditAlerts.KEY_FILTER_TITLE); + final String sql = intent.getStringExtra(LocaleEditAlerts.KEY_SQL); + final int interval = intent.getIntExtra(LocaleEditAlerts.KEY_INTERVAL, 24*3600); - if(TextUtils.isEmpty(title) || TextUtils.isEmpty(sql) || - sql.contains("--") || sql.contains(";") || interval == 0) - return; + 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; - } + // 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, null, null); - filter.sqlQuery = sql; - TodorooCursor cursor = taskService.fetchFiltered(filter, null, Task.ID); - try { - if(cursor.getCount() == 0) - return; - 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); + // find out if we have active tasks with this tag + DependencyInjectionService.getInstance().inject(this); + Filter filter = new Filter(title, title, null, null); + filter.sqlQuery = sql; + TodorooCursor cursor = taskService.fetchFiltered(filter, null, Task.ID); + try { + if(cursor.getCount() == 0) + return; + 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, false); + // 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, false); - Preferences.setLong(preferenceKey, DateUtilities.now()); - } finally { - cursor.close(); - } - } - } catch (Exception e) { - Log.i("astrid-locale-rx", "Error receiving intent", e); - } + Preferences.setLong(preferenceKey, DateUtilities.now()); + } finally { + cursor.close(); + } + } + } catch (Exception e) { + Log.i("astrid-locale-rx", "Error receiving intent", e); + } } }