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

Commit b6788a67 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [19432064, 19432065] into tm-release.

Change-Id: I8a9ecd80650fbc5de83b7d6d04e10ad729fd8f6c
parents 755f9c70 b2b614e1
Loading
Loading
Loading
Loading
+0 −8
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@ import static com.android.launcher3.util.OnboardingPrefs.ALL_APPS_VISITED_COUNT;
import android.annotation.TargetApi;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Build;
import android.text.Layout;
import android.text.Layout;
@@ -33,7 +32,6 @@ import android.view.View;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorInt;
import androidx.core.content.ContextCompat;
import androidx.core.content.ContextCompat;


import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.R;
import com.android.launcher3.allapps.FloatingHeaderRow;
import com.android.launcher3.allapps.FloatingHeaderRow;
import com.android.launcher3.allapps.FloatingHeaderView;
import com.android.launcher3.allapps.FloatingHeaderView;
@@ -238,12 +236,6 @@ public class AppsDividerView extends View implements FloatingHeaderRow {
                getPaddingBottom() + getPaddingTop());
                getPaddingBottom() + getPaddingTop());
    }
    }


    @Override
    public void setInsets(Rect insets, DeviceProfile grid) {
        int leftRightPadding = grid.allAppsLeftRightPadding;
        setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom());
    }

    @Override
    @Override
    public void setVerticalScroll(int scroll, boolean isScrolledOut) {
    public void setVerticalScroll(int scroll, boolean isScrolledOut) {
        setTranslationY(scroll);
        setTranslationY(scroll);
+0 −7
Original line number Original line Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.launcher3.appprediction;
import android.annotation.TargetApi;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Build;
import android.os.Build;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.LayoutInflater;
@@ -251,12 +250,6 @@ public class PredictionRowView<T extends Context & ActivityContext & DeviceProfi
        }
        }
    }
    }


    @Override
    public void setInsets(Rect insets, DeviceProfile grid) {
        int leftRightPadding = grid.allAppsLeftRightPadding;
        setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom());
    }

    @Override
    @Override
    public Class<PredictionRowView> getTypeClass() {
    public Class<PredictionRowView> getTypeClass() {
        return PredictionRowView.class;
        return PredictionRowView.class;
+0 −5
Original line number Original line Diff line number Diff line
@@ -15,11 +15,8 @@
 */
 */
package com.android.launcher3.allapps;
package com.android.launcher3.allapps;


import android.graphics.Rect;
import android.view.View;
import android.view.View;


import com.android.launcher3.DeviceProfile;

/**
/**
 * A abstract representation of a row in all-apps view
 * A abstract representation of a row in all-apps view
 */
 */
@@ -29,8 +26,6 @@ public interface FloatingHeaderRow {


    void setup(FloatingHeaderView parent, FloatingHeaderRow[] allRows, boolean tabsHidden);
    void setup(FloatingHeaderView parent, FloatingHeaderRow[] allRows, boolean tabsHidden);


    void setInsets(Rect insets, DeviceProfile grid);

    int getExpectedHeight();
    int getExpectedHeight();


    /**
    /**
+3 −30
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;


import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.R;
import com.android.launcher3.allapps.BaseAllAppsContainerView.AdapterHolder;
import com.android.launcher3.allapps.BaseAllAppsContainerView.AdapterHolder;
@@ -158,22 +157,6 @@ public class FloatingHeaderView extends LinearLayout implements
        PluginManagerWrapper.INSTANCE.get(getContext()).removePluginListener(this);
        PluginManagerWrapper.INSTANCE.get(getContext()).removePluginListener(this);
    }
    }


    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        mTabLayout.getLayoutParams().width = getTabWidth();
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    /**
     * Returns distance between left and right app icons
     */
    public int getTabWidth() {
        DeviceProfile grid = ActivityContext.lookupContext(getContext()).getDeviceProfile();
        int totalWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight();
        int iconPadding = totalWidth / grid.numShownAllAppsColumns - grid.allAppsIconSizePx;
        return totalWidth - iconPadding - grid.allAppsIconDrawablePaddingPx;
    }

    private void recreateAllRowsArray() {
    private void recreateAllRowsArray() {
        int pluginCount = mPluginRows.size();
        int pluginCount = mPluginRows.size();
        if (pluginCount == 0) {
        if (pluginCount == 0) {
@@ -423,15 +406,6 @@ public class FloatingHeaderView extends LinearLayout implements
        p.y = getTop() - mCurrentRV.getTop() - ((ViewGroup) mCurrentRV.getParent()).getTop();
        p.y = getTop() - mCurrentRV.getTop() - ((ViewGroup) mCurrentRV.getParent()).getTop();
    }
    }


    public boolean hasVisibleContent() {
        for (FloatingHeaderRow row : mAllRows) {
            if (row.hasVisibleContent()) {
                return true;
            }
        }
        return false;
    }

    public boolean isHeaderProtectionSupported() {
    public boolean isHeaderProtectionSupported() {
        return mHeaderProtectionSupported;
        return mHeaderProtectionSupported;
    }
    }
@@ -443,10 +417,9 @@ public class FloatingHeaderView extends LinearLayout implements


    @Override
    @Override
    public void setInsets(Rect insets) {
    public void setInsets(Rect insets) {
        DeviceProfile grid = ActivityContext.lookupContext(getContext()).getDeviceProfile();
        int leftRightPadding = ActivityContext.lookupContext(getContext())
        for (FloatingHeaderRow row : mAllRows) {
                .getDeviceProfile().allAppsLeftRightPadding;
            row.setInsets(insets, grid);
        setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom());
        }
    }
    }


    public <T extends FloatingHeaderRow> T findFixedRowByType(Class<T> type) {
    public <T extends FloatingHeaderRow> T findFixedRowByType(Class<T> type) {
+0 −5
Original line number Original line Diff line number Diff line
@@ -18,10 +18,8 @@ package com.android.launcher3.allapps;
import static android.view.View.INVISIBLE;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static android.view.View.VISIBLE;


import android.graphics.Rect;
import android.view.View;
import android.view.View;


import com.android.launcher3.DeviceProfile;
import com.android.systemui.plugins.AllAppsRow;
import com.android.systemui.plugins.AllAppsRow;


/**
/**
@@ -42,9 +40,6 @@ public class PluginHeaderRow implements FloatingHeaderRow {
    public void setup(FloatingHeaderView parent, FloatingHeaderRow[] allRows,
    public void setup(FloatingHeaderView parent, FloatingHeaderRow[] allRows,
            boolean tabsHidden) { }
            boolean tabsHidden) { }


    @Override
    public void setInsets(Rect insets, DeviceProfile grid) { }

    @Override
    @Override
    public int getExpectedHeight() {
    public int getExpectedHeight() {
        return mPlugin.getExpectedHeight();
        return mPlugin.getExpectedHeight();
Loading