How scwang90/smartrefreshlayout works
SmartRefreshLayout is an Android pull-to-refresh and load-more framework, accompanied here by a demo app. The principal workflow is a user gesture or automatic trigger handled by the refresh layout, which coordinates scrollable content, header/footer components, state transitions, and refresh/load callbacks; the app supplies the data operation and finishes the interaction. The README also documents nested scrolling, two-level refresh, horizontal refresh, and multiple component styles. Core coordination and several component interfaces are sampled; links for unsampled feature implementations are omitted or marked unverified.
Main entry points: SmartRefreshLayout.java Refresh layout · App.java Demo startup · practice Practice screens · style Style screens
Components 23
Refresh kernel
- Refresh layout
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java - Component contracts
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java - Refresh states
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/constant/RefreshState.java - Scroll detection
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java - Content wrappers
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper - Horizontal refresh
app/src/main/java/com/scwang/refresh/layout/widget/SmartRefreshHorizontal.java
Refresh components
- Header styles
refresh-header/src/main/java/com/scwang/smart/refresh/header - Classics header
refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java - Packaged headers
refresh-header-material/src/main/java/com/scwang/smart/refresh/header - Footer styles
- Classics footer
refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java - Ball footer
refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java
Demo app
- Demo startup
app/src/main/java/com/scwang/refresh/layout/App.java - Demo navigation
app/src/main/java/com/scwang/refresh/layout/activity/IndexMainActivity.java - Practice screens
app/src/main/java/com/scwang/refresh/layout/activity/practice - Style screens
app/src/main/java/com/scwang/refresh/layout/activity/style - Demo sections
app/src/main/java/com/scwang/refresh/layout/fragment/index - List adapter
app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java
Utilities and visuals
- Paint drawables
refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/PaintDrawable.java - Path drawables
refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java - Status bar helper
app/src/main/java/com/scwang/refresh/layout/util/StatusBarUtil.java
Other components
- App developer
- App user
Connections 21
- App developer → Refresh layout: configures
- App user → Refresh layout: pulls or loads
- Refresh layout → Component contracts: uses contracts
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java - Refresh layout → Refresh states: tracks state
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java - Refresh layout → Scroll detection: checks scrolling
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java - Refresh layout → Content wrappers: wraps content
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java - Refresh layout → Header styles: hosts header
- Refresh layout → Footer styles: hosts footer
- Refresh layout → Horizontal refresh: supports horizontal
- App developer → Demo startup: runs demo
- Demo startup → Refresh layout: sets defaults
app/src/main/java/com/scwang/refresh/layout/App.java - Demo startup → Classics header: registers default
app/src/main/java/com/scwang/refresh/layout/App.java - Demo startup → Classics footer: registers default
app/src/main/java/com/scwang/refresh/layout/App.java - Demo navigation → Demo sections: shows sections
- Demo sections → Style screens: opens styles
app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshStylesFragment.java - Demo sections → Practice screens: opens examples
- Practice screens → Refresh layout: configures refresh
app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java - Practice screens → List adapter: uses adapter
- Style screens → Header styles: demonstrates styles
app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java - Style screens → Classics header: demonstrates classic
- Practice screens → Status bar helper: adjusts system bars
app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java