3 // Description: Checks whether current node can be removed.
6 // - The node has children
7 // - The node does not have siblings
8 // - The node does not have a background or its parent does not have a
9 // background or neither the node and its parent have a background
10 // - The parent is not a <merge/>
12 if (!xml.isRoot() && xml['..'].name() != "merge" && xml['..']['*'].size() == 1 &&
13 xml['*'].size() > 0 && ((xml.'@android:background' || xml['..'].'@android:background') ||
14 (!xml.'@android:background' && !xml['..'].'@android:background'))) {
15 analysis << [node: node, description: "This ${xml.name()} layout or " +
16 "its ${xml['..'].name()} parent is " +
17 "${xml['..'].'@android:id' ? "possibly useless" : "useless"}"]