跪拜 Guibai
← All articles
Android · Open Source · Artificial Intelligence

Ten Years of Android Open Source: A 167-Star ScrollView and the Discipline to Delete Your Own Backend

By Wellijohn ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The concrete lesson for AI application teams: a conventional backend of login, tables, and a gateway can block the offline features users actually need, and a license audit is a hard engineering constraint, not a legal nicety. A decade of Android view work maps directly onto agent loop control, context budgeting, and state pollution.

Summary

StickScrollView earned 167 stars and 23 forks before its README openly told people not to use it. Android's official AppBarLayout plus CollapsingToolbarLayout already handled the same sticky-header behavior more correctly, so maintaining a hand-rolled version meant optimizing an implementation instead of solving user problems. That README note became the standard for everything that followed: evaluate whether a component should exist before writing it.

The same judgment applied to a flurry of 2017–2019 Android libraries: a single-RecyclerView infinite tree, a Canvas chart library, and a swipe layout that exposed state-change listeners rather than storing reuse state. Chart work surfaced real pitfalls like clipRect restoration and distance-weighted Bezier control points; the tree adapter used exceptions as control flow and a Tree interface to keep business types interchangeable. After 2019, production work took over, and four years were spent reading forked AI infrastructure instead of shipping code.

By 2025 the same standard deleted the backend of an Electron office tool called AI Mate. First version had Spring Boot, JWT, 21 MySQL tables, and a gateway; none of it served users, so it all went away in favor of local vector storage, Ollama, safeStorage-managed keys, and no login. Electron constraints included macOS Seatbelt versus Windows 8.3 short names and a 282MB font subset for Chinese PDFs. The recurring boundary question is now: what should the model decide, what should code decide, and what should the user decide.

Takeaways
— StickScrollView had 167 stars and 23 forks, and its README recommended the official AppBarLayout plus CollapsingToolbarLayout instead.
— Dual-list linkage loops need a driving flag to distinguish command from echo; when A scrolling makes B scroll and B's callback drives A, the result is a loop or jitter.
— MultiLevelRecyclerView flattened a tree into one RecyclerView and used getItemViewType based on level, with a Tree interface so any business object could plug in.
— In Canvas drawing, clipRect must be paired with restoreToCount(count) rather than restore(), or nested saves get popped and other controls disappear.
— Distance-weighted Bezier control points with an adjustable paramCoefficient make smoothness a user-facing aesthetic parameter instead of a hard-coded correctness choice.
— RecyclerView reuses views, not state, so swipe menu state must be owned by the business via an onSwipeStateChangeListener and re-applied in onBindViewHolder.
— AndroidProblem documented persistent platform behaviors: multi-module resource overrides, Application.onCreate running in forked child processes, GONE leaving black areas, PopupWindow EditText focus transparency on Huawei/Samsung, and TabLayout+ViewPager lifecycle callbacks not firing without tag-position binding.
— AI Mate's first version used Spring Boot, JWT, 21 MySQL tables, Redis, and a Vue admin console; the rewrite removed all backend, login, and gateway in favor of a local vector DB, Ollama, safeStorage-managed keys, and no server process.
— Electron portability constraints: Windows 8.3 short names can break workspace boundaries, Chinese PDFs need a 282MB font subset, and CI license checks must reject GPL/AGPL/SSPL runtime dependencies; jszip's dual license must be explicitly MIT and noted in NOTICE.
— The final tech stack is React 19, Electron 45, TypeScript, Node ≥ 22.12, an optional stateless OpenAI-compatible proxy, and Apache 2.0 licensing.
Conclusions

State ownership is the same problem in Android lists and agent loops: when two components drive each other, someone must hold the flag that distinguishes an instruction from an echo, and when RecyclerView reuses views, state must belong to the business layer.

"Should this exist" is a product filter that yields deliberately non-optimal portfolio numbers: a README that recommends a competitor's official component, a whole backend deleted, 21 tables gone. Keeping the filter means accepting low star counts as evidence of good judgment, not failure.

Desktop AI tooling has shifted from server-side SaaS defaults to local-first constraints: no login, no backend process, user-supplied model keys, OS keychain, and a stateless proxy. That puts permission and licensing choices back in the client, where Windows short names and font fallbacks become real bugs.

Aesthetic and subjective choices in chart rendering expose a wider rule: if a user can reasonably want different values, expose the coefficient rather than hard-coding the judgment. The same logic applies to AI-generated layout and agent tools.

Concepts & terms
Local-first AI application
An AI app that keeps data and model execution on the user's machine instead of requiring a server. In this case it means zero login, no backend process, local vector storage, and user-supplied model keys.
SafeStorage
Electron's API for storing secrets through the operating system's keychain. Combined with 0600 permissions and avoiding contextBridge exposure, it keeps model API keys off the renderer layer.
RecyclerView view reuse
Android lists recycle view instances as they scroll, so visual state like an open swipe menu must be saved by the business layer and reapplied in onBindViewHolder; otherwise item 9 inherits item 2's open state.
Stateless OpenAI-compatible proxy
A gateway with no database or login that only forwards requests in OpenAI format, making it an optional network path rather than a required backend.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