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

Commit 560b0eac authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Implement All Apps Icon upto the visual Specs.

Test: Visual
Bug: 267382941

Change-Id: If675c2f4767014598b23d8a2c2e684f5a8fb4f19
parent 73a2334f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -21,5 +21,4 @@
    android:layout_height="@dimen/taskbar_icon_min_touch_size"
    android:contentDescription="@string/all_apps_button_label"
    android:backgroundTint="@android:color/transparent"
    android:icon="@drawable/ic_all_apps_button"
    />
+3 −0
Original line number Diff line number Diff line
@@ -286,6 +286,8 @@
    <dimen name="taskbar_back_button_left_margin_kids">48dp</dimen>
    <dimen name="taskbar_home_button_left_margin_kids">48dp</dimen>
    <dimen name="taskbar_icon_size_kids">32dp</dimen>
    <dimen name="taskbar_all_apps_button_translation_x_offset">6dp</dimen>


    <!-- Transient taskbar -->
    <dimen name="transient_taskbar_size">72dp</dimen>
@@ -295,6 +297,7 @@
    <dimen name="transient_taskbar_shadow_blur">40dp</dimen>
    <dimen name="transient_taskbar_key_shadow_distance">10dp</dimen>
    <dimen name="transient_taskbar_stashed_size">32dp</dimen>
    <dimen name="transient_taskbar_all_apps_button_translation_x_offset">4dp</dimen>
    <!-- An additional touch slop to prevent x-axis movement during the swipe up to show taskbar -->
    <dimen name="transient_taskbar_clamped_offset_bound">16dp</dimen>
    <!-- Taskbar swipe up thresholds -->
+14 −2
Original line number Diff line number Diff line
@@ -89,6 +89,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar

    private float mTransientTaskbarMinWidth;

    private float mTransientTaskbarAllAppsButtonTranslationXOffset;

    public TaskbarView(@NonNull Context context) {
        this(context, null);
    }
@@ -108,9 +110,14 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        mActivityContext = ActivityContext.lookupContext(context);
        mIconLayoutBounds = mActivityContext.getTransientTaskbarBounds();
        Resources resources = getResources();
        boolean isTransientTaskbar = DisplayController.isTransientTaskbar(mActivityContext);
        mIsRtl = Utilities.isRtl(resources);
        mTransientTaskbarMinWidth = mContext.getResources().getDimension(
                R.dimen.transient_taskbar_min_width);
        mTransientTaskbarAllAppsButtonTranslationXOffset =
                resources.getDimension(isTransientTaskbar
                        ? R.dimen.transient_taskbar_all_apps_button_translation_x_offset
                        : R.dimen.taskbar_all_apps_button_translation_x_offset);

        int actualMargin = resources.getDimensionPixelSize(R.dimen.taskbar_icon_spacing);
        int actualIconSize = mActivityContext.getDeviceProfile().iconSizePx;
