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

Commit 9d60a18c authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

Only have private space drawable section for beginning of private space...

Only have private space drawable section for beginning of private space section and keep letters for everything else.

spec: https://www.figma.com/design/uMzPkNMZpb7EyfHDo8usIa/V-%E2%80%A2-Toast-Butter?node-id=2746-180205&node-type=frame&m=dev
As of recent request: Only using the bubble background for everything and have private space go back to using letters.

Will include divider in followup.

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

Change-Id: I30487581eec4bd3e1921de4e3d899cfe2e2a703f
parent e710e70b
Loading
Loading
Loading
Loading
+28 −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="12dp"
    android:height="15dp"
    android:viewportWidth="12"
    android:viewportHeight="15">
    <path
        android:pathData="M5.952,0.911L0.645,2.902V6.942C0.645,10.292 2.907,13.417 5.952,14.18C8.997,13.417 11.26,10.292 11.26,6.942V2.902L5.952,0.911ZM7.943,9.536V10.863H6.616V11.526H5.289V8.103C4.333,7.818 3.63,6.942 3.63,5.887C3.63,4.607 4.672,3.565 5.952,3.565C7.233,3.565 8.274,4.607 8.274,5.887C8.274,6.935 7.571,7.818 6.616,8.103V9.536H7.943Z"
        android:fillColor="#3C4043"
        android:fillType="evenOdd"/>
    <path
        android:pathData="M5.952,6.882C6.502,6.882 6.947,6.436 6.947,5.887C6.947,5.337 6.502,4.892 5.952,4.892C5.403,4.892 4.957,5.337 4.957,5.887C4.957,6.436 5.403,6.882 5.952,6.882Z"
        android:fillColor="#3C4043"/>
</vector>
+1 −6
Original line number Diff line number Diff line
@@ -346,17 +346,12 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
                    (LetterListTextView) LayoutInflater.from(context).inflate(
                            R.layout.fast_scroller_letter_list_text_view, mLetterList, false);
            int viewId = View.generateViewId();
            textView.setId(viewId);
            textView.apply(sectionInfo /* FastScrollSectionInfo */, viewId /* viewId */);
            sectionInfo.setId(viewId);
            textView.setText(sectionInfo.sectionName);
            if (i == fastScrollSections.size() - 1) {
                // The last section info is just a duplicate so that user can scroll to the bottom.
                textView.setVisibility(INVISIBLE);
            }
            ConstraintLayout.LayoutParams lp = new ConstraintLayout.LayoutParams(
                    MATCH_CONSTRAINT, WRAP_CONTENT);
            lp.dimensionRatio = "v,1:1";
            textView.setLayoutParams(lp);
            textViews.add(textView);
            mLetterList.addView(textView);
        }
+7 −3
Original line number Diff line number Diff line
@@ -124,7 +124,8 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
            mAllAppsStore.addUpdateListener(this);
        }
        mPrivateProfileAppScrollerBadge = new SpannableString(" ");
        mPrivateProfileAppScrollerBadge.setSpan(new ImageSpan(context,
        mPrivateProfileAppScrollerBadge.setSpan(new ImageSpan(context, Flags.letterFastScroller()
                        ? 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);
    }
@@ -437,8 +438,11 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
                Log.d(TAG, "addAppsWithSections: adding sectionName: " + sectionName
                    + " with appInfoTitle: " + info.title);
                lastSectionName = sectionName;
                mFastScrollerSections.add(new FastScrollSectionInfo(hasPrivateApps ?
                        mPrivateProfileAppScrollerBadge : sectionName, position));
                boolean usePrivateAppScrollerBadge = !Flags.letterFastScroller() && hasPrivateApps;
                FastScrollSectionInfo sectionInfo = new FastScrollSectionInfo(
                        usePrivateAppScrollerBadge ?
                                mPrivateProfileAppScrollerBadge : sectionName, position);
                mFastScrollerSections.add(sectionInfo);
            }
            position++;
        }
+18 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.launcher3.allapps;

import static androidx.constraintlayout.widget.ConstraintSet.MATCH_CONSTRAINT;
import static androidx.constraintlayout.widget.ConstraintSet.WRAP_CONTENT;

import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
@@ -23,6 +26,7 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.TextView;

import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.graphics.ColorUtils;

import com.android.launcher3.R;
@@ -70,6 +74,20 @@ public class LetterListTextView extends TextView {
        setVisibility(VISIBLE);
    }

    /**
     * Applies a viewId to the letter list text view and sets the background and text based on the
     * sectionInfo.
     */
    public void apply(AlphabeticalAppsList.FastScrollSectionInfo fastScrollSectionInfo,
            int viewId) {
        setId(viewId);
        setText(fastScrollSectionInfo.sectionName);
        ConstraintLayout.LayoutParams lp = new ConstraintLayout.LayoutParams(
                MATCH_CONSTRAINT, WRAP_CONTENT);
        lp.dimensionRatio = "v,1:1";
        setLayoutParams(lp);
    }

    /**
     * Animates the letter list text view based on the current finger position.
     *