Fix issue #248 - nsfw no respected when posting
This commit is contained in:
parent
61ddd2a22d
commit
27b05d5b6b
|
@ -103,7 +103,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
public static final int REQUEST_AUDIO_PERMISSION_RESULT = 1653;
|
public static final int REQUEST_AUDIO_PERMISSION_RESULT = 1653;
|
||||||
public static final int PICK_MEDIA = 5700;
|
public static final int PICK_MEDIA = 5700;
|
||||||
public static final int TAKE_PHOTO = 5600;
|
public static final int TAKE_PHOTO = 5600;
|
||||||
|
private final Timer timer = new Timer();
|
||||||
private List<Status> statusList;
|
private List<Status> statusList;
|
||||||
private Status statusReply, statusMention;
|
private Status statusReply, statusMention;
|
||||||
private StatusDraft statusDraft;
|
private StatusDraft statusDraft;
|
||||||
|
@ -353,12 +353,14 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
.registerReceiver(imageReceiver,
|
.registerReceiver(imageReceiver,
|
||||||
new IntentFilter(Helper.INTENT_SEND_MODIFIED_IMAGE));
|
new IntentFilter(Helper.INTENT_SEND_MODIFIED_IMAGE));
|
||||||
|
|
||||||
new Timer().scheduleAtFixedRate(new TimerTask() {
|
if (timer != null) {
|
||||||
@Override
|
timer.scheduleAtFixedRate(new TimerTask() {
|
||||||
public void run() {
|
@Override
|
||||||
storeDraft(false);
|
public void run() {
|
||||||
}
|
storeDraft(false);
|
||||||
}, 0, 10000);
|
}
|
||||||
|
}, 0, 10000);
|
||||||
|
}
|
||||||
|
|
||||||
if (sharedUriList != null && sharedUriList.size() > 0) {
|
if (sharedUriList != null && sharedUriList.size() > 0) {
|
||||||
|
|
||||||
|
@ -393,6 +395,9 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
if (timer != null) {
|
||||||
|
timer.cancel();
|
||||||
|
}
|
||||||
LocalBroadcastManager.getInstance(this)
|
LocalBroadcastManager.getInstance(this)
|
||||||
.unregisterReceiver(imageReceiver);
|
.unregisterReceiver(imageReceiver);
|
||||||
}
|
}
|
||||||
|
@ -665,6 +670,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
} else {
|
} else {
|
||||||
statusReplies.add(status);
|
statusReplies.add(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (statusDraft == null) {
|
if (statusDraft == null) {
|
||||||
statusDraft = new StatusDraft(ComposeActivity.this);
|
statusDraft = new StatusDraft(ComposeActivity.this);
|
||||||
|
@ -675,10 +681,12 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (statusReplies.size() > 0) {
|
if (statusReplies.size() > 0) {
|
||||||
statusDraft.statusReplyList = statusReplies;
|
statusDraft.statusReplyList = new ArrayList<>();
|
||||||
|
statusDraft.statusReplyList.addAll(statusReplies);
|
||||||
}
|
}
|
||||||
if (statusDrafts.size() > 0) {
|
if (statusDrafts.size() > 0) {
|
||||||
statusDraft.statusDraftList = statusDrafts;
|
statusDraft.statusDraftList = new ArrayList<>();
|
||||||
|
statusDraft.statusDraftList.addAll(statusDrafts);
|
||||||
}
|
}
|
||||||
if (statusDraft.instance == null) {
|
if (statusDraft.instance == null) {
|
||||||
statusDraft.instance = account.instance;
|
statusDraft.instance = account.instance;
|
||||||
|
|
|
@ -456,13 +456,18 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
List<Attachment> attachmentList = statusList.get(position).media_attachments;
|
List<Attachment> attachmentList = statusList.get(position).media_attachments;
|
||||||
if (attachmentList != null && attachmentList.size() > 0) {
|
if (attachmentList != null && attachmentList.size() > 0) {
|
||||||
holder.binding.sensitiveMedia.setVisibility(View.VISIBLE);
|
holder.binding.sensitiveMedia.setVisibility(View.VISIBLE);
|
||||||
if (currentAccount.mastodon_account.source != null) {
|
if (!statusList.get(position).sensitive) {
|
||||||
holder.binding.sensitiveMedia.setChecked(currentAccount.mastodon_account.source.sensitive);
|
if (currentAccount.mastodon_account.source != null) {
|
||||||
statusList.get(position).sensitive = currentAccount.mastodon_account.source.sensitive;
|
holder.binding.sensitiveMedia.setChecked(currentAccount.mastodon_account.source.sensitive);
|
||||||
} else {
|
statusList.get(position).sensitive = currentAccount.mastodon_account.source.sensitive;
|
||||||
statusList.get(position).sensitive = false;
|
} else {
|
||||||
|
statusList.get(position).sensitive = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
holder.binding.sensitiveMedia.setOnCheckedChangeListener((buttonView, isChecked) -> statusList.get(position).sensitive = isChecked);
|
|
||||||
|
holder.binding.sensitiveMedia.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
statusList.get(position).sensitive = isChecked;
|
||||||
|
});
|
||||||
int mediaPosition = 0;
|
int mediaPosition = 0;
|
||||||
for (Attachment attachment : attachmentList) {
|
for (Attachment attachment : attachmentList) {
|
||||||
ComposeAttachmentItemBinding composeAttachmentItemBinding = ComposeAttachmentItemBinding.inflate(LayoutInflater.from(context), holder.binding.attachmentsList, false);
|
ComposeAttachmentItemBinding composeAttachmentItemBinding = ComposeAttachmentItemBinding.inflate(LayoutInflater.from(context), holder.binding.attachmentsList, false);
|
||||||
|
|
Loading…
Reference in New Issue