{"record":{"id":"3dc2d716cf386fb7","repo":"Tencent/QMUI_Android","slug":"more-than-one-view-in-xml-marked-by-qmui-layout-ed","errorCode":null,"errorMessage":"More than one view in xml marked by qmui_layout_edge = ","messagePattern":"More than one view in xml marked by qmui_layout_edge = ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"qmui/src/main/java/com/qmuiteam/qmui/widget/pullLayout/QMUIPullLayout.java","lineNumber":137,"sourceCode":"                if (isTargetSet) {\n                    throw new RuntimeException(\n                            \"More than one view in xml are marked by qmui_is_target = true.\");\n                }\n                isTargetSet = true;\n                setTargetView(view);\n            } else {\n                if ((edgesSet & lp.edge) != 0) {\n                    String text = \"\";\n                    if (lp.edge == PULL_EDGE_LEFT) {\n                        text = \"left\";\n                    } else if (lp.edge == PULL_EDGE_TOP) {\n                        text = \"top\";\n                    } else if (lp.edge == PULL_EDGE_RIGHT) {\n                        text = \"right\";\n                    } else if (lp.edge == PULL_EDGE_BOTTOM) {\n                        text = \"bottom\";\n                    }\n                    throw new RuntimeException(\"More than one view in xml marked by qmui_layout_edge = \" + text);\n                }\n                edgesSet |= lp.edge;\n                setActionView(view, lp);\n            }\n        }\n    }\n\n    @Override\n    public void computeScroll() {\n        if (mScroller.computeScrollOffset()) {\n            if (mScroller.isFinished()) {\n                if(mState == STATE_SETTLING_TO_INIT_OFFSET){\n                    mState = STATE_IDLE;\n                    return;\n                }\n                if(mState == STATE_TRIGGERING){\n                    return;\n                }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/Tencent/QMUI_Android/blob/026e7d486677d6593a96689cd590ec3561176717/qmui/src/main/java/com/qmuiteam/qmui/widget/pullLayout/QMUIPullLayout.java#L119-L155","documentation":"QMUIPullLayout.onFinishInflate throws when two children in the XML declare the same qmui_layout_edge (top/right/bottom/left). Each pull edge may host at most one action view; the duplicated edge name is appended to the message.","triggerScenarios":"Declaring two children with the same app:qmui_layout_edge value (e.g. both \"top\"), including duplicates introduced via <include> layouts inflated into the pull layout.","commonSituations":"Copy-pasting an action-view block (header/footer) in XML without changing its edge attribute; merging layouts where an included root already declares the same edge.","solutions":["Ensure each qmui_layout_edge value (top/right/bottom/left) appears at most once among the direct children.","Change the duplicated child to a different edge if you need actions on multiple sides.","Remove the edge attribute from <include> roots that duplicate an already-declared edge."],"exampleFix":"<!-- before -->\n<View app:layout_qmui_layout_edge=\"top\"/>\n<View app:layout_qmui_layout_edge=\"top\"/>\n<!-- after -->\n<View app:layout_qmui_layout_edge=\"top\"/>\n<View app:layout_qmui_layout_edge=\"bottom\"/>","handlingStrategy":"validation","validationCode":"// ensure each edge is used at most once\nSet<Integer> seen = new HashSet<>();\nfor (int i = 0; i < pullLayout.getChildCount(); i++) {\n    QMUIPullLayout.LayoutParams lp = (QMUIPullLayout.LayoutParams) pullLayout.getChildAt(i).getLayoutParams();\n    if (!lp.isTarget && !seen.add(lp.edge)) {\n        throw new IllegalStateException(\"duplicate qmui_layout_edge \" + lp.edge);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    setContentView(R.layout.pull_screen);\n} catch (RuntimeException e) {\n    Log.e(TAG, \"duplicate qmui_layout_edge in pull layout XML\", e);\n}","preventionTips":["Use each edge value (top/right/bottom/left) at most once among non-target children.","Change the edge attribute when copy-pasting header/footer blocks.","Check <include> roots for edge attributes that may duplicate existing children."],"tags":["android","qmui","layout-inflation","xml"],"backgroundTag":"invalid-config-value","analyzedSha":"026e7d486677d6593a96689cd590ec3561176717","analyzedAt":"2026-09-06T13:32:24.816Z","contentChangedAt":"2026-09-06T13:32:24.816Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}