Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复4.3.3中AndroidPAG在recyclerview使用导致隐藏被显示问题 #1710

Merged
merged 6 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions android/libpag/src/main/java/org/libpag/PAGView.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import android.util.AttributeSet;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
fanmingyi marked this conversation as resolved.
Show resolved Hide resolved
import android.view.ViewParent;

import org.extra.tools.Lifecycle;
import org.extra.tools.LifecycleListener;
Expand Down Expand Up @@ -633,6 +635,20 @@ public void onAnimationEnd(PAGAnimator animator) {
}
}

@Override
public void setVisibility(int visibility) {
super.setVisibility(visibility);
//When calling the setVisibility function,
//it does not necessarily trigger a callback to the onVisibilityAggregated method.
//Therefore, it is necessary to handle this specific situation on your own.
ViewParent mParent = getParent();
if (mParent != null && getWindowVisibility() == VISIBLE &&
((!(mParent instanceof ViewGroup)) || ((ViewGroup) mParent).isShown())) {
}else {
checkVisible();
}
fanmingyi marked this conversation as resolved.
Show resolved Hide resolved
}

public void onAnimationCancel(PAGAnimator animator) {
ArrayList<PAGViewListener> arrayList;
synchronized (PAGView.this) {
Expand Down
Loading