Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Android进阶之光 — Reading Guide
## 【One-Line Pitch】
A practical, source-code-driven guide for Android developers who want to move beyond basic app building into advanced topics like Material Design, custom Views, and multithreading. Read this if you have 1–2 years of Android experience and want to understand *how* the framework works, not just *what* APIs to call.
---
## 【Book Arc】
- **Opening (~0%–10%)**: Android 5.0/6.0 new features — Material Design components, RecyclerView with waterfall layouts, CardView, and the new Notification styles (foldable, heads-up). This stage gets you productive with modern UI building blocks quickly.
- **Early (~10%–23%)**: Runtime permissions (Android 6.0) and the Design Support Library deep-dive — Snackbar, TextInputLayout, FloatingActionButton, TabLayout, NavigationView, and CoordinatorLayout. The focus shifts from "what's new" to "how to build real screens with these tools."
- **Early-to-Middle (~23%–39%)**: The View system core — View/ViewGroup hierarchy, coordinate systems, six ways to slide a View (layout(), offsetLeftAndRight(), LayoutParams, animation, scrollTo/scrollBy, Scroller), and a source-level walkthrough of the event dispatch mechanism (dispatchTouchEvent → onInterceptTouchEvent → onTouchEvent).
- **Middle (~39%–48%)**: View's working pipeline — MeasureSpec, measure/layout/draw flows, and custom View development including custom attributes via TypedArray. This is the "roll up your sleeves" section where you build your own components.
- **Late (~48%+)**: Multithreading begins — thread creation, interruption, and safe termination patterns. The book continues into concurrency topics that build on the UI foundation established earlier.
---
## 【Key Takeaways】
- **Material Design is the new baseline for Android UI** (Opening): RecyclerView with staggered grids gives you waterfall layouts in minutes, and CardView adds rounded corners and shadows with zero custom drawing. Use these instead of hand-rolling list UIs.
- **Runtime permissions changed the developer contract** (Early): Android 6.0+ requires asking for permissions at runtime, not install time. Set `targetSdkVersion` below 23 to bypass this (legacy apps), or use annotation-based libraries like PermissionsDispatcher to avoid boilerplate — its `@RuntimePermissions`, `@NeedsPermission`, and `@OnPermissionDenied` annotations handle the flow for you.
- **Design Support Library solves real UI problems** (Early): TextInputLayout gives you floating labels for login forms, TabLayout with `app:tabMode="scrollable"` fixes the "too many tabs squeezed together" problem, and CoordinatorLayout + AppBarLayout + CollapsingToolbarLayout creates the collapsing-header effect seen in modern apps like NetEase.
- **View sliding has six distinct approaches, each with trade-offs** (Early): `layout()` and `offsetLeftAndRight()` are simple but manual; LayoutParams changes trigger re-layout; animations are smooth but don't change the actual position; `scrollTo/scrollBy` moves content within a View; Scroller adds fling-like physics with interpolators.
- **Event dispatch is a three-method handoff chain** (Early): `dispatchTouchEvent` distributes, `onInterceptTouchEvent` intercepts (ViewGroup only), and `onTouchEvent` handles. The DOWN event initializes the touch target; understanding this chain is the key to fixing touch conflicts in custom containers.
- **View measurement is driven by MeasureSpec** (Middle): The parent passes mode (EXACTLY, AT_MOST, UNSPECIFIED) and size to children. A custom ViewGroup must call `measureChildren()` and then set its own dimensions based on children's measured sizes — the sample code shows how to handle each MeasureSpec mode combination.
- **Custom Views need custom attributes via TypedArray** (Middle): Define `declare-styleable` in XML, read values in the `AttributeSet` constructor with `obtainStyledAttributes()`, and always call `recycle()` to free resources. This is the standard pattern for making your View configurable from XML.
- **Safe thread termination requires interruption, not force-stopping** (Late): Use `interrupt()` and handle `InterruptedException` properly — either re-throw it or restore the interrupt flag. Swallowing the exception silently breaks the cooperative cancellation contract.
---
## 【Reading Tips】
- **Skim the first 10%** if you already know Android 5.0 features — the Notification and App Links sections are mostly historical context. Focus instead on the RecyclerView waterfall pattern, which is still widely used.
- **Deep-read the event dispatch section (~32%)** — it's the hardest part of the book but the most valuable. Trace the source code yourself alongside the text; the `mFirstTouchTarget` logic is subtle and worth understanding fully.
- **The View workflow section (~39%) is reference material** — don't memorize the draw pipeline. Instead, bookmark the MeasureSpec handling patterns and the custom attribute recipe; you'll consult them when building custom Views.
- **Code along with the Design Support Library chapter** — these are hands-on recipes (login screen, drawer menu, collapsing toolbar). Build each one in a scratch project to internalize the XML + Java pairing.
- **If you're here for multithreading only**, jump to the Late section (~48%) — but note the excerpts only cover thread basics (creation, interruption, termination), not advanced concurrency utilities.
---
## 【Coverage Limits】
This guide covers the sampled excerpts (roughly the first half of the book): Android 5.0/6.0 features, Material Design components, View system internals, custom View development, and the start of multithreading. Later chapters on advanced concurrency, performance optimization, and architecture patterns are not covered by the available material.
---
##
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Android进阶之光 (刘望舒)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Android进阶之光 (刘望舒)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Android进阶之光 (刘望舒)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment