{"record":{"id":"b150dc90166315ae","repo":"Tencent/QMUI_Android","slug":"bottomview-must-implement-from-iqmuicontinuousnest","errorCode":null,"errorMessage":"bottomView must implement from IQMUIContinuousNestedBottomView","messagePattern":"bottomView must implement from IQMUIContinuousNestedBottomView","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"qmui/src/main/java/com/qmuiteam/qmui/nestedScroll/QMUIContinuousNestedScrollLayout.java","lineNumber":242,"sourceCode":"    public IQMUIContinuousNestedTopView getTopView() {\n        return mTopView;\n    }\n\n    public IQMUIContinuousNestedBottomView getBottomView() {\n        return mBottomView;\n    }\n\n    public QMUIContinuousNestedTopAreaBehavior getTopAreaBehavior() {\n        return mTopAreaBehavior;\n    }\n\n    public QMUIContinuousNestedBottomAreaBehavior getBottomAreaBehavior() {\n        return mBottomAreaBehavior;\n    }\n\n    public void setBottomAreaView(View bottomView, @Nullable LayoutParams layoutParams) {\n        if (!(bottomView instanceof IQMUIContinuousNestedBottomView)) {\n            throw new IllegalStateException(\"bottomView must implement from IQMUIContinuousNestedBottomView\");\n        }\n        if (mBottomView != null) {\n            removeView(((View) mBottomView));\n        }\n        mBottomView = (IQMUIContinuousNestedBottomView) bottomView;\n        mBottomView.injectScrollNotifier(new IQMUIContinuousNestedBottomView.OnScrollNotifier() {\n            @Override\n            public void notify(int innerOffset, int innerRange) {\n                int topCurrent = mTopView == null ? 0 : mTopView.getCurrentScroll();\n                int topRange = mTopView == null ? 0 : mTopView.getScrollOffsetRange();\n                int offsetCurrent = mTopAreaBehavior == null ? 0 : -mTopAreaBehavior.getTopAndBottomOffset();\n                dispatchScroll(topCurrent, topRange, offsetCurrent, getOffsetRange(), innerOffset, innerRange);\n            }\n\n            @Override\n            public void onScrollStateChange(View view, int newScrollState) {\n                dispatchScrollStateChange(newScrollState, false);\n            }","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/Tencent/QMUI_Android/blob/026e7d486677d6593a96689cd590ec3561176717/qmui/src/main/java/com/qmuiteam/qmui/nestedScroll/QMUIContinuousNestedScrollLayout.java#L224-L260","documentation":"QMUIContinuousNestedScrollLayout.setBottomAreaView() requires the bottom view to implement IQMUIContinuousNestedBottomView so the layout can coordinate scrolling and paging with it. A view not implementing this interface is rejected with an IllegalStateException before it is added.","triggerScenarios":"Calling setBottomAreaView(view, layoutParams) with a view (e.g. plain RecyclerView, LinearLayout, custom pager) that does not implement IQMUIContinuousNestedBottomView.","commonSituations":"Happens when substituting QMUIContinuousNestedBottomScrollLayout/QMUIContinuousNestedBottomViewPager with a custom content area, or when a class implements the TOP interface but not the BOTTOM one (they are distinct interfaces).","solutions":["Make the view class implement IQMUIContinuousNestedBottomView and its methods (injectScrollNotifier, consumeScroll, getScrollHeight, getCurrentScroll, isBottomAreaOverlay...).","Use QMUI's provided implementations: QMUIContinuousNestedBottomScrollLayout, QMUIContinuousNestedBottomRecyclerView or QMUIContinuousNestedBottomViewPager.","Verify you are passing a bottom-area view, not a top-area view, to setBottomAreaView."],"exampleFix":"// before\nlayout.setBottomAreaView(new RecyclerView(context), null);\n\n// after\nQMUIContinuousNestedBottomRecyclerView bottom = new QMUIContinuousNestedBottomRecyclerView(context);\nlayout.setBottomAreaView(bottom, null);","handlingStrategy":"type-guard","validationCode":"if (!(bottomView instanceof IQMUIContinuousNestedBottomView)) {\n    throw new IllegalArgumentException(\"bottomView must implement IQMUIContinuousNestedBottomView\");\n}\nlayout.setBottomAreaView(bottomView, null);","typeGuard":"boolean isBottomAreaViewValid(View v) {\n    return v instanceof IQMUIContinuousNestedBottomView;\n}","tryCatchPattern":"try {\n    layout.setBottomAreaView(bottomView, layoutParams);\n} catch (IllegalStateException e) {\n    Log.e(TAG, \"bottomView invalid\", e);\n    layout.setBottomAreaView(new QMUIContinuousNestedBottomRecyclerView(context), layoutParams);\n}","preventionTips":["Implement IQMUIContinuousNestedBottomView (not the Top interface) on custom content views","Use QMUIContinuousNestedBottomRecyclerView/ViewPager/ScrollLayout stock classes","Double-check which interface the custom class implements"],"tags":["android","qmui","nested-scroll","type-mismatch","interface-not-implemented"],"backgroundTag":"type-mismatch","analyzedSha":"026e7d486677d6593a96689cd590ec3561176717","analyzedAt":"2026-09-06T13:32:24.816Z","contentChangedAt":"2026-09-06T13:32:24.816Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}