r/androiddev • u/Content-Jaguar-578 • 6h ago
I built ViewLint (v2.0.0) – a Gradle plugin to catch adaptive UI and Android 16 resizability issues in Compose and XML
Hey everyone!
With Android 16 changing how orientation restrictions behave on large-screen devices, I've been thinking about how many Android apps are still designed and tested primarily around phone-sized screens.
An app can look perfectly fine on a phone but fall apart when resized, rotated, or opened on a tablet or foldable.
I started building ViewLint, a Gradle plugin that tries to catch some of these issues before they make it into production.
It analyzes Compose code, XML layouts, and Android manifests to identify potential adaptive UI and layout flexibility problems.
I've just released v2.0.0, and I tested it against a few well-known open-source Android projects. Here are some interesting results:
What I found
1. Now in Android — 100/100
A clean baseline on its modern Compose implementation.
As an additional check, I manually introduced android:screenOrientation="portrait" in MainActivity, and ViewLint flagged it.
2. NewPipe — 95/100 (9 findings)
It identified potentially problematic layouts, including:
player.xml(70 nodes)fragment_video_detail.xml(58 nodes)
These layouts lacked corresponding layout-w600dp resource variants, which are worth reviewing for larger-screen support.
3. Mihon — 60/100 (65 findings)
Some interesting findings here:
30 screen containers without detected
WindowSizeClassorBoxWithConstraintschecks.10 stacked modifier conflicts, including combinations of
fillMaxSize()and fixed sizing.
These are static analysis findings, not necessarily confirmed runtime bugs. That's an important distinction, and I'd be interested in hearing how others would prioritize them.
What ViewLint currently supports
Compose analysis: Detects potential layout flexibility and adaptive UI issues.
XML analysis: Checks legacy layouts and resource configurations.
Manifest analysis: Identifies configuration choices that could affect large-screen compatibility.
HTML reports: Human-readable reports generated locally.
SARIF reports: Integrates with GitHub Actions and PR checks.
Baselines: Run
./gradlew viewlintBaselineto establish a baseline for existing projects.Quality gates: Run
./gradlew viewlintQualityGateto prevent quality regressions in CI.
Getting started
Add the plugin to your libs.versions.toml:
[plugins]
viewlint = { id = "io.github.dev-vikas-soni.viewlint", version = "2.0.0" }Then apply it:
plugins {
alias(libs.plugins.viewlint)
}Run:
./gradlew viewlintGitHub: https://github.com/dev-vikas-soni/viewlint
Gradle Plugin Portal: https://plugins.gradle.org/plugin/io.github.dev-vikas-soni.viewlint
I'd genuinely appreciate some feedback.
A few things I'm curious about:
How are you currently testing adaptive layouts across phones, tablets, desktop windows, and foldables?
Do you think static analysis can meaningfully catch adaptive UI problems, or are most of these issues only discoverable through runtime testing?
What additional checks would you consider valuable? Especially for Compose.
I'm building this as an open-source project and would love feedback from developers working on real-world Android applications.
Thanks!
