Hide files row if no attachments exist

pull/14/head
Sam Bosley 12 years ago
parent ba8749c911
commit 660dc9cf42

@ -685,6 +685,9 @@ public final class ActFmSyncService {
if (!f.exists()) if (!f.exists())
return; return;
if (!checkForToken())
return;
ArrayList<Object> params = new ArrayList<Object>(); ArrayList<Object> params = new ArrayList<Object>();
params.add("task_id"); params.add(remoteTaskId); params.add("task_id"); params.add(remoteTaskId);
params.add("token"); params.add(token); params.add("token"); params.add(token);

@ -287,7 +287,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
private static final HashMap<Class<?>, Integer> PREFERENCE_REQUEST_CODES = new HashMap<Class<?>, Integer>(); private static final HashMap<Class<?>, Integer> PREFERENCE_REQUEST_CODES = new HashMap<Class<?>, Integer>();
static { static {
PREFERENCE_REQUEST_CODES.put(SyncProviderPreferences.class, REQUEST_CODE_SYNC); PREFERENCE_REQUEST_CODES.put(SyncProviderPreferences.class, REQUEST_CODE_SYNC);
// PREFERENCE_REQUEST_CODES.put(LabsPreferences.class, REQUEST_CODE_LABS);
} }
private void addPluginPreferences(PreferenceScreen screen) { private void addPluginPreferences(PreferenceScreen screen) {

@ -804,8 +804,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
loadItem(intent); loadItem(intent);
synchronized (controls) { synchronized (controls) {
if (!(ActFmPreferenceService.isPremiumUser() || FileMetadata.taskHasAttachments(model.getId()))) { if (!FileMetadata.taskHasAttachments(model.getId()) || !ActFmPreferenceService.isPremiumUser()) {
controls.remove(filesControlSet);
filesControlSet.getDisplayView().setVisibility(View.GONE); filesControlSet.getDisplayView().setVisibility(View.GONE);
} }
for (TaskEditControlSet controlSet : controls) for (TaskEditControlSet controlSet : controls)
@ -1111,6 +1110,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
metadataService.save(fileMetadata); metadataService.save(fileMetadata);
actFmSyncService.pushAttachmentInBackground(fileMetadata); actFmSyncService.pushAttachmentInBackground(fileMetadata);
filesControlSet.refreshMetadata(); filesControlSet.refreshMetadata();
filesControlSet.getDisplayView().setVisibility(View.VISIBLE);
} }
@Override @Override

Loading…
Cancel
Save