Hi,

I encountered this issue and for some reason, decided to clone the repo and 
try to investigate it myself. I saw that it was critical priority and 
already triaged, which means it's on somebody's task list already. 

I have landed on a fix and was wondering if I could submit a pull request 
if it's still not fixed internally. 

Basically, this issue is caused because parentTag logic works by adding a 
"synthetic" tagName to the merge layout.

The proposed fix is to adding the synthetic tag only when this layout is 
the root tag in the root layout, and not for a layout being included that 
contains merge tag with a parentTag attribute (through custom view or 
include tag)

In LayoutLibCallbackImpl getParser() method, I check if the psiFile name 
matches myRender.psiFile name. If it doesn't, that means we're actually 
rendering the psiFile which is included inside another layout file. If it's 
the latter, I created a constructor in LayoutPsiPullParser class to pass a 
boolean "isIncludedLayout", and a corresponding static create() method. 
This boolean is then passed on to createSnapshot(), and then to 
createSnapshotForMerge().

In createSnapshotForMerge, if parentTag == null or isIncludedLayout is 
true, we return the root TagSnapshot instead of adding the synthetic tag.

Does this seem like a viable approach? If it does, can I submit a PR or has 
this issue been internally resolved?



Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to