bingoogolapple/BGARefreshLayout-Android
多种下拉刷新效果、上拉加载更多、可配置自定义头部广告位
Stale and unlicensed — last commit 1y ago
weakest axisno license — legally unclear; last commit was 1y ago…
no license — can't legally use code; no tests detected…
Documented and popular — useful reference codebase to read through.
no license — can't legally use code; last commit was 1y ago…
- ✓2 active contributors
- ⚠Stale — last commit 1y ago
- ⚠Small team — 2 contributors active in recent commits
Show all 7 evidence items →Show less
- ⚠Single-maintainer risk — top contributor 95% of recent commits
- ⚠No license — legally unclear to depend on
- ⚠No CI workflows detected
- ⚠No test directory detected
What would change the summary?
- →Use as dependency Concerns → Mixed if: publish a permissive license (MIT, Apache-2.0, etc.); 1 commit in the last 365 days
- →Fork & modify Concerns → Mixed if: add a LICENSE file
- →Deploy as-is Concerns → Mixed if: add a LICENSE file
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Great to learn from" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/bingoogolapple/bgarefreshlayout-android)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/bingoogolapple/bgarefreshlayout-android on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: bingoogolapple/BGARefreshLayout-Android
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/bingoogolapple/BGARefreshLayout-Android shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
AVOID — Stale and unlicensed — last commit 1y ago
- 2 active contributors
- ⚠ Stale — last commit 1y ago
- ⚠ Small team — 2 contributors active in recent commits
- ⚠ Single-maintainer risk — top contributor 95% of recent commits
- ⚠ No license — legally unclear to depend on
- ⚠ No CI workflows detected
- ⚠ No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live bingoogolapple/BGARefreshLayout-Android
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/bingoogolapple/BGARefreshLayout-Android.
What it runs against: a local clone of bingoogolapple/BGARefreshLayout-Android — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in bingoogolapple/BGARefreshLayout-Android | Confirms the artifact applies here, not a fork |
| 2 | Default branch master exists | Catches branch renames |
| 3 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 4 | Last commit ≤ 544 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of bingoogolapple/BGARefreshLayout-Android. If you don't
# have one yet, run these first:
#
# git clone https://github.com/bingoogolapple/BGARefreshLayout-Android.git
# cd BGARefreshLayout-Android
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of bingoogolapple/BGARefreshLayout-Android and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "bingoogolapple/BGARefreshLayout-Android(\\.git)?\\b" \\
&& ok "origin remote is bingoogolapple/BGARefreshLayout-Android" \\
|| miss "origin remote is not bingoogolapple/BGARefreshLayout-Android (artifact may be from a fork)"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "build.gradle" \\
&& ok "build.gradle" \\
|| miss "missing critical file: build.gradle"
test -f "demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/MainActivity.java" \\
&& ok "demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/MainActivity.java" \\
|| miss "missing critical file: demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/MainActivity.java"
test -f "demo/src/main/AndroidManifest.xml" \\
&& ok "demo/src/main/AndroidManifest.xml" \\
|| miss "missing critical file: demo/src/main/AndroidManifest.xml"
test -f "demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/BaseActivity.java" \\
&& ok "demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/BaseActivity.java" \\
|| miss "missing critical file: demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/BaseActivity.java"
test -f "demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/engine/DataEngine.java" \\
&& ok "demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/engine/DataEngine.java" \\
|| miss "missing critical file: demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/engine/DataEngine.java"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 544 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~514d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/bingoogolapple/BGARefreshLayout-Android"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
BGARefreshLayout is an Android library that wraps ViewGroup/ListView/RecyclerView/ScrollView/WebView to add pull-to-refresh and load-more-on-scroll functionality with multiple built-in animation styles (Weibo, Moooc, Meituan, QQ-sticky). It lets developers choose refresh header styles, customize animations via BGARefreshViewHolder, and optionally add a scrollable ad banner above the content. Monorepo structure: demo/ contains a full reference app with Activities and Fragments demonstrating each refresh style; the core library code (not shown in file list but inferred from demo imports like cn.bingoogolapple.refreshlayout.BGARefreshLayout) is packaged separately. Demo uses adapters (NormalAdapterViewAdapter, SwipeRecyclerViewAdapter, etc.), a DataEngine for mock data, and model classes (BannerModel, RefreshModel) to showcase integration patterns.
👥Who it's for
Android app developers building Chinese-market mobile applications who need production-ready pull-to-refresh and load-more implementations without building these interactions from scratch. Commonly used by teams building shopping, social, and content apps.
🌱Maturity & risk
This is an actively maintained library (last activity visible in the repo structure suggests ongoing support). It has 4 distinct refresh implementations, comprehensive demo coverage across Activities/Fragments/ViewPager, and appears to be in use (Apache 2 license, Bintray distribution available). However, the CHANGELOG and recent commit frequency are not visible in provided data, so age cannot be definitively confirmed.
Single maintainer (bingoogolapple) is a concentration risk. The library has known limitations documented in README: ad banner doesn't transition smoothly into content, layout issues with RecyclerView + sticky nav when last item is at bottom, and refresh views don't follow scroll during active operations. No visible CI/CD setup in build files (only Gradle 3.5.4 and JCenter/Google repos). Android version support is unclear.
Active areas of work
No specific recent changes visible in provided data. The repo structure is stable and the demo app shows mature, feature-complete implementations of all four refresh styles with sticky navigation, WebView, ViewPager, and grid/list layouts. No active PRs or milestones are indicated in the provided information.
🚀Get running
git clone https://github.com/bingoogolapple/BGARefreshLayout-Android.git
cd BGARefreshLayout-Android
# Open in Android Studio or build with Gradle
./gradlew assembleDebug
# Run demo app
./gradlew :demo:installDebug
Daily commands:
In Android Studio: open project root, sync Gradle, select demo app module, and hit Run (green play button). Command line: ./gradlew :demo:installDebug && adb shell am start cn.bingoogolapple.refreshlayout.demo/.ui.activity.MainActivity. Emulator or device required.
🗺️Map of the codebase
build.gradle— Root build configuration defining Gradle version (3.5.4), JCenter/Google Maven repos, and JitPack dependency resolution—essential for understanding the build pipeline and dependency managementdemo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/MainActivity.java— Primary entry point demonstrating all refresh layout patterns and navigation structure—must read to understand demo app architecture and usage patternsdemo/src/main/AndroidManifest.xml— Application manifest declaring all activities, fragments, and permissions—required to understand app structure and entry pointsdemo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/BaseActivity.java— Abstract base class for all activities providing common initialization and lifecycle management—foundational for understanding activity hierarchydemo/src/main/java/cn/bingoogolapple/refreshlayout/demo/engine/DataEngine.java— Core data loading and simulation engine handling refresh/load-more operations—essential for understanding the business logic driving UI updatesdemo/src/main/java/cn/bingoogolapple/refreshlayout/demo/model/RefreshModel.java— Data model representing refresh items—critical for understanding the data structure passed through adapters and UI layersREADME.md— Documentation containing usage patterns, configuration examples, and known issues—must read for understanding library capabilities and common pitfalls
🛠️How to make changes
Add a New Scroll View Type to Demo
- Create new activity extending BaseActivity in demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/ (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/BaseActivity.java) - Create corresponding layout XML in demo/src/main/res/layout/ wrapping your scroll view with BGARefreshLayout (
demo/src/main/res/layout/activity_listview.xml) - Register new activity in AndroidManifest.xml with appropriate intent-filter (
demo/src/main/AndroidManifest.xml) - Add menu item in demo/src/main/res/menu/navigation_main.xml to expose new activity (
demo/src/main/res/menu/navigation_main.xml) - Set up refresh listener in activity onCreate() using DataEngine for simulated data loading (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/engine/DataEngine.java)
Add a New List Item Type & Adapter
- Create new data model POJO in demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/model/ (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/model/RefreshModel.java) - Create item layout XML in demo/src/main/res/layout/ (e.g., item_custom.xml) (
demo/src/main/res/layout/item_normal.xml) - Create adapter extending RecyclerView.Adapter in demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/adapter/ (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/adapter/NormalRecyclerViewAdapter.java) - Update DataEngine to generate model instances for new item type (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/engine/DataEngine.java) - Integrate adapter into fragment or activity, passing DataEngine-generated data (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/fragment/RefreshRecyclerViewFragment.java)
Create a Custom Refresh Header View
- Design custom header layout in demo/src/main/res/layout/ (e.g., view_custom_header3.xml) with animation drawables (
demo/src/main/res/layout/view_custom_header.xml) - Create animation XMLs in demo/src/main/res/drawable/ for pull-down, loading, and release states (
demo/src/main/res/drawable/bga_refresh_mt_refreshing.xml) - Create custom header View class implementing BGARefreshLayout header interface in demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/widget/ (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/widget/Divider.java) - Programmatically set header in activity/fragment using BGARefreshLayout.setRefreshHeaderView() before setOnRefreshListener() (
demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/activity/NormalListViewActivity.java)
Configure Load-More Footer & Behavior
- undefined
🪤Traps & gotchas
Fragment initialization gotcha: You must call setRefreshLayout() in onCreateView(), NOT in onActivityCreated() or the refresh state won't bind correctly. Direct child height: BGARefreshLayout's immediate child must use android:layout_height="0dp" + android:layout_weight="1" or the load-more view will not display. Sticky nav + RecyclerView bug: If first page's last item aligns exactly at bottom, the load-more view floats above it instead of below (documented as unsolved). No smooth transition: If you add a scrollable ad banner, the visual handoff between banner and content area is janky. Refresh while scrolling: Active refresh/load-more animations don't follow user scroll gestures (documented limitation). No Maven Central dependency, relies on JCenter (which is deprecated) or JitPack.
💡Concepts to learn
- Pull-to-Refresh State Machine — BGARefreshLayout implements a state machine (idle → pulling → ready → refreshing → done) that calls different callbacks; understanding state transitions is critical to implementing custom refresh headers
- Scale Callback & Gesture Tracking — The
handleScale(float scale, int moveYDistance)method maps vertical gesture distance to animation progress; this is how pull-to-refresh headers implement elastic and rotation animations - ViewGroup Wrapper Pattern — BGARefreshLayout wraps any scrollable child (RecyclerView, ListView, ScrollView) without inheritance; understanding this container pattern is essential for intercepting scroll events and managing multiple children
- Cubic Bézier Curves in Android — The QQ-sticky refresh style uses three-point Bézier curves to draw smooth connectors; the README notes the curves aren't fully tuned, so learning curve math is relevant for improving this effect
- Layout Weight & FlexBox in Android — The critical gotcha (child must use
layout_height=0dp+layout_weight=1) stems from how Android's LinearLayout distributes space; misunderstanding this breaks the load-more view visibility - Fragment Lifecycle & View Binding Timing — BGARefreshLayout must be initialized in
onCreateView()notonActivityCreated()due to Fragment state recovery; this reflects subtle Android lifecycle gotchas that affect any custom container library - Nested Scrolling Coordination — The known issue with RecyclerView + sticky nav + load-more reveals the complexity of coordinating scroll events across nested scrollable views; relevant for understanding NestedScrollView and scroll-aware layout managers
🔗Related repos
android/architecture-samples— Google's reference architecture for Android app structure; relevant for understanding modern Fragment/Activity patterns that BGARefreshLayout targetssquare/okhttp— Commonly paired with BGARefreshLayout to implement the network layer for refresh/load-more data fetching in production appsbingoogolapple/BGABaseAdapter-Android— Same author's companion library for list adapters; often used alongside BGARefreshLayout for RecyclerView/ListView content bindingliaohuqiu/android-Ultra-Pull-To-Refresh— Alternative pull-to-refresh library with similar feature set; useful for comparing design approaches and customization patternsbingoogolapple/BGARefreshLayoutDemo— Official extended demo repository showing advanced nesting scenarios (Activity/Fragment/ViewPager combinations) beyond the main demo app
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive instrumented tests for BGARefreshLayout refresh/load states
The repo has extensive demo activities and fragments but no visible test directory. Given the library's core functionality involves state management (refreshing, loading more, pulling, releasing), adding instrumented tests would catch regressions and verify behavior across different views (ListView, RecyclerView, ScrollView, WebView). This is critical for a library used by many apps.
- [ ] Create src/androidTest/java/cn/bingoogolapple/refreshlayout/ directory structure
- [ ] Add tests for RefreshLayout state transitions (idle → pulling → refreshing → idle)
- [ ] Add tests verifying load-more callbacks with different child views (test with NormalRecyclerViewActivity, ListViewActivity patterns)
- [ ] Add tests for edge cases: rapid pull gestures, load-more with empty data, concurrent refresh+load
- [ ] Reference demo activities (NormalRecyclerViewActivity.java, SwipeListViewActivity.java) as test templates
Document and test sticky header behavior with nested scroll views
The file structure shows StickyNav fragments and activities (StickyNavActivity.java, StickyNav*Fragment.java files), but README only mentions this feature briefly. This is a complex interaction point that likely has bugs with different view types. Adding specific documentation and tests would reduce user confusion.
- [ ] Create docs/STICKY_HEADER_GUIDE.md with examples from StickyNavListViewFragment, StickyNavRecyclerViewFragment, and StickyNavScrollViewFragment
- [ ] Document the layout_weight='1' gotcha mentioned in README with visual examples for sticky header layouts
- [ ] Add instrumented tests in src/androidTest/ specifically for sticky header positioning during pull/refresh with each view type
- [ ] Add a troubleshooting section for common sticky header issues (overlapping, disappearing during scroll)
Refactor demo adapters to eliminate code duplication and create reusable base adapters
Multiple adapter classes exist with likely duplicated logic: NormalAdapterViewAdapter, NormalRecyclerViewAdapter, StaggeredRecyclerViewAdapter, SwipeAdapterViewAdapter, SwipeRecyclerViewAdapter. Creating shared base classes would reduce maintenance burden and serve as better examples for library users.
- [ ] Create demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/adapter/BaseListAdapter.java extracting common data/binding logic from NormalAdapterViewAdapter and SwipeAdapterViewAdapter
- [ ] Create demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/adapter/BaseRecyclerAdapter.java for RecyclerView adapters, extracting from NormalRecyclerViewAdapter, StaggeredRecyclerViewAdapter, and SwipeRecyclerViewAdapter
- [ ] Refactor existing 5 adapter classes to extend these base classes
- [ ] Update all demo activities (NormalRecyclerViewActivity, SwipeRecyclerViewActivity, etc.) to use the refactored adapters
- [ ] Document the adapter pattern in docs/ADAPTER_PATTERN.md for library users
🌿Good first issues
- Add unit/instrumentation tests for Fragment lifecycle scenarios: Create tests in
demo/src/test/that verify BGARefreshLayout state in onCreateView vs onActivityCreated, validate the documented Fragment gotcha, and prevent regressions - Document the four refresh ViewHolder implementations: Write inline code comments or a Javadoc guide explaining the abstract methods in BGARefreshViewHolder and map each to BGANormalRefreshViewHolder, BGAMoocStyleRefreshViewHolder, BGAStickinessRefreshViewHolder, BGAMeiTuanRefreshViewHolder with concrete scale/state handling examples
- Create a troubleshooting FAQ in README with XML layout snippets: Add a 'Common Pitfalls' section showing correct child layout setup (0dp + weight), wrong ad banner configurations, and ViewPager nesting gotchas, with before/after examples from demo Activities
📝Recent commits
Click to expand
Recent commits
aa7e7af— Update README.md (bingoogolapple)c5bfc78— Merge pull request #182 from bingoogolapple/develop (bingoogolapple)5f03321— 2.0.1:从 JCenter 迁移到 JitPack (bingoogolapple)570e1b4— Update README.md (bingoogolapple)757d3a6— Merge pull request #180 from bingoogolapple/develop (bingoogolapple)3fb283a— 之前 ARTIFACT_ID 不可用,依赖由 cn.bingoogolapple:bga-refreshlayout 改为 cn.bingoogolapple:bga-refreshlayout-androidx (bingoogolapple)a5bb569— Merge pull request #179 from bingoogolapple/develop (bingoogolapple)127f8f1— 支持 androidx (bingoogolapple)cebc944— Merge pull request #168 from bingoogolapple/develop (bingoogolapple)a9ec32e— 修改七牛云图床地址 (bingoogolapple)
🔒Security observations
The BGARefreshLayout-Android project has moderate security concerns primarily related to outdated build tools and deprecated repository configurations. The most critical issue is the use of Gradle 3.5.4 from 2019, which lacks current security patches. The jcenter() repository dependency is particularly problematic as it was shut down in 2022. The android-maven-gradle-plugin is also unmaintained. While the codebase itself (based on file structure) appears to be a legitimate UI library without obvious injection vulnerabilities or hardcoded secrets, the build infrastructure requires modernization to ensure secure dependency resolution and protection against known vulnerabilities. Immediate action is needed to update the build system to current versions.
- High · Outdated Gradle Build Tool —
build.gradle (classpath 'com.android.tools.build:gradle:3.5.4'). The project uses Gradle 3.5.4 (released in 2019), which is significantly outdated and contains known security vulnerabilities. This version lacks security patches and modern dependency resolution features that help prevent supply chain attacks. Fix: Update to the latest stable Gradle version (currently 8.x). This will provide security patches, improved dependency resolution, and protection against known vulnerabilities. - High · Insecure Repository Configuration —
build.gradle (repositories block). The project uses jcenter() repository which was deprecated by Bintray in 2021 and shut down in 2022. Using deprecated repositories can lead to dependency resolution failures and potential supply chain attacks through compromised or stale packages. Fix: Remove jcenter() and rely on mavenCentral() and google() repositories. Update all build configuration to use only actively maintained repositories. - Medium · Deprecated Maven Gradle Plugin —
build.gradle (classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'). The project uses 'com.github.dcendents:android-maven-gradle-plugin:2.1' which is outdated. This plugin is no longer actively maintained and may have unpatched security issues. Fix: Migrate to the official 'maven-publish' plugin provided by Gradle. Replace with 'maven-publish' which is maintained and included with modern Gradle versions. - Medium · Missing Dependency Version Pinning —
build.gradle and demo/build.gradle. The build.gradle file doesn't show explicit version pinning for transitive dependencies, which could lead to unexpected behavior from automatically resolved versions and potential security vulnerabilities in dependent libraries. Fix: Implement dependency version constraints using dependencyManagement or explicit version specifications. Consider using gradle/wrapper.properties to lock Gradle version and use platform BOMs for dependency management. - Low · No Security Configuration Documentation —
README.md and project root. The README and visible project files lack security guidelines for developers using this library. No information about security best practices, vulnerability reporting, or security-related configuration is documented. Fix: Add a SECURITY.md file documenting security policies, vulnerability disclosure procedures, and security best practices for library usage. Update README with security considerations.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.