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

Commit c9ac51c5 authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

Add spannedDrawable for the divider in the letter fastScroller.

Divider exported from: https://www.figma.com/design/uMzPkNMZpb7EyfHDo8usIa/V-%E2%80%A2-Toast-Butter?node-id=2751-194737&node-type=frame&m=dev

bug:358673724
Test photo: https://drive.google.com/file/d/1I_Mu7mjxboP3puAJuiA9X9V3ogFR0oin/view?usp=sharing
Flag: com.android.launcher3.letter_fast_scroller

Change-Id: Ica5f05befbd63dc93b9c50bbbd6821cd931d148b
parent 9d60a18c
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2024 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.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20">
    <group>
      <path
          android:pathData="M5,9L15,9A1,1 0,0 1,16 10L16,10A1,1 0,0 1,15 11L5,11A1,1 0,0 1,4 10L4,10A1,1 0,0 1,5 9z"
          android:fillColor="?attr/materialColorOnSurface"/>
    </group>
</vector>
+10 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
    // The of ordered component names as a result of a search query
    private final ArrayList<AdapterItem> mSearchResults = new ArrayList<>();
    private final SpannableString mPrivateProfileAppScrollerBadge;
    private final SpannableString mPrivateProfileDividerBadge;
    private BaseAllAppsAdapter<T> mAdapter;
    private AppInfoComparator mAppNameComparator;
    private int mNumAppsPerRowAllApps;
@@ -128,6 +129,10 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
                        ? R.drawable.ic_private_profile_letter_list_fast_scroller_badge :
                        R.drawable.ic_private_profile_app_scroller_badge, ImageSpan.ALIGN_CENTER),
                0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        mPrivateProfileDividerBadge = new SpannableString(" ");
        mPrivateProfileDividerBadge.setSpan(new ImageSpan(context,
                        R.drawable.ic_private_profile_divider_badge, ImageSpan.ALIGN_CENTER),
                0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    }

    /** Set the number of apps per row when device profile changes. */
@@ -405,6 +410,11 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
        // Add system apps separator.
        if (Flags.privateSpaceSysAppsSeparation()) {
            position = mPrivateProviderManager.addSystemAppsDivider(mAdapterItems);
            if (Flags.letterFastScroller()) {
                FastScrollSectionInfo sectionInfo =
                        new FastScrollSectionInfo(mPrivateProfileDividerBadge, position);
                mFastScrollerSections.add(sectionInfo);
            }
        }
        // Add system apps.
        position = addAppsWithSections(split.get(false), position);