mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-25 21:48:17 +00:00
Edit message design tweaks.
This commit is contained in:
@@ -76,6 +76,7 @@ import org.signal.core.util.concurrent.LifecycleDisposable;
|
||||
import org.signal.core.util.concurrent.SignalExecutors;
|
||||
import org.signal.core.util.concurrent.SimpleTask;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.BindableConversationItem;
|
||||
import org.thoughtcrime.securesms.LoggingFragment;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.badges.gifts.OpenableGift;
|
||||
@@ -318,7 +319,17 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
||||
}
|
||||
},
|
||||
() -> conversationViewModel.shouldPlayMessageAnimations() && list.getScrollState() == RecyclerView.SCROLL_STATE_IDLE,
|
||||
() -> list.canScrollVertically(1) || list.canScrollVertically(-1));
|
||||
() -> list.canScrollVertically(1) || list.canScrollVertically(-1),
|
||||
(viewHolder) -> {
|
||||
if (viewHolder instanceof ConversationAdapter.ConversationViewHolder) {
|
||||
ConversationAdapter.ConversationViewHolder conversationViewHolder = (ConversationAdapter.ConversationViewHolder) viewHolder;
|
||||
BindableConversationItem conversationItem = conversationViewHolder.getBindable();
|
||||
if (conversationItem != null) {
|
||||
return !MessageRecordUtil.isEditMessage(conversationItem.getConversationMessage().getMessageRecord());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
multiselectItemDecoration = new MultiselectItemDecoration(requireContext(), () -> chatWallpaper);
|
||||
|
||||
@@ -1189,7 +1200,7 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
||||
}
|
||||
|
||||
public void stageOutgoingMessage(OutgoingMessage message) {
|
||||
if (message.getScheduledDate() != -1) {
|
||||
if (message.getScheduledDate() != -1 || message.isMessageEdit()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2806,8 +2806,9 @@ public class ConversationParentFragment extends Fragment
|
||||
fragment.reload(recipient.get(), threadId);
|
||||
setVisibleThread(threadId);
|
||||
}
|
||||
|
||||
fragment.scrollToBottom();
|
||||
if (!inputPanel.inEditMessageMode()) {
|
||||
fragment.scrollToBottom();
|
||||
}
|
||||
attachmentManager.cleanup();
|
||||
|
||||
updateLinkPreviewState();
|
||||
|
||||
@@ -17,7 +17,8 @@ import org.thoughtcrime.securesms.conversation.ConversationAdapter
|
||||
class ConversationItemAnimator(
|
||||
private val isInMultiSelectMode: () -> Boolean,
|
||||
private val shouldPlayMessageAnimations: () -> Boolean,
|
||||
private val isParentFilled: () -> Boolean
|
||||
private val isParentFilled: () -> Boolean,
|
||||
private val shouldUseSlideAnimation: (RecyclerView.ViewHolder) -> Boolean
|
||||
) : RecyclerView.ItemAnimator() {
|
||||
|
||||
private data class TweeningInfo(
|
||||
@@ -54,7 +55,7 @@ class ConversationItemAnimator(
|
||||
}
|
||||
|
||||
override fun animateAppearance(viewHolder: RecyclerView.ViewHolder, preLayoutInfo: ItemHolderInfo?, postLayoutInfo: ItemHolderInfo): Boolean {
|
||||
if (viewHolder.absoluteAdapterPosition > 1) {
|
||||
if (viewHolder.absoluteAdapterPosition > 1 || !shouldUseSlideAnimation(viewHolder)) {
|
||||
dispatchAnimationFinished(viewHolder)
|
||||
return false
|
||||
}
|
||||
@@ -95,7 +96,7 @@ class ConversationItemAnimator(
|
||||
|
||||
override fun animatePersistence(viewHolder: RecyclerView.ViewHolder, preLayoutInfo: ItemHolderInfo, postLayoutInfo: ItemHolderInfo): Boolean {
|
||||
return if (!isInMultiSelectMode() && shouldPlayMessageAnimations() && isParentFilled()) {
|
||||
if (pendingSlideAnimations.contains(viewHolder) || slideAnimations.containsKey(viewHolder)) {
|
||||
if (pendingSlideAnimations.contains(viewHolder) || slideAnimations.containsKey(viewHolder) || !shouldUseSlideAnimation(viewHolder)) {
|
||||
dispatchAnimationFinished(viewHolder)
|
||||
false
|
||||
} else {
|
||||
|
||||
@@ -700,6 +700,9 @@ class ConversationFragment : LoggingFragment(R.layout.v2_conversation_fragment)
|
||||
},
|
||||
isParentFilled = {
|
||||
binding.conversationItemRecycler.canScrollVertically(1) || binding.conversationItemRecycler.canScrollVertically(-1)
|
||||
},
|
||||
shouldUseSlideAnimation = { viewHolder ->
|
||||
true
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user