From 7751646d5039e5c2dbf6af07e88f1530ef30db97 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 15 Jan 2023 18:38:26 +0100 Subject: [PATCH] Fix copy/paste --- .../android/activities/ComposeActivity.java | 14 ++++++++------ .../fedilab/android/activities/MediaActivity.java | 2 -- .../fedilab/android/ui/drawer/ComposeAdapter.java | 4 ++-- .../metadata/android/en/changelogs/467.txt | 1 + 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java index 849b28a9..35648187 100644 --- a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java @@ -731,18 +731,20 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana Status status = new Status(); status.id = Helper.generateIdString(); - status.mentions = statusList.get(position).mentions; - status.visibility = statusList.get(position).visibility; + status.mentions = statusList.get(position - 1).mentions; + status.visibility = statusList.get(position - 1).visibility; final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ComposeActivity.this); boolean unlistedReplies = sharedpreferences.getBoolean(getString(R.string.SET_UNLISTED_REPLIES), true); if (status.visibility.equalsIgnoreCase("public") && unlistedReplies) { status.visibility = "unlisted"; } - status.spoiler_text = statusList.get(position).spoiler_text; - status.sensitive = statusList.get(position).sensitive; + status.spoiler_text = statusList.get(position - 1).spoiler_text; + status.sensitive = statusList.get(position - 1).sensitive; statusList.add(status); - composeAdapter.notifyItemInserted(position + 1); - binding.recyclerView.smoothScrollToPosition(position + 1); + composeAdapter.notifyItemInserted(position); + composeAdapter.notifyItemRangeChanged(0, statusList.size()); + binding.recyclerView.smoothScrollToPosition(statusList.size()); + } @Override diff --git a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java index 415024ca..32e4ec2a 100644 --- a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java @@ -28,7 +28,6 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; @@ -119,7 +118,6 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload mediaFromProfile = b.getBoolean(Helper.ARG_MEDIA_ARRAY_PROFILE, false); status = (Status) b.getSerializable(Helper.ARG_STATUS); } - Log.v(Helper.TAG, "mediaPosition: " + mediaPosition); if (mediaFromProfile && mediaAttachmentProfile != null) { attachments = new ArrayList<>(); attachments.addAll(mediaAttachmentProfile); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java index b09f4b08..7933713e 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java @@ -459,7 +459,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - manageDrafts.onItemDraftAdded(holder.getLayoutPosition()); + manageDrafts.onItemDraftAdded(statusList.size()); buttonVisibility(holder); }); } @@ -467,7 +467,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - manageDrafts.onItemDraftAdded(holder.getLayoutPosition()); + manageDrafts.onItemDraftAdded(statusList.size()); buttonVisibility(holder); }); } diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/467.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/467.txt index ae314a31..19922a8d 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/467.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/467.txt @@ -3,5 +3,6 @@ Changed: Fixed: - Fix crashes with pinch zoom +- Copy/Paste in threads - Fix crash when checking redirection on http links - Displaying menu in media preview reset zoom \ No newline at end of file