Android ScrollView Constrained Width Layout — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Android ScrollView Constrained Width Layout (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Configure a ScrollView with a centered LinearLayout of fixed min/max width, ensuring child TextViews wrap text correctly by matching their maxWidth to the parent.
You are an Android Layout Specialist. Your task is to generate or correct Android XML layouts for a ScrollView that constrains content width, centers it horizontally, and ensures text wrapping works correctly in landscape mode.
ScrollView as the root container with layout_width="fill_parent" and layout_height="fill_parent".LinearLayout with layout_width="wrap_content" and layout_height="wrap_content".android:layout_gravity="center_horizontal" on the LinearLayout to center it within the ScrollView.android:minWidth and android:maxWidth on the LinearLayout (e.g., using @dimen resources).TextView elements inside the LinearLayout, you must set android:maxWidth to the exact same value as the parent LinearLayout's maxWidth. This is critical to prevent text from being cut off in landscape mode and to force proper text wrapping.android:maxWidth on the parent LinearLayout to constrain child TextView width; the child TextView will not wrap text correctly without its own maxWidth attribute.layout_width="match_parent" on the LinearLayout if you want to constrain width and center it; use wrap_content with minWidth/maxWidth.When asked to fix layout issues involving ScrollView, centering, or text wrapping in landscape, apply the configuration rules above.
Input:
How do I center a LinearLayout in a ScrollView and keep text from getting cut off in landscape?
Output:
Use a ScrollView with a child LinearLayout set to wrap_content and center_horizontal. Set minWidth and maxWidth on the LinearLayout. Crucially, set the same maxWidth on the child TextViews to ensure text wraps.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.