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

Commit 7122cb8e authored by Hyunyoung Song's avatar Hyunyoung Song Committed by Android (Google) Code Review
Browse files

Merge "Animate discovery bounce for all apps pull up interaction b/30221381"...

Merge "Animate discovery bounce for all apps pull up interaction b/30221381" into ub-launcher3-calgary
parents 9d6df217 c001cf56
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2016, 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.
*/
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
        android:ordering="sequentially"
        android:startOffset="200">

    <objectAnimator
        android:propertyName="progress"
        android:duration="250"
        android:interpolator="@interpolator/disco_bounce_section1"
        android:valueFrom="1f"
        android:valueTo=".94f"
        android:valueType="floatType"/>
    <objectAnimator
        android:propertyName="progress"
        android:duration="216"
        android:interpolator="@interpolator/disco_bounce_section2"
        android:valueFrom=".94f"
        android:valueTo="1.012f"
        android:valueType="floatType"/>
    <objectAnimator
        android:propertyName="progress"
        android:duration="234"
        android:interpolator="@interpolator/disco_bounce_section3"
        android:valueFrom="1.012f"
        android:valueTo="1f"
        android:valueType="floatType"/>
</set>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2016 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
  -->

<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
                  android:controlX1="0.9"
                  android:controlY1="0"
                  android:controlX2="0.5"
                  android:controlY2="1"/>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2016 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
  -->

<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
                  android:controlX1="0.9"
                  android:controlY1="0"
                  android:controlX2="0.6"
                  android:controlY2="1"/>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2016 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
  -->

<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
                  android:controlX1="0.1"
                  android:controlY1="0"
                  android:controlX2="0.7"
                  android:controlY2="1"/>
+31 −4
Original line number Diff line number Diff line
@@ -198,6 +198,7 @@ public class Launcher extends Activity

    static final String INTRO_SCREEN_DISMISSED = "launcher.intro_screen_dismissed";
    static final String FIRST_RUN_ACTIVITY_DISPLAYED = "launcher.first_run_activity_displayed";
    static final String APPS_VIEW_SHOWN = "launcher.apps_view_shown";

    /** The different states that Launcher can be in. */
    enum State { NONE, WORKSPACE, WORKSPACE_SPRING_LOADED, APPS, APPS_SPRING_LOADED,
@@ -288,6 +289,7 @@ public class Launcher extends Activity
    private IconCache mIconCache;
    private ExtractedColors mExtractedColors;
    private LauncherAccessibilityDelegate mAccessibilityDelegate;
    private boolean mIsResumeFromActionScreenOff;
    @Thunk boolean mUserPresent = true;
    private boolean mVisible = false;
    private boolean mHasFocus = false;
@@ -1079,6 +1081,10 @@ public class Launcher extends Activity
            InstallShortcutReceiver.disableAndFlushInstallQueue(this);
        }

        if (shouldShowDiscoveryBounce()) {
            mAllAppsController.showDiscoveryBounce();
        }
        mIsResumeFromActionScreenOff = false;
        if (mLauncherCallbacks != null) {
            mLauncherCallbacks.onResume();
        }
@@ -1623,6 +1629,7 @@ public class Launcher extends Activity
                        mAppsView.reset();
                    }
                }
                mIsResumeFromActionScreenOff = true;
            } else if (Intent.ACTION_USER_PRESENT.equals(action)) {
                mUserPresent = true;
                updateAutoAdvanceState();
@@ -3348,6 +3355,7 @@ public class Launcher extends Activity
     */
    public void showAppsView(boolean animated, boolean resetListToTop, boolean updatePredictedApps,
            boolean focusSearchBar) {
        markAppsViewShown();
        if (resetListToTop) {
            mAppsView.scrollToTop();
        }
@@ -4358,10 +4366,6 @@ public class Launcher extends Activity
                !mSharedPrefs.getBoolean(FIRST_RUN_ACTIVITY_DISPLAYED, false);
    }

    protected boolean hasRunFirstRunActivity() {
        return mSharedPrefs.getBoolean(FIRST_RUN_ACTIVITY_DISPLAYED, false);
    }

    public boolean showFirstRunActivity() {
        if (shouldRunFirstRunActivity() &&
                hasFirstRunActivity()) {
@@ -4381,6 +4385,29 @@ public class Launcher extends Activity
        editor.apply();
    }

    private void markAppsViewShown() {
        if (mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false)) {
            return;
        }
        mSharedPrefs.edit().putBoolean(APPS_VIEW_SHOWN, true).apply();
    }

    private boolean shouldShowDiscoveryBounce() {
        if (mState != mState.WORKSPACE) {
            return false;
        }
        if (mLauncherCallbacks != null && mLauncherCallbacks.shouldShowDiscoveryBounce()) {
            return true;
        }
        if (!mIsResumeFromActionScreenOff) {
            return false;
        }
        if (mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false)) {
            return false;
        }
        return true;
    }

    /**
     * To be overridden by subclasses to indicate that there is an in-activity full-screen intro
     * screen that must be displayed and dismissed.
Loading