RepoPilotOpen in app →

hongyangAndroid/FlowLayout

[不再维护]Android流式布局,支持单选、多选等,适合用于产品标签等。

Mixed

Stale — last commit 7y ago

weakest axis
Use as dependencyMixed

last commit was 7y ago; no tests detected…

Fork & modifyMixed

no tests detected; no CI workflows detected…

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isMixed

last commit was 7y ago; no CI workflows detected

  • 9 active contributors
  • Apache-2.0 licensed
  • Stale — last commit 7y ago
Show all 6 evidence items →
  • Concentrated ownership — top contributor handles 70% of recent commits
  • No CI workflows detected
  • No test directory detected
What would change the summary?
  • Use as dependency MixedHealthy if: 1 commit in the last 365 days; add a test suite
  • Fork & modify MixedHealthy if: add a test suite
  • Deploy as-is MixedHealthy if: 1 commit in the last 180 days

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.

RepoPilot: Great to learn from
[![RepoPilot: Great to learn from](https://repopilot.app/api/badge/hongyangandroid/flowlayout?axis=learn)](https://repopilot.app/r/hongyangandroid/flowlayout)

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/hongyangandroid/flowlayout on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: hongyangAndroid/FlowLayout

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:

  1. 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.
  2. 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.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/hongyangAndroid/FlowLayout 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

WAIT — Stale — last commit 7y ago

  • 9 active contributors
  • Apache-2.0 licensed
  • ⚠ Stale — last commit 7y ago
  • ⚠ Concentrated ownership — top contributor handles 70% of recent commits
  • ⚠ 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 hongyangAndroid/FlowLayout repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/hongyangAndroid/FlowLayout.

What it runs against: a local clone of hongyangAndroid/FlowLayout — 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 hongyangAndroid/FlowLayout | Confirms the artifact applies here, not a fork | | 2 | License is still Apache-2.0 | Catches relicense before you depend on it | | 3 | Default branch master exists | Catches branch renames | | 4 | Last commit ≤ 2429 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>hongyangAndroid/FlowLayout</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of hongyangAndroid/FlowLayout. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/hongyangAndroid/FlowLayout.git
#   cd FlowLayout
#
# 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 hongyangAndroid/FlowLayout and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "hongyangAndroid/FlowLayout(\\.git)?\\b" \\
  && ok "origin remote is hongyangAndroid/FlowLayout" \\
  || miss "origin remote is not hongyangAndroid/FlowLayout (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(Apache-2\\.0)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"Apache-2\\.0\"" package.json 2>/dev/null) \\
  && ok "license is Apache-2.0" \\
  || miss "license drift — was Apache-2.0 at generation time"

# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
  && ok "default branch master exists" \\
  || miss "default branch master no longer exists"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 2429 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~2399d)"
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/hongyangAndroid/FlowLayout"
  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).

</details>

TL;DR

FlowLayout is an Android custom ViewGroup that arranges child views (typically tags) in a wrap-around flow pattern, similar to how text wraps to the next line. It provides built-in support for single/multi-select modes with automatic state management via selector backgrounds, making it ideal for product tag UIs, filters, and choice interfaces without heavy boilerplate. Standard Android library module structure: flowlayout-lib/ is the published library containing core classes (FlowLayout.java, TagFlowLayout.java, TagAdapter.java, TagView.java) under com.zhy.view.flowlayout, with a separate flowlayout/ module serving as the demo app. Resources in src/main/res/values/ define XML attributes (attrs.xml) for layout configuration like max_select.

👥Who it's for

Android app developers building UIs with tag/chip selection components (product filters, category selection, hashtag input) who want a declarative, adapter-based approach similar to ListView but with automatic wrapping and selection state binding.

🌱Maturity & risk

Unmaintained legacy library (repo marked [不再维护] — 'no longer maintained'). No recent commits visible in the structure, likely 4+ years dormant. Has ~38.9KB of Java code across core classes but minimal test infrastructure (only ApplicationTest.java stubs). Not production-grade for modern Android projects using Jetpack Compose or modern constraint layouts.

High risk for new projects: unmaintained status means no support for newer Android API levels, Material Design 3, or modern Kotlin idioms. Single maintainer (hongyangAndroid), no CI/CD setup visible in gradle configs (uses old gradle 2.2.0 from 2016). Dependencies on outdated jcenter() repository which was sunset. State auto-persistence mechanism during activity recreation could cause memory leaks if child views hold references improperly.

Active areas of work

Nothing. Repository is explicitly marked as unmaintained ([不再维护] in the description). No recent activity, pull requests, or commits are visible in the provided metadata.

🚀Get running

Clone the repo: git clone https://github.com/hongyangAndroid/FlowLayout.git && cd FlowLayout. Sync Gradle (./gradlew syncDebug) to download dependencies from jcenter(). Open flowlayout/src/main to inspect the demo app, or flowlayout-lib/src/main for the library source.

Daily commands: Import into Android Studio. The flowlayout/ module is a runnable demo app; select it as the launch module and run on an AVD or device. The flowlayout-lib/ module is the library itself (not directly runnable).

🗺️Map of the codebase

