Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c45020c7 authored by George Lin's avatar George Lin
Browse files

Make sure initial state when secondary screen (2/2)

When the initial state is a secondary screen and the bind is called, we
should make sure the UI is set to the secondary screen before binding
it. This avoids the situation of motion layout transition animation
conflicting with the recycler view items updapte animation.

Test: Manually tested. See bug.
Bug: 412546686
Flag: com.android.systemui.shared.new_customization_picker_ui
Change-Id: Ib157a2ac746fd0440956ca72de17617c99261c60
parent a04e94dc
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -29,6 +29,21 @@
        android:clipToPadding="false"
        android:clipChildren="false">

        <!--
        This is an invisible placeholder put in place so that the parent keeps its height
        stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows
        the layout logic to keep the size of the preview container stable as well, which
        bodes well for setting up the SurfaceView for remote rendering without changing its
        size after the content is loaded into the RecyclerView.

        It's critical for any TextViews inside the included layout to have text.
        -->
        <include
            layout="@layout/quick_affordance_list_item_placeholder"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="invisible" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/quick_affordance_horizontal_list"
            android:layout_width="wrap_content"
+27 −0
Original line number Diff line number Diff line
<?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.
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <include layout="@layout/quick_affordance_list_item2" />

    <View android:layout_width="match_parent" android:layout_height="@dimen/floating_sheet_list_item_vertical_space" />

    <include layout="@layout/quick_affordance_list_item2" />
</LinearLayout>
 No newline at end of file
+12 −9
Original line number Diff line number Diff line
@@ -210,12 +210,15 @@ object ShortcutFloatingSheetBinder {
            layoutManager = GridLayoutManager(context, 2, GridLayoutManager.HORIZONTAL, false)
            addItemDecoration(
                DoubleRowListItemSpacing(
                    edgeItemSpacePx =
                        context.resources.getDimensionPixelSize(
                            R.dimen.floating_sheet_content_horizontal_padding
                        ),
                    itemHorizontalSpacePx =
                        context.resources.getDimensionPixelSize(
                            R.dimen.floating_sheet_list_item_horizontal_space
                        ),
                    itemVerticalSpacePx =
                        context.resources.getDimensionPixelSize(
                            R.dimen.floating_sheet_list_item_vertical_space
                        ),