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

Commit b177185a authored by Miranda Kephart's avatar Miranda Kephart Committed by Android (Google) Code Review
Browse files

Merge "Remove obsolete ChipsContainer" into ub-launcher3-qt-dev

parents 6b310123 bbc2b688
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 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.
-->
<com.android.quickstep.hints.ChipsContainer
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/chip_hint_height"
    android:layout_gravity="bottom"
    android:gravity="center_horizontal"
    android:orientation="horizontal"/>
 No newline at end of file
+0 −5
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@ public final class RecentsViewStateController extends
        if (state.overviewUi) {
            mRecentsView.updateEmptyMessage();
            mRecentsView.resetTaskVisuals();
            mRecentsView.setHintVisibility(1);
        } else {
            mRecentsView.setHintVisibility(0);
        }
    }

@@ -62,7 +59,6 @@ public final class RecentsViewStateController extends

        if (!toState.overviewUi) {
            builder.addOnFinishRunnable(mRecentsView::resetTaskVisuals);
            mRecentsView.setHintVisibility(0);
        }

        if (toState.overviewUi) {
@@ -74,7 +70,6 @@ public final class RecentsViewStateController extends
            updateAnim.setDuration(config.duration);
            builder.play(updateAnim);
            mRecentsView.updateEmptyMessage();
            builder.addOnFinishRunnable(() -> mRecentsView.setHintVisibility(1));
        }
    }

+0 −72
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 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.hints;

import android.content.Context;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.view.View;
import android.widget.FrameLayout;

public class ChipsContainer extends FrameLayout {

    private static final String TAG = "ChipsContainer";

    public static final FloatProperty<ChipsContainer> HINT_VISIBILITY =
            new FloatProperty<ChipsContainer>("hint_visibility") {
                @Override
                public void setValue(ChipsContainer chipsContainer, float v) {
                    chipsContainer.setHintVisibility(v);
                }

                @Override
                public Float get(ChipsContainer chipsContainer) {
                    return chipsContainer.mHintVisibility;
                }
            };

    private float mHintVisibility;

    public ChipsContainer(Context context) {
        super(context);
    }

    public ChipsContainer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ChipsContainer(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public ChipsContainer(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public void setView(View v) {
        removeAllViews();
        addView(v);
    }

    public void setHintVisibility(float v) {
        if (v == 1) {
            setVisibility(VISIBLE);
        } else {
            setVisibility(GONE);
        }
        mHintVisibility = v;
    }
}
+0 −52
Original line number Diff line number Diff line
@@ -39,11 +39,9 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.util.PendingAnimation;
import com.android.launcher3.views.BaseDragLayer;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.hints.ChipsContainer;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.ClipAnimationHelper.TransformParams;
import com.android.quickstep.util.LayoutUtils;
@@ -55,7 +53,6 @@ import com.android.quickstep.util.LayoutUtils;
public class LauncherRecentsView extends RecentsView<Launcher> {

    private final TransformParams mTransformParams = new TransformParams();
    private ChipsContainer mChipsContainer;

    public LauncherRecentsView(Context context) {
        this(context, null);
@@ -75,14 +72,6 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
        mActivity.getStateManager().goToState(NORMAL);
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        mChipsContainer = mActivity.findViewById(R.id.hints);
        BaseDragLayer.LayoutParams params = (BaseDragLayer.LayoutParams) mChipsContainer.getLayoutParams();
        params.bottomMargin = mActivity.getDeviceProfile().chipHintBottomMarginPx;
    }

    @Override
    public void setTranslationY(float translationY) {
        super.setTranslationY(translationY);
@@ -94,16 +83,6 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
        }
    }

    public void setHintVisibility(float v) {
        if (mChipsContainer != null && ENABLE_HINTS_IN_OVERVIEW.get()) {
            mChipsContainer.setHintVisibility(v);
        }
    }

    public ChipsContainer getChipsContainer() {
        return mChipsContainer;
    }

    @Override
    public void draw(Canvas canvas) {
        maybeDrawEmptyMessage(canvas);
@@ -154,37 +133,6 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
        return anim;
    }

    @Override
    public PendingAnimation createTaskLauncherAnimation(TaskView tv, long duration) {
        PendingAnimation anim = super.createTaskLauncherAnimation(tv, duration);

        if (ENABLE_HINTS_IN_OVERVIEW.get()) {
            anim.anim.play(ObjectAnimator.ofFloat(
                    mChipsContainer, ChipsContainer.HINT_VISIBILITY, 0));
        }

        return anim;
    }

    @Override
    public PendingAnimation createTaskDismissAnimation(TaskView taskView, boolean animateTaskView,
            boolean shouldRemoveTask, long duration) {
        PendingAnimation anim = super.createTaskDismissAnimation(taskView, animateTaskView,
                shouldRemoveTask, duration);

        if (ENABLE_HINTS_IN_OVERVIEW.get()) {
            anim.anim.play(ObjectAnimator.ofFloat(
                    mChipsContainer, ChipsContainer.HINT_VISIBILITY, 0));
            anim.addEndListener(onEndListener -> {
                if (!onEndListener.isSuccess) {
                    mChipsContainer.setHintVisibility(1);
                }
            });
        }

        return anim;
    }

    @Override
    protected void getTaskSize(DeviceProfile dp, Rect outRect) {
        LayoutUtils.calculateLauncherTaskSize(getContext(), dp, outRect);

res/layout/hint_container.xml

deleted100644 → 0
+0 −17
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 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.
-->
<merge/>
 No newline at end of file
Loading