🛠️How to make changes

Add new feature: modify flowlayout-lib/src/main/java/com/zhy/view/flowlayout/TagFlowLayout.java for selection logic or FlowLayout.java for layout behavior. Change styling: edit flowlayout-lib/src/main/res/values/attrs.xml to add XML attributes, then parse them in FlowLayout's constructor. Test changes: run the demo app in flowlayout/src/main/java/com/zhy/flowlayout/ and interact with the UI.

🪤Traps & gotchas

Selector state binding: Relies on android:state_checked in drawable selectors, which only works if child views properly implement View.setChecked(). If custom child views don't support this, visual feedback breaks silently. Activity reconstruction: Selection state is auto-saved but uses implicit Bundle serialization; if TagAdapter holds non-serializable objects (e.g., listeners), recreating activity will crash. jcenter() deprecation: Repository uses jcenter() in build.gradle which was sunset in 2021; builds will fail with newer Gradle versions without migrating to mavenCentral(). No thread safety: Selection set modifications are not synchronized; concurrent access from multiple threads will corrupt state.

💡Concepts to learn

  • Custom ViewGroup Layout Pass (measure/layout) — FlowLayout's core algorithm happens in onMeasure() and onLayout(); understanding view measurement constraints and child positioning is essential to modify wrapping behavior or add spacing logic
  • Drawable State (android:state_checked) — TagFlowLayout delegates visual selection feedback to drawable selectors that respond to View state bitmasks; this decouples selection logic from custom drawing code but requires views to properly report their checked state
  • Adapter Pattern (Data Binding) — TagAdapter abstracts data collection and view inflation similar to ListView adapters, enabling reuse and dynamic updates; understanding getView() callbacks and notifyDataChanged() is critical for data binding
  • Activity State Preservation (Bundle/Parcelable) — FlowLayout persists selected tag indices across activity recreation/rotation via implicit serialization; understanding when and how View state is saved/restored prevents selection loss or crashes on configuration changes
  • Constraint-based Layout Measurement — onMeasure() receives MeasureSpec constants (AT_MOST, EXACTLY, UNSPECIFIED) that constrain child sizing; TagFlowLayout must respect parent constraints while calculating its own size based on wrapped children
  • Set-based State Tracking — Selection state is stored in a Set<Integer> of selected positions; understanding set semantics (uniqueness, unordered, fast lookups) and synchronization issues is important for modifying selection behavior or adding persistence
  • google/material-components-android — Modern successor approach: Google's Chip and ChipGroup components handle tag/selection UI with Material Design 3 and better lifecycle awareness
  • facebookarchive/FbFlowLayout — Alternative flow layout implementation from Facebook with similar wrapping behavior, useful for comparison of measure/layout strategies
  • mmin18/FlowLayout — Another popular FlowLayout variant in the Android ecosystem with similar adapter-based tag selection, still more recently maintained
  • hongyangAndroid/AndroidBlog — The same author's technical blog repo, likely contains design rationale and tutorials for FlowLayout and related Android components
  • square/flow — Square's Flow library handles state-driven navigation and view management, complementary for apps that build tag UIs with complex flow navigation

🪄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 unit tests for TagFlowLayout and TagAdapter core functionality

The repo has androidTest directories but only contains basic ApplicationTest.java files. The core library classes (FlowLayout.java, TagFlowLayout.java, TagAdapter.java, TagView.java) lack unit test coverage for critical functionality like selection state management, adapter data binding, max_select constraint enforcement, and state persistence across configuration changes. This is especially important given the library's core feature is managing selection state.

  • [ ] Create flowlayout-lib/src/test/java/com/zhy/view/flowlayout/TagFlowLayoutTest.java with tests for max_select enforcement (single, multiple, unlimited selection modes)
  • [ ] Add tests in TagAdapterTest.java for notifyDataChanged behavior and selection state preservation
  • [ ] Add tests for state persistence scenarios (configuration changes, rotation) referenced in README as a core feature
  • [ ] Test TagView selection state transitions and selector background switching behavior

Migrate build configuration from deprecated Gradle 2.2.0 and jcenter() to modern standards

The build.gradle uses gradle:2.2.0 (released 2016) and jcenter() repository which is no longer recommended/maintained. This blocks the library from being used in new projects targeting recent Android API levels and creates security/compatibility issues. The bintray-release:0.3.4 plugin is also deprecated.

  • [ ] Update root build.gradle to use gradle:8.x (latest stable) and replace jcenter() with mavenCentral() in all repository blocks
  • [ ] Update buildToolsVersion and compileSdkVersion in flowlayout-lib/build.gradle and flowlayout/build.gradle to target API 34+ (current standard)
  • [ ] Replace novoda/bintray-release plugin with gradle-maven-publish-plugin or Maven Central publishing via gradle-publish
  • [ ] Verify AndroidX compatibility by checking if support library dependencies need updates (not visible in snippet but likely needed)

Add instrumented tests for TagFlowLayout within ListViewTestFragment and ScrollViewTestFragment scenarios

