Open drafts from thread

pull/146/head
M66B 6 years ago
parent 11ef2324bc
commit c8a76bf1be

@ -320,7 +320,10 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
vwColor.setBackgroundColor(message.accountColor == null ? Color.TRANSPARENT : message.accountColor); vwColor.setBackgroundColor(message.accountColor == null ? Color.TRANSPARENT : message.accountColor);
ivExpander.setImageResource(show_expanded ? R.drawable.baseline_expand_less_24 : R.drawable.baseline_expand_more_24); ivExpander.setImageResource(show_expanded ? R.drawable.baseline_expand_less_24 : R.drawable.baseline_expand_more_24);
ivExpander.setVisibility(viewType == ViewType.THREAD ? View.VISIBLE : View.GONE); if (viewType == ViewType.THREAD)
ivExpander.setVisibility(EntityFolder.DRAFTS.equals(message.folderType) ? View.INVISIBLE : View.VISIBLE);
else
ivExpander.setVisibility(View.GONE);
if (viewType == ViewType.THREAD) if (viewType == ViewType.THREAD)
ivFlagged.setVisibility(message.unflagged == 1 ? View.GONE : View.VISIBLE); ivFlagged.setVisibility(message.unflagged == 1 ? View.GONE : View.VISIBLE);
@ -548,7 +551,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
} }
} }
private void onAddContact(EntityMessage message) { private void onAddContact(TupleMessageEx message) {
for (Address address : message.from) { for (Address address : message.from) {
InternetAddress ia = (InternetAddress) address; InternetAddress ia = (InternetAddress) address;
String name = ia.getPersonal(); String name = ia.getPersonal();
@ -595,19 +598,26 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
} }
} }
private void onToggleMessage(int pos, EntityMessage message) { private void onToggleMessage(int pos, TupleMessageEx message) {
boolean expanded = !properties.isExpanded(message.id); if (EntityFolder.DRAFTS.equals(message.folderType))
properties.setExpanded(message.id, expanded); context.startActivity(
notifyItemChanged(pos); new Intent(context, ActivityCompose.class)
.putExtra("action", "edit")
.putExtra("id", message.id));
else {
boolean expanded = !properties.isExpanded(message.id);
properties.setExpanded(message.id, expanded);
notifyItemChanged(pos);
}
} }
private void onToggleAddresses(int pos, EntityMessage message) { private void onToggleAddresses(int pos, TupleMessageEx message) {
boolean addresses = !properties.showAddresses(message.id); boolean addresses = !properties.showAddresses(message.id);
properties.setAddresses(message.id, addresses); properties.setAddresses(message.id, addresses);
notifyItemChanged(pos); notifyItemChanged(pos);
} }
private void onShowHtml(final EntityMessage message) { private void onShowHtml(final TupleMessageEx message) {
new DialogBuilderLifecycle(context, owner) new DialogBuilderLifecycle(context, owner)
.setMessage(R.string.title_ask_show_html) .setMessage(R.string.title_ask_show_html)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@ -624,7 +634,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
.show(); .show();
} }
private void onShowImages(final EntityMessage message) { private void onShowImages(final TupleMessageEx message) {
new DialogBuilderLifecycle(context, owner) new DialogBuilderLifecycle(context, owner)
.setMessage(R.string.title_ask_show_image) .setMessage(R.string.title_ask_show_image)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

Loading…
Cancel
Save