Skip to content

Commit b24bf29

Browse files
committed
Fix #586
1 parent b5109b3 commit b24bf29

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fragmentation_core/src/main/java/me/yokeyword/fragmentation/helper/internal/VisibleDelegate.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ public void run() {
142142
}
143143

144144
private void dispatchSupportVisible(boolean visible) {
145+
if (visible && isParentInvisible()) return;
146+
145147
if (mIsSupportVisible == visible) {
146148
mNeedDispatch = true;
147149
return;
@@ -179,6 +181,11 @@ private void dispatchSupportVisible(boolean visible) {
179181
}
180182
}
181183

184+
private boolean isParentInvisible() {
185+
ISupportFragment fragment = (ISupportFragment) mFragment.getParentFragment();
186+
return fragment != null && !fragment.isSupportVisible();
187+
}
188+
182189
private boolean checkAddState() {
183190
if (!mFragment.isAdded()) {
184191
mIsSupportVisible = !mIsSupportVisible;

0 commit comments

Comments
 (0)