Fix issue #247
This commit is contained in:
parent
1d00d489f5
commit
7d0f6b68e7
|
@ -882,7 +882,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
textWatcher = initializeTextWatcher(getApplicationContext(), social, toot_content, toot_cw_content, toot_space_left, pp_actionBar, pp_progress, TootActivity.this, TootActivity.this, TootActivity.this);
|
textWatcher = initializeTextWatcher(getApplicationContext(), social, null, toot_content, toot_cw_content, toot_space_left, pp_actionBar, pp_progress, TootActivity.this, TootActivity.this, TootActivity.this);
|
||||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)
|
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)
|
||||||
toot_content.addTextChangedListener(textWatcher);
|
toot_content.addTextChangedListener(textWatcher);
|
||||||
|
|
||||||
|
@ -916,7 +916,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextWatcher initializeTextWatcher(Context context, UpdateAccountInfoAsyncTask.SOCIAL social,
|
public static TextWatcher initializeTextWatcher(Context context, UpdateAccountInfoAsyncTask.SOCIAL social, Status status,
|
||||||
MastalabAutoCompleteTextView toot_content, EditText toot_cw_content, TextView toot_space_left,
|
MastalabAutoCompleteTextView toot_content, EditText toot_cw_content, TextView toot_space_left,
|
||||||
ImageView pp_actionBar, ProgressBar pp_progress,
|
ImageView pp_actionBar, ProgressBar pp_progress,
|
||||||
OnRetrieveSearchInterface listener, OnRetrieveSearcAccountshInterface listenerAccount, OnRetrieveEmojiInterface listenerEmoji
|
OnRetrieveSearchInterface listener, OnRetrieveSearcAccountshInterface listenerAccount, OnRetrieveEmojiInterface listenerEmoji
|
||||||
|
@ -947,6 +947,9 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
|
if( status != null ) {
|
||||||
|
status.setQuickReplyContent(s.toString());
|
||||||
|
}
|
||||||
if (autocomplete) {
|
if (autocomplete) {
|
||||||
toot_content.removeTextChangedListener(finalTextw);
|
toot_content.removeTextChangedListener(finalTextw);
|
||||||
Thread thread = new Thread() {
|
Thread thread = new Thread() {
|
||||||
|
|
|
@ -3322,13 +3322,7 @@ public class API {
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||||
setError(e.getStatusCode(), e);
|
setError(e.getStatusCode(), e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (KeyManagementException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
apiResponse.setStatuses(statuses);
|
apiResponse.setStatuses(statuses);
|
||||||
|
|
|
@ -147,6 +147,8 @@ public class Status implements Parcelable {
|
||||||
private boolean isExpanded = false;
|
private boolean isExpanded = false;
|
||||||
private int numberLines = -1;
|
private int numberLines = -1;
|
||||||
private boolean showSpoiler = false;
|
private boolean showSpoiler = false;
|
||||||
|
private String quickReplyContent;
|
||||||
|
private String quickReplyPrivacy;
|
||||||
|
|
||||||
public Status() {
|
public Status() {
|
||||||
}
|
}
|
||||||
|
@ -239,6 +241,8 @@ public class Status implements Parcelable {
|
||||||
dest.writeStringList(this.imageURL);
|
dest.writeStringList(this.imageURL);
|
||||||
dest.writeInt(this.viewType);
|
dest.writeInt(this.viewType);
|
||||||
dest.writeByte(this.isFocused ? (byte) 1 : (byte) 0);
|
dest.writeByte(this.isFocused ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeString(this.quickReplyContent);
|
||||||
|
dest.writeString(this.quickReplyPrivacy);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,6 +312,8 @@ public class Status implements Parcelable {
|
||||||
this.imageURL = in.createStringArrayList();
|
this.imageURL = in.createStringArrayList();
|
||||||
this.viewType = in.readInt();
|
this.viewType = in.readInt();
|
||||||
this.isFocused = in.readByte() != 0;
|
this.isFocused = in.readByte() != 0;
|
||||||
|
this.quickReplyContent = in.readString();
|
||||||
|
this.quickReplyPrivacy = in.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<Status> CREATOR = new Creator<Status>() {
|
public static final Creator<Status> CREATOR = new Creator<Status>() {
|
||||||
|
@ -1807,4 +1813,20 @@ public class Status implements Parcelable {
|
||||||
public void setComments(List<Status> comments) {
|
public void setComments(List<Status> comments) {
|
||||||
this.comments = comments;
|
this.comments = comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getQuickReplyContent() {
|
||||||
|
return quickReplyContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuickReplyContent(String quickReplyContent) {
|
||||||
|
this.quickReplyContent = quickReplyContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuickReplyPrivacy() {
|
||||||
|
return quickReplyPrivacy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuickReplyPrivacy(String quickReplyPrivacy) {
|
||||||
|
this.quickReplyPrivacy = quickReplyPrivacy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,7 +213,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
private MastalabAutoCompleteTextView toot_content;
|
private MastalabAutoCompleteTextView toot_content;
|
||||||
private EditText toot_cw_content;
|
private EditText toot_cw_content;
|
||||||
private TextView toot_space_left;
|
private TextView toot_space_left;
|
||||||
private String visibility;
|
|
||||||
private ArrayList<String> splitToot;
|
private ArrayList<String> splitToot;
|
||||||
private int stepSpliToot;
|
private int stepSpliToot;
|
||||||
private String in_reply_to_status;
|
private String in_reply_to_status;
|
||||||
|
@ -225,6 +224,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
private List<ViewHolder> lstHolders;
|
private List<ViewHolder> lstHolders;
|
||||||
private final Object lock = new Object();
|
private final Object lock = new Object();
|
||||||
private List<Emojis> emojisPicker;
|
private List<Emojis> emojisPicker;
|
||||||
|
private Status statusForQuickReply;
|
||||||
|
|
||||||
private Runnable updateAnimatedEmoji = new Runnable() {
|
private Runnable updateAnimatedEmoji = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -542,7 +542,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
toot.setSensitive(false);
|
toot.setSensitive(false);
|
||||||
if (toot_cw_content.getText().toString().trim().length() > 0)
|
if (toot_cw_content.getText().toString().trim().length() > 0)
|
||||||
toot.setSpoiler_text(toot_cw_content.getText().toString().trim());
|
toot.setSpoiler_text(toot_cw_content.getText().toString().trim());
|
||||||
toot.setVisibility(visibility);
|
toot.setVisibility(apiResponse.getStatuses().get(0).getVisibility());
|
||||||
if (apiResponse.getStatuses() != null && apiResponse.getStatuses().size() > 0)
|
if (apiResponse.getStatuses() != null && apiResponse.getStatuses().size() > 0)
|
||||||
toot.setIn_reply_to_id(apiResponse.getStatuses().get(0).getId());
|
toot.setIn_reply_to_id(apiResponse.getStatuses().get(0).getId());
|
||||||
toot.setContent(tootContent);
|
toot.setContent(tootContent);
|
||||||
|
@ -2450,7 +2450,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
|
|
||||||
|
|
||||||
holder.quick_reply_button.setOnClickListener(view -> {
|
holder.quick_reply_button.setOnClickListener(view -> {
|
||||||
sendToot(null);
|
sendToot(status,null);
|
||||||
status.setShortReply(false);
|
status.setShortReply(false);
|
||||||
holder.quick_reply_container.setVisibility(View.GONE);
|
holder.quick_reply_container.setVisibility(View.GONE);
|
||||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
|
@ -2480,7 +2480,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
popup.dismiss();
|
popup.dismiss();
|
||||||
sendToot(contentType);
|
sendToot(status, contentType);
|
||||||
status.setShortReply(false);
|
status.setShortReply(false);
|
||||||
holder.quick_reply_container.setVisibility(View.GONE);
|
holder.quick_reply_container.setVisibility(View.GONE);
|
||||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
|
@ -2518,23 +2518,22 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
public void onClick(DialogInterface dialog, int position) {
|
public void onClick(DialogInterface dialog, int position) {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0:
|
case 0:
|
||||||
visibility = "public";
|
status.setQuickReplyPrivacy("public");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_public_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_public_toot);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
visibility = "unlisted";
|
status.setQuickReplyPrivacy("unlisted");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_open_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_open_toot);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
visibility = "private";
|
status.setQuickReplyPrivacy("private");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_outline_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_outline_toot);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
visibility = "direct";
|
status.setQuickReplyPrivacy("direct");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_mail_outline_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_mail_outline_toot);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -2688,6 +2687,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
status.setShortReply(true);
|
status.setShortReply(true);
|
||||||
|
statusForQuickReply = status;
|
||||||
holder.quick_reply_container.setVisibility(View.VISIBLE);
|
holder.quick_reply_container.setVisibility(View.VISIBLE);
|
||||||
InputMethodManager inputMethodManager =
|
InputMethodManager inputMethodManager =
|
||||||
(InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
(InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
@ -2697,9 +2697,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
holder.quick_reply_text.requestFocus();
|
holder.quick_reply_text.requestFocus();
|
||||||
EditText content_cw = new EditText(context);
|
EditText content_cw = new EditText(context);
|
||||||
content_cw.setText(status.getReblog() != null ? status.getReblog().getSpoiler_text() : status.getSpoiler_text());
|
content_cw.setText(status.getReblog() != null ? status.getReblog().getSpoiler_text() : status.getSpoiler_text());
|
||||||
TootActivity.manageMentions(context, social, userId,
|
if( status.getQuickReplyContent() == null ) {
|
||||||
holder.quick_reply_text, content_cw, holder.toot_space_left, status.getReblog() != null ? status.getReblog() : status);
|
TootActivity.manageMentions(context, social, userId,
|
||||||
TextWatcher textWatcher = TootActivity.initializeTextWatcher(context, social, holder.quick_reply_text, content_cw, holder.toot_space_left, null, null, StatusListAdapter.this, StatusListAdapter.this, StatusListAdapter.this);
|
holder.quick_reply_text, content_cw, holder.toot_space_left, status.getReblog() != null ? status.getReblog() : status);
|
||||||
|
}else{
|
||||||
|
holder.quick_reply_text.setText(status.getQuickReplyContent());
|
||||||
|
}
|
||||||
|
TextWatcher textWatcher = TootActivity.initializeTextWatcher(context, social, status, holder.quick_reply_text, content_cw, holder.toot_space_left, null, null, StatusListAdapter.this, StatusListAdapter.this, StatusListAdapter.this);
|
||||||
|
|
||||||
toot_content = holder.quick_reply_text;
|
toot_content = holder.quick_reply_text;
|
||||||
int newInputType = toot_content.getInputType() & (toot_content.getInputType() ^ InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
|
int newInputType = toot_content.getInputType() & (toot_content.getInputType() ^ InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
|
||||||
|
@ -2749,11 +2753,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
initialTootVisibility = 3;
|
initialTootVisibility = 3;
|
||||||
break;
|
break;
|
||||||
case "private":
|
case "private":
|
||||||
visibility = "private";
|
status.setQuickReplyPrivacy("private");
|
||||||
initialTootVisibility = 2;
|
initialTootVisibility = 2;
|
||||||
break;
|
break;
|
||||||
case "direct":
|
case "direct":
|
||||||
visibility = "direct";
|
status.setQuickReplyPrivacy("direct");
|
||||||
initialTootVisibility = 1;
|
initialTootVisibility = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2766,11 +2770,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
ownerTootVisibility = 3;
|
ownerTootVisibility = 3;
|
||||||
break;
|
break;
|
||||||
case "private":
|
case "private":
|
||||||
visibility = "private";
|
status.setQuickReplyPrivacy("private");
|
||||||
ownerTootVisibility = 2;
|
ownerTootVisibility = 2;
|
||||||
break;
|
break;
|
||||||
case "direct":
|
case "direct":
|
||||||
visibility = "direct";
|
status.setQuickReplyPrivacy("direct");
|
||||||
ownerTootVisibility = 1;
|
ownerTootVisibility = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2781,25 +2785,41 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
} else {
|
} else {
|
||||||
tootVisibility = ownerTootVisibility;
|
tootVisibility = ownerTootVisibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (tootVisibility) {
|
switch (tootVisibility) {
|
||||||
case 4:
|
case 4:
|
||||||
visibility = "public";
|
status.setQuickReplyPrivacy("public");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_public_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_public_toot);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
visibility = "unlisted";
|
status.setQuickReplyPrivacy("unlisted");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_open_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_open_toot);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
visibility = "private";
|
status.setQuickReplyPrivacy("private");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_outline_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_outline_toot);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
visibility = "direct";
|
status.setQuickReplyPrivacy("direct");
|
||||||
holder.quick_reply_privacy.setImageResource(R.drawable.ic_mail_outline_toot);
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_mail_outline_toot);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if( status.getQuickReplyPrivacy() != null){
|
||||||
|
switch (status.getQuickReplyPrivacy()) {
|
||||||
|
case "public":
|
||||||
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_public_toot);
|
||||||
|
break;
|
||||||
|
case "unlisted":
|
||||||
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_open_toot);
|
||||||
|
break;
|
||||||
|
case "private":
|
||||||
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_lock_outline_toot);
|
||||||
|
break;
|
||||||
|
case "direct":
|
||||||
|
holder.quick_reply_privacy.setImageResource(R.drawable.ic_mail_outline_toot);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)
|
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)
|
||||||
holder.quick_reply_text.addTextChangedListener(textWatcher);
|
holder.quick_reply_text.addTextChangedListener(textWatcher);
|
||||||
|
|
||||||
|
@ -2822,8 +2842,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
b.putParcelable("tootReply", status);
|
b.putParcelable("tootReply", status);
|
||||||
}
|
}
|
||||||
|
|
||||||
b.putString("quickmessagevisibility", visibility);
|
b.putString("quickmessagevisibility", status.getQuickReplyPrivacy());
|
||||||
b.putString("quickmessagecontent", holder.quick_reply_text.getText().toString());
|
b.putString("quickmessagecontent", status.getQuickReplyContent());
|
||||||
intent.putExtras(b); //Put your id to your next Intent
|
intent.putExtras(b); //Put your id to your next Intent
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
if (type == RetrieveFeedsAsyncTask.Type.CONTEXT) {
|
if (type == RetrieveFeedsAsyncTask.Type.CONTEXT) {
|
||||||
|
@ -4104,7 +4124,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendToot(String content_type) {
|
private void sendToot(Status status, String content_type) {
|
||||||
|
|
||||||
if (toot_content == null || toot_content.getText() == null) {
|
if (toot_content == null || toot_content.getText() == null) {
|
||||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||||
|
@ -4127,7 +4147,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
|
|
||||||
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || !split_toot || (TootActivity.countLength(social, toot_content, toot_cw_content) < split_toot_size)) {
|
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || !split_toot || (TootActivity.countLength(social, toot_content, toot_cw_content) < split_toot_size)) {
|
||||||
tootContent = toot_content.getText().toString().trim();
|
tootContent = toot_content.getText().toString().trim();
|
||||||
createAndSendToot(tootContent, content_type, userId, instance);
|
createAndSendToot(status, content_type, userId, instance);
|
||||||
} else {
|
} else {
|
||||||
splitToot = Helper.splitToots(toot_content.getText().toString().trim(), split_toot_size, true);
|
splitToot = Helper.splitToots(toot_content.getText().toString().trim(), split_toot_size, true);
|
||||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||||
|
@ -4181,7 +4201,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
builderInner.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() {
|
builderInner.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
createAndSendToot(tootContent, content_type, userId, instance);
|
createAndSendToot(status, content_type, userId, instance);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -4192,7 +4212,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void createAndSendToot(String tootContent, String content_type, String userId, String instance){
|
private void createAndSendToot(Status status, String content_type, String userId, String instance){
|
||||||
Status toot = new Status();
|
Status toot = new Status();
|
||||||
if (content_type != null)
|
if (content_type != null)
|
||||||
toot.setContentType(content_type);
|
toot.setContentType(content_type);
|
||||||
|
@ -4201,11 +4221,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
Account account = new AccountDAO(context, db).getUniqAccount(userId, instance);
|
Account account = new AccountDAO(context, db).getUniqAccount(userId, instance);
|
||||||
if (toot_cw_content.getText().toString().trim().length() > 0)
|
if (toot_cw_content.getText().toString().trim().length() > 0)
|
||||||
toot.setSpoiler_text(toot_cw_content.getText().toString().trim());
|
toot.setSpoiler_text(toot_cw_content.getText().toString().trim());
|
||||||
toot.setVisibility(visibility);
|
toot.setVisibility(status.getQuickReplyPrivacy());
|
||||||
toot.setIn_reply_to_id(in_reply_to_status);
|
toot.setIn_reply_to_id(in_reply_to_status);
|
||||||
toot.setContent(tootContent);
|
toot.setContent(status.getQuickReplyContent());
|
||||||
new PostStatusAsyncTask(context, social, account, toot, StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new PostStatusAsyncTask(context, social, account, toot, StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
status.setQuickReplyPrivacy(null);
|
||||||
|
status.setQuickReplyContent(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4358,6 +4379,15 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
if( statuses.get(i).isFetchMore()){
|
if( statuses.get(i).isFetchMore()){
|
||||||
status.setFetchMore(true);
|
status.setFetchMore(true);
|
||||||
}
|
}
|
||||||
|
if( statuses.get(i).isShortReply()){
|
||||||
|
status.setShortReply(true);
|
||||||
|
}
|
||||||
|
if( statuses.get(i).getQuickReplyContent() != null){
|
||||||
|
status.setQuickReplyContent(statuses.get(i).getQuickReplyContent());
|
||||||
|
}
|
||||||
|
if( statuses.get(i).getQuickReplyPrivacy() != null){
|
||||||
|
status.setQuickReplyPrivacy(statuses.get(i).getQuickReplyPrivacy());
|
||||||
|
}
|
||||||
statuses.set(i, status);
|
statuses.set(i, status);
|
||||||
statusListAdapter.notifyItemChanged(i);
|
statusListAdapter.notifyItemChanged(i);
|
||||||
/*if( mRecyclerView != null) {
|
/*if( mRecyclerView != null) {
|
||||||
|
@ -4389,6 +4419,15 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
if( statuses.get(i).isFetchMore()){
|
if( statuses.get(i).isFetchMore()){
|
||||||
status.setFetchMore(true);
|
status.setFetchMore(true);
|
||||||
}
|
}
|
||||||
|
if( statuses.get(i).isShortReply()){
|
||||||
|
status.setShortReply(true);
|
||||||
|
}
|
||||||
|
if( statuses.get(i).getQuickReplyContent() != null){
|
||||||
|
status.setQuickReplyContent(statuses.get(i).getQuickReplyContent());
|
||||||
|
}
|
||||||
|
if( statuses.get(i).getQuickReplyPrivacy() != null){
|
||||||
|
status.setQuickReplyPrivacy(statuses.get(i).getQuickReplyPrivacy());
|
||||||
|
}
|
||||||
statuses.set(i, status);
|
statuses.set(i, status);
|
||||||
statusListAdapter.notifyItemChanged(i);
|
statusListAdapter.notifyItemChanged(i);
|
||||||
/*if( mRecyclerView != null) {
|
/*if( mRecyclerView != null) {
|
||||||
|
@ -4505,13 +4544,17 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
|
|
||||||
public void storeToot() {
|
public void storeToot() {
|
||||||
//Nothing to store here....
|
//Nothing to store here....
|
||||||
if (tootReply == null || (toot_content.getText().toString().trim().length() == 0 && toot_cw_content.getText().toString().trim().length() == 0))
|
if (tootReply == null || statusForQuickReply == null || statusForQuickReply.getQuickReplyContent() == null || (statusForQuickReply.getQuickReplyContent().trim().length() == 0 && toot_cw_content.getText().toString().trim().length() == 0))
|
||||||
return;
|
return;
|
||||||
Status toot = new Status();
|
Status toot = new Status();
|
||||||
if (toot_cw_content.getText().toString().trim().length() > 0)
|
if (toot_cw_content.getText().toString().trim().length() > 0)
|
||||||
toot.setSpoiler_text(toot_cw_content.getText().toString().trim());
|
toot.setSpoiler_text(toot_cw_content.getText().toString().trim());
|
||||||
toot.setVisibility(visibility);
|
if( statusForQuickReply.getQuickReplyPrivacy() != null) {
|
||||||
toot.setContent(toot_content.getText().toString().trim());
|
toot.setVisibility(statusForQuickReply.getQuickReplyPrivacy());
|
||||||
|
}
|
||||||
|
if( statusForQuickReply.getQuickReplyContent() != null) {
|
||||||
|
toot.setContent(statusForQuickReply.getQuickReplyContent().trim());
|
||||||
|
}
|
||||||
|
|
||||||
toot.setIn_reply_to_id(tootReply.getId());
|
toot.setIn_reply_to_id(tootReply.getId());
|
||||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||||
|
|
|
@ -670,7 +670,9 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
if (lv_status != null) {
|
if (lv_status != null) {
|
||||||
lv_status.setAdapter(null);
|
try {
|
||||||
|
lv_status.setAdapter(null);
|
||||||
|
}catch (Exception ignored){}
|
||||||
}
|
}
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue