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

Commit 9ab43772 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding support for using themed icons on workspace

Bug: 183641907
Test: Manual

Change-Id: Ieda7e73b3ae4dfe3009e3f23754aff5f8826a967
parent 0a1b030b
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -20,9 +20,7 @@ import static com.android.quickstep.interaction.TutorialController.TutorialType.
import static com.android.quickstep.interaction.TutorialController.TutorialType.RIGHT_EDGE_BACK_NAVIGATION;
import static com.android.quickstep.interaction.TutorialController.TutorialType.RIGHT_EDGE_BACK_NAVIGATION;


import android.graphics.PointF;
import android.graphics.PointF;
import android.view.View;


import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.content.res.AppCompatResources;


import com.android.launcher3.R;
import com.android.launcher3.R;
@@ -36,11 +34,6 @@ final class BackGestureTutorialController extends TutorialController {
        super(fragment, tutorialType);
        super(fragment, tutorialType);
    }
    }


    @Nullable
    public View getMockLauncherView() {
        return null;
    }

    @Override
    @Override
    public Integer getIntroductionTitle() {
    public Integer getIntroductionTitle() {
        return mTutorialType == LEFT_EDGE_BACK_NAVIGATION
        return mTutorialType == LEFT_EDGE_BACK_NAVIGATION
+0 −10
Original line number Original line Diff line number Diff line
@@ -16,15 +16,11 @@
package com.android.quickstep.interaction;
package com.android.quickstep.interaction;


import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.quickstep.interaction.TutorialController.TutorialType.OVERVIEW_NAVIGATION_COMPLETE;


import android.animation.AnimatorSet;
import android.animation.AnimatorSet;
import android.annotation.TargetApi;
import android.annotation.TargetApi;
import android.graphics.PointF;
import android.graphics.PointF;
import android.os.Build;
import android.os.Build;
import android.view.View;

import androidx.annotation.Nullable;


import com.android.launcher3.R;
import com.android.launcher3.R;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.PendingAnimation;
@@ -52,12 +48,6 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
        return R.string.overview_gesture_intro_subtitle;
        return R.string.overview_gesture_intro_subtitle;
    }
    }


    @Nullable
    @Override
    public View getMockLauncherView() {
        return null;
    }

    @Override
    @Override
    public void onBackGestureAttempted(BackGestureResult result) {
    public void onBackGestureAttempted(BackGestureResult result) {
        switch (mTutorialType) {
        switch (mTutorialType) {
+0 −44
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2020 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.
 */
package com.android.quickstep.interaction;

import android.content.Context;
import android.view.View;

import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.graphics.LauncherPreviewRenderer;

/** Renders a fake Launcher for use in the Sandbox. */
class SandboxLauncherRenderer extends LauncherPreviewRenderer {
    SandboxLauncherRenderer(Context context, InvariantDeviceProfile idp, boolean migrated) {
        super(context, idp, migrated);
    }

    @Override
    public boolean shouldShowRealLauncherPreview() {
        return false;
    }

    @Override
    public boolean shouldShowQsb() {
        return false;
    }

    @Override
    public View.OnLongClickListener getWorkspaceChildOnLongClickListener() {
        return null;
    }
}
+0 −8
Original line number Original line Diff line number Diff line
@@ -37,7 +37,6 @@ import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.content.res.AppCompatResources;


import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.views.ClipIconView;
import com.android.launcher3.views.ClipIconView;
@@ -129,13 +128,6 @@ abstract class TutorialController implements BackGestureAttemptCallback,
        return R.drawable.default_sandbox_app_previous_task_thumbnail;
        return R.drawable.default_sandbox_app_previous_task_thumbnail;
    }
    }


    @Nullable
    public View getMockLauncherView() {
        InvariantDeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(mContext);

        return new SandboxLauncherRenderer(mContext, dp, true).getRenderedView();
    }

    @DrawableRes
    @DrawableRes
    public int getMockAppIconResId() {
    public int getMockAppIconResId() {
        return R.drawable.default_sandbox_app_icon;
        return R.drawable.default_sandbox_app_icon;
+2 −1
Original line number Original line Diff line number Diff line
@@ -317,7 +317,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,


    @UiThread
    @UiThread
    protected void applyIconAndLabel(ItemInfoWithIcon info) {
    protected void applyIconAndLabel(ItemInfoWithIcon info) {
        FastBitmapDrawable iconDrawable = info.newIcon(getContext());
        boolean useTheme = mDisplay == DISPLAY_WORKSPACE || mDisplay == DISPLAY_FOLDER;
        FastBitmapDrawable iconDrawable = info.newIcon(getContext(), useTheme);
        mDotParams.color = IconPalette.getMutedColor(info.bitmap.color, 0.54f);
        mDotParams.color = IconPalette.getMutedColor(info.bitmap.color, 0.54f);


        setIcon(iconDrawable);
        setIcon(iconDrawable);
Loading