fix [上滑无法关闭名片]

This commit is contained in:
zlzw 2024-03-28 13:48:20 +08:00
parent 72a18a0500
commit 6e6acd8871
2 changed files with 20 additions and 7 deletions

View File

@ -34,6 +34,7 @@ import io.rong.imkit.conversation.MessageListAdapter;
import io.rong.imkit.conversation.extension.InputMode; import io.rong.imkit.conversation.extension.InputMode;
import io.rong.imkit.conversation.extension.RongExtensionViewModel; import io.rong.imkit.conversation.extension.RongExtensionViewModel;
import io.rong.imkit.conversation.extension.component.inputpanel.InputPanel; import io.rong.imkit.conversation.extension.component.inputpanel.InputPanel;
import io.rong.imkit.widget.refresh.api.RefreshLayout;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation; import io.rong.imlib.model.Conversation;
@ -52,6 +53,12 @@ public class PDLiveConversationFragment extends ConversationFragment {
public PDLiveConversationFragment() { public PDLiveConversationFragment() {
} }
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
super.onLoadMore(refreshLayout);
EventBus.getDefault().post(new PDChatInputModeEvent(InputMode.TextInput));
}
@Override @Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
mList.addOnScrollListener(new RecyclerView.OnScrollListener() { mList.addOnScrollListener(new RecyclerView.OnScrollListener() {
@ -63,8 +70,10 @@ public class PDLiveConversationFragment extends ConversationFragment {
@Override @Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy); super.onScrolled(recyclerView, dx, dy);
if (dx != 0 || dy != 0) {
EventBus.getDefault().post(new PDChatInputModeEvent(InputMode.TextInput)); EventBus.getDefault().post(new PDChatInputModeEvent(InputMode.TextInput));
} }
}
}); });
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
view.setBackgroundColor(Color.parseColor("#00000000")); view.setBackgroundColor(Color.parseColor("#00000000"));

View File

@ -7,6 +7,8 @@ import android.graphics.Color;
import android.os.Build; import android.os.Build;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.animation.Animation; import android.view.animation.Animation;
@ -15,6 +17,7 @@ import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
@ -233,6 +236,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
imgMore.setOnClickListener(this); imgMore.setOnClickListener(this);
imBack.setOnClickListener(this); imBack.setOnClickListener(this);
card = findViewById(R.id.userCard); card = findViewById(R.id.userCard);
mContainer = findViewById(R.id.container);
card.setBackgroundColor(Color.parseColor("#00000000")); card.setBackgroundColor(Color.parseColor("#00000000"));
mContainer = findViewById(R.id.container); mContainer = findViewById(R.id.container);
inputPanel.addMediaMessageCallback(new InputPanelViewHolder.MediaMessageCallback() { inputPanel.addMediaMessageCallback(new InputPanelViewHolder.MediaMessageCallback() {