@@ -130,9 +137,12 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        if (!mActivityContext.getPackageManager().hasSystemFeature(FEATURE_PC)) {
            mAllAppsButton = (IconButtonView) LayoutInflater.from(context)
                    .inflate(R.layout.taskbar_all_apps_button, this, false);
            mAllAppsButton.setIconDrawable(resources.getDrawable(isTransientTaskbar
                    ? R.drawable.ic_transient_taskbar_all_apps_button
                    : R.drawable.ic_taskbar_all_apps_button));
            mAllAppsButton.setScaleX(mIsRtl ? -1 : 1);
            mAllAppsButton.setForegroundTint(mActivityContext.getColor(
                    DisplayController.isTransientTaskbar(mActivityContext)
            mAllAppsButton.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding);
            mAllAppsButton.setForegroundTint(mActivityContext.getColor(isTransientTaskbar
                            ? R.color.all_apps_button_color
                            : R.color.all_apps_button_color_dark));

@@ -276,6 +286,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        }

        if (mAllAppsButton != null) {
            mAllAppsButton.setTranslationXForTaskbarAllAppsIcon(getChildCount() > 0
                    ? mTransientTaskbarAllAppsButtonTranslationXOffset : 0f);
            addView(mAllAppsButton, mIsRtl ? getChildCount() : 0);

            // if only all apps button present, don't include divider view.
+48 −0
Original line number Diff line number Diff line
<?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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="48dp"
    android:height="48dp"
    android:viewportWidth="48"
    android:viewportHeight="48">
  <path
      android:pathData="M13.5,17C12.538,17 11.715,16.65 11.033,15.967C10.35,15.285 10,14.462 10,13.5C10,12.538 10.35,11.715 11.033,11.033C11.715,10.35 12.538,10 13.5,10C14.462,10 15.285,10.35 15.967,11.033C16.65,11.715 17,12.538 17,13.5C17,14.462 16.65,15.285 15.967,15.967C15.285,16.65 14.462,17 13.5,17Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M24,17C23.038,17 22.215,16.65 21.532,15.967C20.85,15.285 20.5,14.462 20.5,13.5C20.5,12.538 20.85,11.715 21.532,11.033C22.215,10.35 23.038,10 24,10C24.962,10 25.785,10.35 26.468,11.033C27.15,11.715 27.5,12.538 27.5,13.5C27.5,14.462 27.15,15.285 26.468,15.967C25.785,16.65 24.962,17 24,17Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M34.5,17C33.537,17 32.715,16.65 32.033,15.967C31.35,15.285 31,14.462 31,13.5C31,12.538 31.35,11.715 32.033,11.033C32.715,10.35 33.537,10 34.5,10C35.463,10 36.285,10.35 36.967,11.033C37.65,11.715 38,12.538 38,13.5C38,14.462 37.65,15.285 36.967,15.967C36.285,16.65 35.463,17 34.5,17Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M13.5,27.5C12.538,27.5 11.715,27.15 11.033,26.468C10.35,25.785 10,24.962 10,24C10,23.038 10.35,22.215 11.033,21.532C11.715,20.85 12.538,20.5 13.5,20.5C14.462,20.5 15.285,20.85 15.967,21.532C16.65,22.215 17,23.038 17,24C17,24.962 16.65,25.785 15.967,26.468C15.285,27.15 14.462,27.5 13.5,27.5Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M24,27.5C23.038,27.5 22.215,27.15 21.532,26.468C20.85,25.785 20.5,24.962 20.5,24C20.5,23.038 20.85,22.215 21.532,21.532C22.215,20.85 23.038,20.5 24,20.5C24.962,20.5 25.785,20.85 26.468,21.532C27.15,22.215 27.5,23.038 27.5,24C27.5,24.962 27.15,25.785 26.468,26.468C25.785,27.15 24.962,27.5 24,27.5Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M34.5,27.5C33.537,27.5 32.715,27.15 32.033,26.468C31.35,25.785 31,24.962 31,24C31,23.038 31.35,22.215 32.033,21.532C32.715,20.85 33.537,20.5 34.5,20.5C35.463,20.5 36.285,20.85 36.967,21.532C37.65,22.215 38,23.038 38,24C38,24.962 37.65,25.785 36.967,26.468C36.285,27.15 35.463,27.5 34.5,27.5Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M13.5,38C12.538,38 11.715,37.65 11.033,36.967C10.35,36.285 10,35.463 10,34.5C10,33.537 10.35,32.715 11.033,32.033C11.715,31.35 12.538,31 13.5,31C14.462,31 15.285,31.35 15.967,32.033C16.65,32.715 17,33.537 17,34.5C17,35.463 16.65,36.285 15.967,36.967C15.285,37.65 14.462,38 13.5,38Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M24,38C23.038,38 22.215,37.65 21.532,36.967C20.85,36.285 20.5,35.463 20.5,34.5C20.5,33.537 20.85,32.715 21.532,32.033C22.215,31.35 23.038,31 24,31C24.962,31 25.785,31.35 26.468,32.033C27.15,32.715 27.5,33.537 27.5,34.5C27.5,35.463 27.15,36.285 26.468,36.967C25.785,37.65 24.962,38 24,38Z"
      android:fillColor="#40484B"/>
  <path
      android:pathData="M34.5,38C33.537,38 32.715,37.65 32.033,36.967C31.35,36.285 31,35.463 31,34.5C31,33.537 31.35,32.715 32.033,32.033C32.715,31.35 33.537,31 34.5,31C35.463,31 36.285,31.35 36.967,32.033C37.65,32.715 38,33.537 38,34.5C38,35.463 37.65,36.285 36.967,36.967C36.285,37.65 35.463,38 34.5,38Z"
      android:fillColor="#40484B"/>
</vector>
Loading