The repo contains example activities (ListViewTestFragment.java, ScrollViewTestFragment.java) that demonstrate integration with scrollable containers, but there are no corresponding instrumented tests validating these integration scenarios. The library's ability to work correctly within ListView/ScrollView with tag reuse and state management is non-trivial and should be tested.

  • [ ] Create flowlayout-lib/src/androidTest/java/com/zhy/view/flowlayout/ScrollableContainerTest.java with tests for TagFlowLayout inside ListView/RecyclerView with tag state preservation during scroll
  • [ ] Add tests validating that selected tags remain selected when scrolling out and back into view
  • [ ] Test adapter notifyDataChanged behavior while items are scrolled off-screen
  • [ ] Verify max_select constraint is enforced correctly during scroll-based view recycling scenarios

🌿Good first issues

  • Add unit tests for FlowLayout.java measure/layout logic: currently only ApplicationTest.java stub exists, no assertions for wrapping behavior with different child sizes or parent constraints.
  • Migrate build.gradle from jcenter() to mavenCentral() and update gradle wrapper from 2.2.0 to 7.x+ to support modern Android Studio and Gradle versions.
  • Document the TagView.java class behavior and its role in selection state: the README mentions TagView but provides no API docs or example usage, making it unclear if end-users should subclass it.

Top contributors

Click to expand

📝Recent commits

Click to expand
  • d41af18 — Merge pull request #126 from EKwongChum/master (hongyangAndroid)
  • 12f6794 — fix bug“” (EKwong)
  • eda3515 — try to give FlowLayout an RTL function (EKwong)
  • 0cc775f — 修改gravity->tag_gravity (zhanghongyang01)
  • da1aed6 — 【fixbug】#97,#95,#92,#90,#85,#83,#80 (zhanghongyang01)
  • 78b30fc — Merge pull request #75 from ValuesFeng/master (hongyangAndroid)
  • 4e16674 — fix tagview bug (ValuesFeng)
  • ba36ab6 — Merge pull request #64 from freestyletime/patch-1 (hongyangAndroid)
  • e8f95bd — 修复设置默认Tag时的崩溃问题 (ChristianChen)
  • c41adaa — fix listview demo (hongyangAndroid)

🔒Security observations

The FlowLayout project has significant security concerns primarily due to being unmaintained and using severely outdated build tools and dependencies. The Gradle build system (v2.2.0 from 2016) and bintray-release plugin (v0.3.4) contain known vulnerabilities and no longer receive updates. The reliance on the deprecated JCenter repository adds supply chain risks. The project's unmaintained status means no security patches will be provided. Critical action needed: either transition to an actively maintained alternative or conduct a comprehensive security audit and maintain a patched fork internally.

  • High · Outdated Gradle Build Tools — build.gradle (classpath 'com.android.tools.build:gradle:2.2.0'). The project uses Gradle build tools version 2.2.0, which was released in 2016 and contains known security vulnerabilities. This version is significantly outdated and no longer receives security updates. Fix: Update to the latest stable Gradle build tools version (currently 7.x or 8.x). Review and update all dependencies to their latest secure versions.
  • High · Outdated Bintray Release Plugin — build.gradle (classpath 'com.novoda:bintray-release:0.3.4'). The project uses bintray-release version 0.3.4, which is severely outdated (last maintained around 2016-2017). Bintray service has been sunset by JFrog and the plugin may have unpatched vulnerabilities. Fix: Replace with modern alternatives like Maven Central publishing or JFrog Artifactory. Consider using gradle-maven-publish-plugin or similar maintained solutions.
  • Medium · Deprecated JCenter Repository — build.gradle (repositories { jcenter() }). The project relies on JCenter repository, which was deprecated and shut down by JFrog in 2021. Dependencies may no longer be available, and using deprecated repositories introduces supply chain risks. Fix: Migrate to Maven Central Repository as the primary dependency source. Update build.gradle to use 'mavenCentral()' instead of 'jcenter()'.
  • Medium · Project Marked as Unmaintained — Repository description and README. According to the repository description '[不再维护]' (no longer maintained), the project is not actively maintained. This means security issues and bugs will not be patched, posing ongoing risks to applications using this library. Fix: Consider maintaining a private fork or switching to an actively maintained alternative flow layout library. If continuing to use, conduct thorough security code review.
  • Low · Missing Security Configuration in Proguard Rules — flowlayout-lib/proguard-rules.pro and flowlayout/proguard-rules.pro. Proguard rules files exist but their content is not provided for analysis. Improper ProGuard configuration may fail to obfuscate sensitive code or allow reverse engineering. Fix: Review and enhance ProGuard rules to ensure proper obfuscation of sensitive code. Include rules for third-party libraries used in the project.
  • Low · Potential Missing Input Validation — flowlayout-lib/src/main/java/com/zhy/view/flowlayout/TagAdapter.java and TagFlowLayout.java. The TagAdapter and TagFlowLayout classes handle tag data but without visibility into their implementation, input validation patterns cannot be confirmed. Tag data could potentially be unsanitized if displaying user-controlled content. Fix: Ensure all input is properly validated and sanitized. Implement input bounds checking and type validation, especially if displaying user-generated content.

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Mixed signals · hongyangAndroid/FlowLayout — RepoPilot