Last active
April 30, 2016 02:56
-
-
Save nganthony/83f2c847422ec017d3b856b827ca2b4d to your computer and use it in GitHub Desktop.
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
public final View findViewById(int id) { | |
if (id < 0) { | |
return null; | |
} | |
return findViewTraversal(id); | |
} | |
protected View findViewTraversal(int id) { | |
if (id == mID) { | |
return this; | |
} | |
final View[] where = mChildren; | |
final int len = mChildrenCount; | |
for (int i = 0; i < len; i++) { | |
View v = where[i]; | |
if ((v.mPrivateFlags & PFLAG_IS_ROOT_NAMESPACE) == 0) { | |
v = v.findViewById(id); | |
if (v != null) { | |
return v; | |
} | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment