Files
lawnchair/tests/res/xml/invalid_cell_specs_4.xml
Toni Barzic 83b8cc19ca Support workspace cells with two-line labels
Adds `maxLineCount` attribute to CellSpec. The attribute indicates the max
number of lines of text the cell was speced to support. It's used to:
*   enable two-line labels in `BubbleTextViews` for workspace (including
    folder children) items
*   Update cell dimension calculation to inform cell vertical padding

When calculating cell content size the icon text size will be included
`maxLineCount` times, so the cell content gets centered as if it
contains `maxLineCount` lines of text. That way the icon position will
be consistent between cells with text that fits into one line, and cells
that contain two lines of text.

Adds `maxLineCountMatchesWorkspace` attribute to specify that the cell
should inherit `maxLineCount` from workspace cell spec.

Bug: 30153091
Flag: com.android.launcher3.enable_scalability_for_desktop_experience
Test: Manual

Change-Id: I150a62f427a0ad755a4746a736d9846d3bea4d2e
2025-05-21 22:04:33 +00:00

41 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2025 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!-- invalid: total fixedSize > maxAvailableSize -->
<cellSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto">
<!-- portrait -->
<specs launcher:maxAspectRatio="1.0">
<cellSpec
launcher:dimensionType="height"
launcher:maxAvailableSize="9999dp"
launcher:maxLineCount="2">
<iconDrawablePadding launcher:ofAvailableSpace="0.0125" />
<iconSize launcher:fixedSize="48dp" />
<iconTextSize launcher:fixedSize="12sp" />
</cellSpec>
</specs>
<!-- landscape -->
<specs launcher:maxAspectRatio="10">
<cellSpec
launcher:dimensionType="height"
launcher:maxAvailableSize="88dp"
launcher:maxLineCount="2">
<iconDrawablePadding launcher:fixedSize="12dp" />
<iconSize launcher:ofAvailableSpace="48" />
<iconTextSize launcher:fixedSize="16dp" />
</cellSpec>
</specs>
</cellSpecs>