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

Commit 3b7c865e authored by Tony's avatar Tony
Browse files

Merge commit 'refs/changes/84/2659484/1' of...

Merge commit 'refs/changes/84/2659484/1' of sso://googleplex-android/platform/packages/apps/Launcher3 into am-860fd7dd-f3a3-4500-8fc2-78d473322b94

Change-Id: I0b39a20cee47d4aba4a033196db3df78b2357b7b
parents 1ab03c6b 2bc5c995
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -42,12 +42,7 @@
            android:layout_gravity="center"
            android:layout_gravity="center"
            launcher:pageIndicator="@id/page_indicator" />
            launcher:pageIndicator="@id/page_indicator" />


        <com.android.launcher3.graphics.GradientView
        <include layout="@layout/gradient_bg" />
            android:id="@+id/gradient_bg"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"
            launcher:layout_ignoreInsets="true"/>


        <!-- DO NOT CHANGE THE ID -->
        <!-- DO NOT CHANGE THE ID -->
        <include layout="@layout/hotseat"
        <include layout="@layout/hotseat"
+1 −6
Original line number Original line Diff line number Diff line
@@ -44,12 +44,7 @@
            launcher:pageIndicator="@+id/page_indicator">
            launcher:pageIndicator="@+id/page_indicator">
        </com.android.launcher3.Workspace>
        </com.android.launcher3.Workspace>


        <com.android.launcher3.graphics.GradientView
        <include layout="@layout/gradient_bg" />
            android:id="@+id/gradient_bg"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"
            launcher:layout_ignoreInsets="true"/>


        <!-- DO NOT CHANGE THE ID -->
        <!-- DO NOT CHANGE THE ID -->
        <include layout="@layout/hotseat"
        <include layout="@layout/hotseat"
+1 −6
Original line number Original line Diff line number Diff line
@@ -43,12 +43,7 @@
            launcher:pageIndicator="@id/page_indicator">
            launcher:pageIndicator="@id/page_indicator">
        </com.android.launcher3.Workspace>
        </com.android.launcher3.Workspace>


        <com.android.launcher3.graphics.GradientView
        <include layout="@layout/gradient_bg" />
            android:id="@+id/gradient_bg"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"
            launcher:layout_ignoreInsets="true"/>


        <!-- DO NOT CHANGE THE ID -->
        <!-- DO NOT CHANGE THE ID -->
        <include layout="@layout/hotseat"
        <include layout="@layout/hotseat"
+24 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.launcher3.graphics.GradientView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res-auto"
    android:id="@+id/gradient_bg"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone"
    launcher:layout_ignoreInsets="true" />
 No newline at end of file
+14 −8
Original line number Original line Diff line number Diff line
@@ -88,7 +88,8 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab
        mScrollInterpolator = new SwipeDetector.ScrollInterpolator();
        mScrollInterpolator = new SwipeDetector.ScrollInterpolator();
        mInsets = new Rect();
        mInsets = new Rect();
        mSwipeDetector = new SwipeDetector(context, this, SwipeDetector.VERTICAL);
        mSwipeDetector = new SwipeDetector(context, this, SwipeDetector.VERTICAL);
        mGradientBackground = (GradientView) mLauncher.findViewById(R.id.gradient_bg);
        mGradientBackground = (GradientView) mLauncher.getLayoutInflater().inflate(
                R.layout.gradient_bg, mLauncher.getDragLayer(), false);
    }
    }


    @Override
    @Override
@@ -106,6 +107,8 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab


        onWidgetsBound();
        onWidgetsBound();


        mLauncher.getDragLayer().addView(mGradientBackground);
        mGradientBackground.setVisibility(VISIBLE);
        mLauncher.getDragLayer().addView(this);
        mLauncher.getDragLayer().addView(this);
        measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
        measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
        setTranslationY(mTranslationYClosed);
        setTranslationY(mTranslationYClosed);
@@ -212,11 +215,8 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab
            mOpenCloseAnimator.addListener(new AnimatorListenerAdapter() {
            mOpenCloseAnimator.addListener(new AnimatorListenerAdapter() {
                @Override
                @Override
                public void onAnimationEnd(Animator animation) {
                public void onAnimationEnd(Animator animation) {
                    mIsOpen = false;
                    mSwipeDetector.finishedScrolling();
                    mSwipeDetector.finishedScrolling();
                    ((ViewGroup) getParent()).removeView(WidgetsBottomSheet.this);
                    onCloseComplete();
                    mLauncher.getSystemUiController().updateUiState(
                            SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET, 0);
                }
                }
            });
            });
            mOpenCloseAnimator.setInterpolator(mSwipeDetector.isIdleState()
            mOpenCloseAnimator.setInterpolator(mSwipeDetector.isIdleState()
@@ -224,10 +224,16 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab
            mOpenCloseAnimator.start();
            mOpenCloseAnimator.start();
        } else {
        } else {
            setTranslationY(mTranslationYClosed);
            setTranslationY(mTranslationYClosed);
            onCloseComplete();
        }
    }

    private void onCloseComplete() {
        mIsOpen = false;
        mLauncher.getDragLayer().removeView(mGradientBackground);
        mLauncher.getDragLayer().removeView(WidgetsBottomSheet.this);
        mLauncher.getSystemUiController().updateUiState(
        mLauncher.getSystemUiController().updateUiState(
                SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET, 0);
                SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET, 0);
            mIsOpen = false;
        }
    }
    }


    @Override
    @Override