|
|
@ -682,7 +682,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm |
|
|
|
mediaIds.add(item.id); |
|
|
|
mediaIds.add(item.id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mastodonAPI.createStatus(content, inReplyToId, spoilerText, visibility, sensitive, mediaIds).enqueue(new Callback<Status>() { |
|
|
|
Callback<Status> callback = new Callback<Status>() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onResponse(Call<Status> call, Response<Status> response) { |
|
|
|
public void onResponse(Call<Status> call, Response<Status> response) { |
|
|
|
if (response.isSuccessful()) { |
|
|
|
if (response.isSuccessful()) { |
|
|
@ -696,11 +696,14 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm |
|
|
|
public void onFailure(Call<Status> call, Throwable t) { |
|
|
|
public void onFailure(Call<Status> call, Throwable t) { |
|
|
|
onSendFailure(); |
|
|
|
onSendFailure(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
mastodonAPI.createStatus(content, inReplyToId, spoilerText, visibility, sensitive, mediaIds) |
|
|
|
|
|
|
|
.enqueue(callback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void onSendSuccess() { |
|
|
|
private void onSendSuccess() { |
|
|
|
Snackbar bar = Snackbar.make(findViewById(R.id.activity_compose), getString(R.string.confirmation_send), Snackbar.LENGTH_SHORT); |
|
|
|
Snackbar bar = Snackbar.make(findViewById(R.id.activity_compose), |
|
|
|
|
|
|
|
getString(R.string.confirmation_send), Snackbar.LENGTH_SHORT); |
|
|
|
bar.show(); |
|
|
|
bar.show(); |
|
|
|
setResult(COMPOSE_SUCCESS); |
|
|
|
setResult(COMPOSE_SUCCESS); |
|
|
|
finish(); |
|
|
|
finish(); |
|
|
@ -1059,8 +1062,12 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm |
|
|
|
SpannableStringBuilder builder = new SpannableStringBuilder(); |
|
|
|
SpannableStringBuilder builder = new SpannableStringBuilder(); |
|
|
|
builder.append(' '); |
|
|
|
builder.append(' '); |
|
|
|
builder.append(media.textUrl); |
|
|
|
builder.append(media.textUrl); |
|
|
|
builder.setSpan(item.uploadUrl, 0, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
|
|
builder.setSpan(item.uploadUrl, 1, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
|
|
|
|
|
|
int cursorStart = textEditor.getSelectionStart(); |
|
|
|
textEditor.append(builder); |
|
|
|
textEditor.append(builder); |
|
|
|
|
|
|
|
if (cursorStart == textEditor.getText().length()) { |
|
|
|
|
|
|
|
textEditor.setSelection(cursorStart); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
waitForMediaLatch.countDown(); |
|
|
|
waitForMediaLatch.countDown(); |
|
|
|
} |
|
|
|
} |
|
|
|