From 660dc9cf4201beb2279b7a3f24598c20a2886206 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 3 Sep 2012 15:14:30 -0700 Subject: [PATCH] Hide files row if no attachments exist --- .../com/todoroo/astrid/actfm/sync/ActFmSyncService.java | 3 +++ astrid/src/com/todoroo/astrid/activity/EditPreferences.java | 1 - astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index bfe515b04..e22460c76 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -685,6 +685,9 @@ public final class ActFmSyncService { if (!f.exists()) return; + if (!checkForToken()) + return; + ArrayList params = new ArrayList(); params.add("task_id"); params.add(remoteTaskId); params.add("token"); params.add(token); diff --git a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java index e714da623..fcbce7464 100644 --- a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java +++ b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java @@ -287,7 +287,6 @@ public class EditPreferences extends TodorooPreferenceActivity { private static final HashMap, Integer> PREFERENCE_REQUEST_CODES = new HashMap, Integer>(); static { PREFERENCE_REQUEST_CODES.put(SyncProviderPreferences.class, REQUEST_CODE_SYNC); -// PREFERENCE_REQUEST_CODES.put(LabsPreferences.class, REQUEST_CODE_LABS); } private void addPluginPreferences(PreferenceScreen screen) { diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java index 5fc7a0ec4..2b711d79a 100755 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java @@ -804,8 +804,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { loadItem(intent); synchronized (controls) { - if (!(ActFmPreferenceService.isPremiumUser() || FileMetadata.taskHasAttachments(model.getId()))) { - controls.remove(filesControlSet); + if (!FileMetadata.taskHasAttachments(model.getId()) || !ActFmPreferenceService.isPremiumUser()) { filesControlSet.getDisplayView().setVisibility(View.GONE); } for (TaskEditControlSet controlSet : controls) @@ -1111,6 +1110,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { metadataService.save(fileMetadata); actFmSyncService.pushAttachmentInBackground(fileMetadata); filesControlSet.refreshMetadata(); + filesControlSet.getDisplayView().setVisibility(View.VISIBLE); } @Override