Skip to content

Commit c0118bb

Browse files
方啸宇YoKeyword
authored andcommitted
add a checkup
1 parent 8a82c03 commit c0118bb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ private void dispatchChild(boolean visible) {
177177
}
178178

179179
private boolean isParentInvisible() {
180-
ISupportFragment fragment = (ISupportFragment) mFragment.getParentFragment();
180+
Fragment parentFragment = mFragment.getParentFragment();
181+
ISupportFragment fragment = null;
182+
if (parentFragment instanceof ISupportFragment) { //此处强转是否要check? 在获得了parentManager的时候
183+
fragment = (ISupportFragment) parentFragment;
184+
}
181185
return fragment != null && !fragment.isSupportVisible();
182186
}
183187

0 commit comments

Comments
 (0)