mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-28 21:57:17 +00:00
Fix scroll jump when reacting with keyboard open.
This commit is contained in:
@@ -63,6 +63,15 @@ class InputAwareConstraintLayout @JvmOverloads constructor(
|
||||
wasKeyboardVisibleBeforeToggle = false
|
||||
}
|
||||
|
||||
fun hideKeyboard(imeTarget: EditText, keepHeightOverride: Boolean = false) {
|
||||
if (isKeyboardShowing) {
|
||||
if (keepHeightOverride) {
|
||||
overrideKeyboardGuidelineWithPreviousHeight()
|
||||
}
|
||||
ViewUtil.hideKeyboard(context, imeTarget)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showInput(fragmentCreator: FragmentCreator, imeTarget: EditText) {
|
||||
inputId = fragmentCreator.id
|
||||
input = fragmentCreator.create()
|
||||
|
||||
@@ -444,11 +444,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
animatorSet.start();
|
||||
|
||||
if (onHideListener != null) {
|
||||
onHideListener.startHide();
|
||||
}
|
||||
|
||||
if (selectedConversationModel.getFocusedView() != null) {
|
||||
ViewUtil.focusAndShowKeyboard(selectedConversationModel.getFocusedView());
|
||||
onHideListener.startHide(selectedConversationModel.getFocusedView());
|
||||
}
|
||||
|
||||
animatorSet.addListener(new AnimationCompleteListener() {
|
||||
@@ -760,13 +756,15 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
|
||||
private void handleActionItemClicked(@NonNull Action action) {
|
||||
hideInternal(new OnHideListener() {
|
||||
@Override public void startHide() {
|
||||
@Override
|
||||
public void startHide(@Nullable View focusedView) {
|
||||
if (onHideListener != null) {
|
||||
onHideListener.startHide();
|
||||
onHideListener.startHide(focusedView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onHide() {
|
||||
@Override
|
||||
public void onHide() {
|
||||
if (onHideListener != null) {
|
||||
onHideListener.onHide();
|
||||
}
|
||||
@@ -893,7 +891,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
||||
}
|
||||
|
||||
public interface OnHideListener {
|
||||
void startHide();
|
||||
void startHide(@Nullable View focusedView);
|
||||
void onHide();
|
||||
}
|
||||
|
||||
|
||||
@@ -2884,7 +2884,7 @@ class ConversationFragment :
|
||||
ViewUtil.fadeOut(target.quotedIndicatorView!!, 150, View.INVISIBLE)
|
||||
}
|
||||
|
||||
ViewUtil.hideKeyboard(requireContext(), itemView)
|
||||
container.hideKeyboard(composeText, keepHeightOverride = true)
|
||||
|
||||
viewModel.setHideScrollButtonsForReactionOverlay(true)
|
||||
|
||||
@@ -2894,9 +2894,13 @@ class ConversationFragment :
|
||||
ReactionsToolbarListener(item.conversationMessage),
|
||||
selectedConversationModel,
|
||||
object : OnHideListener {
|
||||
override fun startHide() {
|
||||
override fun startHide(focusedView: View?) {
|
||||
multiselectItemDecoration.hideShade(binding.conversationItemRecycler)
|
||||
ViewUtil.fadeOut(binding.reactionsShade, resources.getInteger(R.integer.reaction_scrubber_hide_duration), View.GONE)
|
||||
|
||||
if (focusedView == composeText) {
|
||||
container.showSoftkey(composeText)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onHide() {
|
||||
|
||||
Reference in New Issue
Block a user