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

Unverified Commit 3f06fcf6 authored by Michael Bestas's avatar Michael Bestas
Browse files

Revert "Fix spacing and colors related to All Apps header"

It will need to be reimplemented if needed after qpr1

This reverts commit 60af300e.

Change-Id: I8087b7de7edbcbdfb7435a92ed7b71a3382c4b04
parent 76e84fdd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,9 +123,9 @@
    <dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
    <dimen name="all_apps_header_tab_height">48dp</dimen>
    <dimen name="all_apps_tabs_indicator_height">2dp</dimen>
    <dimen name="all_apps_header_top_margin">48dp</dimen>
    <dimen name="all_apps_header_top_margin">33dp</dimen>
    <dimen name="all_apps_header_top_padding">36dp</dimen>
    <dimen name="all_apps_header_bottom_padding">10dp</dimen>
    <dimen name="all_apps_header_bottom_padding">14dp</dimen>
    <dimen name="all_apps_header_top_adjustment">6dp</dimen>
    <dimen name="all_apps_header_bottom_adjustment">4dp</dimen>
    <dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen>
+6 −10
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
    private final int mHeaderProtectionColor;
    protected final float mHeaderThreshold;
    private int mHeaderBottomAdjustment;
    private int mHeaderTopAdjustment;
    private ScrimView mScrimView;
    private int mHeaderColor;
    private int mTabsProtectionAlpha;
@@ -144,8 +143,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
                R.dimen.dynamic_grid_cell_border_spacing);
        mHeaderBottomAdjustment = getResources().getDimensionPixelSize(
                R.dimen.all_apps_header_bottom_adjustment);
        mHeaderTopAdjustment = getResources().getDimensionPixelSize(
                R.dimen.all_apps_header_top_adjustment);
        mHeaderProtectionColor = Themes.getAttrColor(context, R.attr.allappsHeaderProtectionColor);

        mWorkManager = new WorkProfileManager(
@@ -731,16 +728,15 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
        mHeaderPaint.setColor(mHeaderColor);
        mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
        if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {
            final int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight();
            final int floatingHeaderBottom = getFloatingHeaderView().getBottom();
            final int floatingHeaderPaddingBottom = getFloatingHeaderView().getPaddingBottom();
            final int bottom = floatingHeaderBottom - floatingHeaderPaddingBottom - tabsHeight;
            int bottom = getHeaderBottom();
            if (!mUsingTabs) {
                bottom += getFloatingHeaderView().getPaddingBottom() - mHeaderBottomAdjustment;
            }
            canvas.drawRect(0, 0, canvas.getWidth(), bottom, mHeaderPaint);
            int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight();
            if (mTabsProtectionAlpha > 0 && tabsHeight != 0) {
                mHeaderPaint.setAlpha((int) (getAlpha() * mTabsProtectionAlpha));
                // Why use mHeaderTopAdjustment? Because it works.
                final int protectionBottom = floatingHeaderBottom - mHeaderTopAdjustment;
                canvas.drawRect(0, bottom, canvas.getWidth(), protectionBottom, mHeaderPaint);
                canvas.drawRect(0, bottom, canvas.getWidth(), bottom + tabsHeight, mHeaderPaint);
            }
        }
    }
+1 −8
Original line number Diff line number Diff line
@@ -83,8 +83,6 @@ public class FloatingHeaderView extends LinearLayout implements
    // These two values are necessary to ensure that the header protection is drawn correctly.
    private final int mHeaderTopAdjustment;
    private final int mHeaderBottomAdjustment;
    private final int mHeaderPillHeight;
    private final int mHeaderTopMargin;
    private final boolean mHeaderProtectionSupported;

    protected ViewGroup mTabLayout;
@@ -126,10 +124,6 @@ public class FloatingHeaderView extends LinearLayout implements
                R.bool.config_header_protection_supported)
                // TODO(b/208599118) Support header protection for bottom sheet.
                && !ActivityContext.lookupContext(context).getDeviceProfile().isTablet;
        mHeaderPillHeight = context.getResources()
                .getDimensionPixelSize(R.dimen.all_apps_header_pill_height);
        mHeaderTopMargin = context.getResources()
                .getDimensionPixelSize(R.dimen.all_apps_header_top_margin);
    }

    @Override
@@ -450,7 +444,6 @@ public class FloatingHeaderView extends LinearLayout implements
        if (mTabsHidden || !mHeaderCollapsed) {
            return 0;
        }
        return Math.max(mHeaderPillHeight - getPaddingTop() + mHeaderTopMargin
                + mTranslationY, 0);
        return Math.max(getHeight() - getPaddingTop() + mTranslationY, 0);
    }
}