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

Commit 27b39b96 authored by Alex Chau's avatar Alex Chau
Browse files

Put AllApps in bottom sheet for tablets

http://screen/7steQ7W8U2ga3Hs

Bug: 208599118
Test: manual
Change-Id: I36cbac3cb7cb214081e5a33a6e042ae83e745f23
parent 36e0fd91
Loading
Loading
Loading
Loading
+12 −9
Original line number Original line Diff line number Diff line
@@ -33,13 +33,6 @@ public class AllAppsState extends LauncherState {


    private static final int STATE_FLAGS = FLAG_WORKSPACE_INACCESSIBLE | FLAG_CLOSE_POPUPS;
    private static final int STATE_FLAGS = FLAG_WORKSPACE_INACCESSIBLE | FLAG_CLOSE_POPUPS;


    private static final PageAlphaProvider PAGE_ALPHA_PROVIDER = new PageAlphaProvider(DEACCEL_2) {
        @Override
        public float getPageAlpha(int pageIndex) {
            return 0;
        }
    };

    public AllAppsState(int id) {
    public AllAppsState(int id) {
        super(id, LAUNCHER_STATE_ALLAPPS, STATE_FLAGS);
        super(id, LAUNCHER_STATE_ALLAPPS, STATE_FLAGS);
    }
    }
@@ -82,7 +75,15 @@ public class AllAppsState extends LauncherState {


    @Override
    @Override
    public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
    public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
        return PAGE_ALPHA_PROVIDER;
        PageAlphaProvider superPageAlphaProvider = super.getWorkspacePageAlphaProvider(launcher);
        return new PageAlphaProvider(DEACCEL_2) {
            @Override
            public float getPageAlpha(int pageIndex) {
                return launcher.getDeviceProfile().isTablet
                        ? superPageAlphaProvider.getPageAlpha(pageIndex)
                        : 0;
            }
        };
    }
    }


    @Override
    @Override
@@ -97,6 +98,8 @@ public class AllAppsState extends LauncherState {


    @Override
    @Override
    public int getWorkspaceScrimColor(Launcher launcher) {
    public int getWorkspaceScrimColor(Launcher launcher) {
        return Themes.getAttrColor(launcher, R.attr.allAppsScrimColor);
        return launcher.getDeviceProfile().isTablet
                ? launcher.getResources().getColor(R.color.widgets_picker_scrim)
                : Themes.getAttrColor(launcher, R.attr.allAppsScrimColor);
    }
    }
}
}
+29 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2022 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.
-->
<ripple android:color="?android:attr/colorControlHighlight"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item>
        <shape android:shape="rectangle"
            android:tint="?colorButtonNormal">
            <corners
                android:topLeftRadius="@dimen/dialogCornerRadius"
                android:topRightRadius="@dimen/dialogCornerRadius"/>
            <solid android:color="?attr/allAppsScrimColor" />
        </shape>
    </item>
</ripple>
 No newline at end of file
+3 −0
Original line number Original line Diff line number Diff line
@@ -20,4 +20,7 @@


<!-- Widgets pickers -->
<!-- Widgets pickers -->
    <dimen name="widget_list_horizontal_margin">32dp</dimen>
    <dimen name="widget_list_horizontal_margin">32dp</dimen>

<!-- AllApps -->
    <dimen name="all_apps_bottom_sheet_horizontal_padding">32dp</dimen>
</resources>
</resources>
+20 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 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.
-->

<resources>
<!-- AllApps -->
    <dimen name="all_apps_bottom_sheet_horizontal_padding">41dp</dimen>
</resources>
+1 −0
Original line number Original line Diff line number Diff line
@@ -114,6 +114,7 @@
    <dimen name="all_apps_content_fade_in_offset">150dp</dimen>
    <dimen name="all_apps_content_fade_in_offset">150dp</dimen>
    <dimen name="all_apps_tip_bottom_margin">8dp</dimen>
    <dimen name="all_apps_tip_bottom_margin">8dp</dimen>
    <dimen name="all_apps_height_extra">6dp</dimen>
    <dimen name="all_apps_height_extra">6dp</dimen>
    <dimen name="all_apps_bottom_sheet_horizontal_padding">0dp</dimen>


    <!-- The size of corner radius of the arrow in the arrow toast. -->
    <!-- The size of corner radius of the arrow in the arrow toast. -->
    <dimen name="arrow_toast_corner_radius">2dp</dimen>
    <dimen name="arrow_toast_corner_radius">2dp</dimen>
Loading