|
|
@ -874,7 +874,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
onArchive(data);
|
|
|
|
onArchive(data);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
case R.id.action_reply:
|
|
|
|
case R.id.action_reply:
|
|
|
|
onReply(data);
|
|
|
|
onReply(data, false);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -965,12 +965,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
}.load(context, owner, args);
|
|
|
|
}.load(context, owner, args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onReplyAll(ActionData data) {
|
|
|
|
|
|
|
|
context.startActivity(new Intent(context, ActivityCompose.class)
|
|
|
|
|
|
|
|
.putExtra("action", "reply_all")
|
|
|
|
|
|
|
|
.putExtra("reference", data.message.id));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void onAnswer(final ActionData data) {
|
|
|
|
private void onAnswer(final ActionData data) {
|
|
|
|
new SimpleTask<List<EntityAnswer>>() {
|
|
|
|
new SimpleTask<List<EntityAnswer>>() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -1313,7 +1307,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
onForward(data, true);
|
|
|
|
onForward(data, true);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
case R.id.menu_reply_all:
|
|
|
|
case R.id.menu_reply_all:
|
|
|
|
onReplyAll(data);
|
|
|
|
onReply(data, true);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
case R.id.menu_answer:
|
|
|
|
case R.id.menu_answer:
|
|
|
|
onAnswer(data);
|
|
|
|
onAnswer(data);
|
|
|
@ -1468,10 +1462,46 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
properties.move(data.message.id, EntityFolder.ARCHIVE, true);
|
|
|
|
properties.move(data.message.id, EntityFolder.ARCHIVE, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onReply(ActionData data) {
|
|
|
|
private void onReply(final ActionData data, final boolean all) {
|
|
|
|
context.startActivity(new Intent(context, ActivityCompose.class)
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
.putExtra("action", "reply")
|
|
|
|
args.putLong("id", data.message.id);
|
|
|
|
.putExtra("reference", data.message.id));
|
|
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Boolean>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected Boolean onLoad(Context context, Bundle args) {
|
|
|
|
|
|
|
|
long id = args.getLong("id");
|
|
|
|
|
|
|
|
List<EntityAttachment> attachments = DB.getInstance(context).attachment().getAttachments(id);
|
|
|
|
|
|
|
|
for (EntityAttachment attachment : attachments)
|
|
|
|
|
|
|
|
if (attachment.cid != null && !attachment.available)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onLoaded(Bundle args, Boolean available) {
|
|
|
|
|
|
|
|
final Intent reply = new Intent(context, ActivityCompose.class)
|
|
|
|
|
|
|
|
.putExtra("action", all ? "reply_all" : "reply")
|
|
|
|
|
|
|
|
.putExtra("reference", data.message.id);
|
|
|
|
|
|
|
|
if (available)
|
|
|
|
|
|
|
|
context.startActivity(reply);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
new DialogBuilderLifecycle(context, owner)
|
|
|
|
|
|
|
|
.setMessage(R.string.title_image_unavailable)
|
|
|
|
|
|
|
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
|
|
|
context.startActivity(reply);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.setNegativeButton(android.R.string.cancel, null)
|
|
|
|
|
|
|
|
.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
|
|
|
Helper.unexpectedError(context, owner, ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.load(context, owner, args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ItemDetailsLookup.ItemDetails<Long> getItemDetails(@NonNull MotionEvent motionEvent) {
|
|
|
|
ItemDetailsLookup.ItemDetails<Long> getItemDetails(@NonNull MotionEvent motionEvent) {
|
|
|
|