Files
lawnchair/quickstep/res/layout/icon_app_chip_view.xml
Jordan Silva 7e676c6a40 Add marquee for AppChip and simplify text view handling in IconAppChipView
- Consolidates the two TextViews (collapsed and expanded) in `IconAppChipView` into a single `appTitle` TextView.
- Updates the app name's width based on the current chip status (expanded/collapsed)
- Removes the `icon_text_collapsed` and `icon_text_expanded` from layout and uses only `icon_title`.
- Adds marquee support to handle text ellipsis in the collapsed state.
- Refactors text width calculation for collapsed state to take into account maximum available width.
- Updates text animations to use the new `appTitle`.
- Updates the maximum width to not be set to less than the min width.

Bug: 403193877
Flag: com.android.launcher3.enable_overview_icon_menu
Test: OverviewImageTest
Test: OverviewSplitTaskImageTest
Change-Id: Ic82790d0a79b65adb7ba14dad7848748cd568f62
2025-03-25 20:31:28 +00:00

76 lines
3.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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.
-->
<com.android.quickstep.views.IconAppChipView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/icon"
android:layout_width="@dimen/task_thumbnail_icon_menu_expanded_width"
android:layout_height="@dimen/task_thumbnail_icon_menu_expanded_height"
android:clipToOutline="true"
android:focusable="true"
android:focusableInTouchMode="false"
android:importantForAccessibility="no"
android:autoMirrored="true"
android:elevation="@dimen/task_thumbnail_icon_menu_elevation"
android:foreground="@drawable/app_chip_fg"
android:background="@color/materialColorSurfaceBright">
<!-- ignoring warning because the user of the anchor is a Rect where RTL is not needed -->
<!-- This anchor's bounds is in the expected location after rotations and translations are
applied to the parent. The same is not true of the parent so an anchor is used. -->
<!-- marginTop is applied in java to get the gap between chip and menu -->
<View
android:id="@+id/icon_view_menu_anchor"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="left|top"
android:focusable="false"
android:importantForAccessibility="no"
tools:ignore="RtlHardcoded" />
<com.android.quickstep.views.IconView
android:id="@+id/icon_view"
android:layout_width="@dimen/task_thumbnail_icon_menu_app_icon_collapsed_size"
android:layout_height="@dimen/task_thumbnail_icon_menu_app_icon_collapsed_size"
android:focusable="false"
android:importantForAccessibility="no" />
<TextView
android:id="@+id/icon_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="marquee"
android:textAlignment="viewStart"
android:importantForAccessibility="no"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="1"
android:scrollHorizontally="true"
style="@style/IconAppChipMenuTextStyle" />
<ImageView
android:id="@+id/icon_arrow"
android:layout_width="@dimen/task_thumbnail_icon_menu_arrow_size"
android:layout_height="@dimen/task_thumbnail_icon_menu_arrow_size"
android:background="@drawable/icon_menu_arrow_background"
android:src="@drawable/ic_chevron_down"
android:importantForAccessibility="no" />
</com.android.quickstep.views.IconAppChipView>