Fix touch inspector when using Nodes

Summary:
Fix touch inspector when using Nodes by implementing custom logic.
This logic now takes into account that non-View nodes need to be clickable.

Reviewed By: astreet

Differential Revision: D3433927
This commit is contained in:
Ahmed El-Helw
2016-06-15 12:23:13 -07:00
parent 5f3f9caceb
commit 4ecfa0c800
4 changed files with 122 additions and 0 deletions
@@ -59,4 +59,22 @@ import android.text.Spanned;
return super.getReactTag(touchX, touchY);
}
@Override
boolean matchesTag(int tag) {
if (super.matchesTag(tag)) {
return true;
}
if (mLayout != null) {
Spanned text = (Spanned) mLayout.getText();
RCTRawText[] spans = text.getSpans(0, text.length(), RCTRawText.class);
for (RCTRawText span : spans) {
if (span.getReactTag() == tag) {
return true;
}
}
}
return false;
}
}