[Modify]修復公會消息bug

This commit is contained in:
wushaocheng
2023-02-28 00:19:55 +08:00
parent 115c897811
commit 766a599458

View File

@@ -966,21 +966,25 @@ public class MessageListPanelEx {
messageListView.post(() -> {
RecyclerView.LayoutManager layoutManager = messageListView.getLayoutManager();
if (layoutManager != null) {
View view = layoutManager.findViewByPosition(index);
RelativeLayout relativeLayout = (RelativeLayout) view; //获取布局中任意控件对象
FrameLayout frameLayout = null;
if (relativeLayout != null) {
frameLayout = relativeLayout.findViewById(R.id.message_item_content);
}
if (frameLayout != null) {
//透明度起始为1结束时为0
ObjectAnimator animator = ObjectAnimator.ofFloat(frameLayout, "alpha", 0f, 1f);
animator.setDuration(1000);//时间1s
animator.setRepeatCount(1);
animator.setRepeatMode(ValueAnimator.RESTART);
animator.start();
try {
View view = layoutManager.findViewByPosition(index);
RelativeLayout relativeLayout = (RelativeLayout) view; //获取布局中任意控件对象
FrameLayout frameLayout = null;
if (relativeLayout != null) {
frameLayout = relativeLayout.findViewById(R.id.message_item_content);
}
if (frameLayout != null) {
//透明度起始为1结束时为0
ObjectAnimator animator = ObjectAnimator.ofFloat(frameLayout, "alpha", 0f, 1f);
animator.setDuration(1000);//时间1s
animator.setRepeatCount(1);
animator.setRepeatMode(ValueAnimator.RESTART);
animator.start();
isShowAnim = true;
isShowAnim = true;
}
}catch (Exception e){
e.printStackTrace();
}
}
});