|
|
@ -1379,7 +1379,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
if ("edit".equals(action))
|
|
|
|
if ("edit".equals(action))
|
|
|
|
throw new IllegalStateException("Draft not found hide=" + (result.draft != null));
|
|
|
|
throw new IllegalStateException("Draft not found hide=" + (result.draft != null));
|
|
|
|
|
|
|
|
|
|
|
|
List<EntityIdentity> identities = db.identity().getIdentities();
|
|
|
|
List<TupleIdentityEx> identities = db.identity().getIdentities(true);
|
|
|
|
|
|
|
|
|
|
|
|
EntityMessage ref = db.message().getMessage(reference);
|
|
|
|
EntityMessage ref = db.message().getMessage(reference);
|
|
|
|
if (ref == null) {
|
|
|
|
if (ref == null) {
|
|
|
@ -1640,16 +1640,14 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
|
|
|
|
|
|
|
getActivity().invalidateOptionsMenu();
|
|
|
|
getActivity().invalidateOptionsMenu();
|
|
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(getContext());
|
|
|
|
new SimpleTask<List<TupleIdentityEx>>() {
|
|
|
|
|
|
|
|
|
|
|
|
db.identity().liveIdentities().observe(getViewLifecycleOwner(), new Observer<List<TupleIdentityEx>>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onChanged(List<TupleIdentityEx> identities) {
|
|
|
|
protected List<TupleIdentityEx> onExecute(Context context, Bundle args) {
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
|
|
|
List<TupleIdentityEx> identities = db.identity().getIdentities(true);
|
|
|
|
if (identities == null)
|
|
|
|
if (identities == null)
|
|
|
|
identities = new ArrayList<>();
|
|
|
|
identities = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
Log.i("Set identities=" + identities.size());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sort identities
|
|
|
|
// Sort identities
|
|
|
|
Collections.sort(identities, new Comparator<TupleIdentityEx>() {
|
|
|
|
Collections.sort(identities, new Comparator<TupleIdentityEx>() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -1664,6 +1662,13 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return identities;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, List<TupleIdentityEx> identities) {
|
|
|
|
|
|
|
|
Log.i("Set identities=" + identities.size());
|
|
|
|
|
|
|
|
|
|
|
|
// Show identities
|
|
|
|
// Show identities
|
|
|
|
IdentityAdapter adapter = new IdentityAdapter(getContext(), identities);
|
|
|
|
IdentityAdapter adapter = new IdentityAdapter(getContext(), identities);
|
|
|
|
adapter.setDropDownViewResource(R.layout.spinner_item1_dropdown);
|
|
|
|
adapter.setDropDownViewResource(R.layout.spinner_item1_dropdown);
|
|
|
@ -1677,9 +1682,15 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
|
|
|
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}.execute(FragmentCompose.this, new Bundle(), "compose:identities");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(getContext());
|
|
|
|
|
|
|
|
|
|
|
|
db.attachment().liveAttachments(result.draft.id).observe(getViewLifecycleOwner(),
|
|
|
|
db.attachment().liveAttachments(result.draft.id).observe(getViewLifecycleOwner(),
|
|
|
|
new Observer<List<EntityAttachment>>() {
|
|
|
|
new Observer<List<EntityAttachment>>() {
|
|
|
|