New icons for file control set, improved refresh logic when syncing attachments

pull/14/head
Sam Bosley 12 years ago
parent 00625738b7
commit 5db46e9834

@ -76,9 +76,9 @@ public class FilesControlSet extends PopupControlSet {
protected void refreshDisplayView() { protected void refreshDisplayView() {
fileDisplayList.removeAllViews(); fileDisplayList.removeAllViews();
if (files != null && files.size() > 0) { if (files != null && files.size() > 0) {
image.setImageResource(ThemeService.getTaskEditDrawable(R.drawable.tea_icn_edit, R.drawable.tea_icn_edit_lightblue)); image.setImageResource(ThemeService.getTaskEditDrawable(R.drawable.tea_icn_files, R.drawable.tea_icn_files_lightblue));
} else { } else {
image.setImageResource(R.drawable.tea_icn_edit_gray); image.setImageResource(R.drawable.tea_icn_files_gray);
} }
for (final TaskAttachment m : files) { for (final TaskAttachment m : files) {
View fileRow = inflater.inflate(R.layout.file_display_row, null); View fileRow = inflater.inflate(R.layout.file_display_row, null);

@ -455,7 +455,25 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
} }
ActFmSyncThread.getInstance().enqueueMessage(new BriefMe<UserActivity>(UserActivity.class, null, task.getValue(Task.USER_ACTIVITIES_PUSHED_AT), BriefMe.TASK_ID_KEY, task.getUuid()), callback); ActFmSyncThread.getInstance().enqueueMessage(new BriefMe<UserActivity>(UserActivity.class, null, task.getValue(Task.USER_ACTIVITIES_PUSHED_AT), BriefMe.TASK_ID_KEY, task.getUuid()), callback);
ActFmSyncThread.getInstance().enqueueMessage(new BriefMe<TaskAttachment>(TaskAttachment.class, null, task.getValue(Task.ATTACHMENTS_PUSHED_AT), BriefMe.TASK_ID_KEY, task.getUuid()), callback); ActFmSyncThread.getInstance().enqueueMessage(new BriefMe<TaskAttachment>(TaskAttachment.class, null, task.getValue(Task.ATTACHMENTS_PUSHED_AT), BriefMe.TASK_ID_KEY, task.getUuid()), new SyncMessageCallback() {
@Override
public void runOnSuccess() {
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
TaskEditFragment tef = activity.getTaskEditFragment();
if (tef != null) {
tef.refreshFilesDisplay();
}
}
});
}
}
@Override
public void runOnErrors(List<JSONArray> errors) {/**/}
});
new FetchHistory<Task>(taskDao, Task.HISTORY_FETCH_DATE, Task.HISTORY_HAS_MORE, NameMaps.TABLE_ID_TASKS, new FetchHistory<Task>(taskDao, Task.HISTORY_FETCH_DATE, Task.HISTORY_HAS_MORE, NameMaps.TABLE_ID_TASKS,
task.getUuid(), task.getValue(Task.TITLE), task.getValue(Task.HISTORY_FETCH_DATE), 0, callback).execute(); task.getUuid(), task.getValue(Task.TITLE), task.getValue(Task.HISTORY_FETCH_DATE), 0, callback).execute();
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -29,8 +29,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="left" android:gravity="left"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:orientation="vertical"/> android:orientation="vertical"/>
</LinearLayout> </LinearLayout>
<View <View

@ -816,6 +816,12 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
} }
public void refreshFilesDisplay() {
boolean hasAttachments = taskAttachmentDao.taskHasAttachments(model.getUuid());
filesControlSet.getDisplayView().setVisibility(hasAttachments ? View.VISIBLE : View.GONE);
filesControlSet.readFromTask(model);
}
/** Populate UI component values from the model */ /** Populate UI component values from the model */
private void populateFields() { private void populateFields() {
populateFields(getActivity().getIntent()); populateFields(getActivity().getIntent());

Loading…
Cancel
Save