-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After migrating to RN 0.59, view creation timings have changed a bit. Seems like ruining this logic on pre draw sorts things out. Fixes #5124
- Loading branch information
Showing
3 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/YellowBoxHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
package com.reactnativenavigation.viewcontrollers; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import com.facebook.react.views.view.ReactViewBackgroundDrawable; | ||
import com.reactnativenavigation.utils.ViewUtils; | ||
|
||
class YellowBoxHelper { | ||
private final static int YELLOW_BOX_COLOR = -218449360; | ||
|
||
boolean isYellowBox(View parent, View child) { | ||
return parent instanceof ViewGroup && | ||
child instanceof ViewGroup && | ||
((ViewGroup) parent).getChildCount() > 1; | ||
((ViewGroup) parent).getChildCount() > 1 && | ||
!ViewUtils.findChildrenByClassRecursive((ViewGroup) child, View.class, YellowBackgroundMather((ViewGroup) child)).isEmpty(); | ||
} | ||
|
||
@NonNull | ||
private static ViewUtils.Matcher<View> YellowBackgroundMather(ViewGroup vg) { | ||
return child1 -> child1.getBackground() instanceof ReactViewBackgroundDrawable && ((ReactViewBackgroundDrawable) child1.getBackground()).getColor() == YELLOW_BOX_COLOR; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters