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

Commit 9bdaada9 authored by Michael Jurka's avatar Michael Jurka
Browse files

Fix bug 7138446: Icon blips in during Recents animation

Add animation where icon and description of the
primary activity fades and translates in

Change-Id: Ie21b5302ac9e58ee6af219b7cde98d12a8e82697
parent 30ed33b1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -24,13 +24,16 @@
    android:layout_width="wrap_content"
    android:paddingLeft="@dimen/status_bar_recents_item_padding"
    android:paddingRight="@dimen/status_bar_recents_item_padding"
    android:importantForAccessibility="no">
    android:importantForAccessibility="no"
    android:clipChildren="false">

    <RelativeLayout android:id="@+id/recent_item"
        android:layout_gravity="center_vertical"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:paddingTop="@*android:dimen/status_bar_height">
        android:paddingTop="@*android:dimen/status_bar_height"
        android:clipChildren="false"
        android:clipToPadding="false">

        <FrameLayout android:id="@+id/app_thumbnail"
            android:layout_width="wrap_content"
+3 −1
Original line number Diff line number Diff line
@@ -24,12 +24,14 @@
    android:layout_width="match_parent"
    android:paddingTop="@dimen/status_bar_recents_item_padding"
    android:paddingBottom="@dimen/status_bar_recents_item_padding"
    android:clipChildren="false"
    android:importantForAccessibility="no">

    <RelativeLayout android:id="@+id/recent_item"
        android:layout_gravity="center_horizontal"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content">
        android:layout_width="wrap_content"
        android:clipChildren="false">

        <TextView android:id="@+id/app_label"
            android:layout_width="@dimen/status_bar_recents_app_label_width"
+4 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@
    <dimen name="status_bar_recents_app_label_left_margin">0dip</dimen>
    <!-- Padding between recents items -->
    <dimen name="status_bar_recents_item_padding">0dip</dimen>
    <!-- When recents first appears, how far the icon and label of the primary activity
         travel -->
    <dimen name="status_bar_recents_app_icon_translate_distance">100dp</dimen>

    <!-- Where to place the app icon over the thumbnail -->
    <dimen name="status_bar_recents_app_icon_left_margin">0dp</dimen>
    <dimen name="status_bar_recents_app_icon_top_margin">8dp</dimen>
+27 −0
Original line number Diff line number Diff line
@@ -19,9 +19,12 @@ package com.android.systemui;
import android.app.Application;

import com.android.systemui.recent.RecentTasksLoader;
import com.android.systemui.recent.RecentsActivity;

public class SystemUIApplication extends Application {
    private RecentTasksLoader mRecentTasksLoader;
    private boolean mWaitingForWinAnimStart;
    private RecentsActivity.WindowAnimationStartListener mWinAnimStartListener;

    public RecentTasksLoader getRecentTasksLoader() {
        if (mRecentTasksLoader == null) {
@@ -29,4 +32,28 @@ public class SystemUIApplication extends Application {
        }
        return mRecentTasksLoader;
    }

    public void setWaitingForWinAnimStart(boolean waiting) {
        mWaitingForWinAnimStart = waiting;
    }

    public void setWindowAnimationStartListener(
            RecentsActivity.WindowAnimationStartListener startListener) {
        mWinAnimStartListener = startListener;
    }

    public RecentsActivity.WindowAnimationStartListener getWindowAnimationListener() {
        return mWinAnimStartListener;
    }

    public void onWindowAnimationStart() {
        if (mWinAnimStartListener != null) {
            mWinAnimStartListener.onWindowAnimationStart();
        }
        mWaitingForWinAnimStart = false;
    }

    public boolean isWaitingForWindowAnimationStart() {
        return mWaitingForWinAnimStart;
    }
}
 No newline at end of file
+9 −3
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@ public class RecentsActivity extends Activity {
        }
    };

    public static interface WindowAnimationStartListener {
        void onWindowAnimationStart();
    }

    public class TouchOutsideListener implements View.OnTouchListener {
        private StatusBarPanel mPanel;

@@ -88,15 +92,15 @@ public class RecentsActivity extends Activity {
    @Override
    public void onStart() {
        mShowing = true;
        if (mRecentsPanel != null) {
            mRecentsPanel.refreshViews();
        }
        super.onStart();
    }

    @Override
    public void onResume() {
        mForeground = true;
        if (mRecentsPanel != null) {
            mRecentsPanel.refreshViews();
        }
        super.onResume();
    }

@@ -150,6 +154,7 @@ public class RecentsActivity extends Activity {
        mIntentFilter = new IntentFilter();
        mIntentFilter.addAction(CLOSE_RECENTS_INTENT);
        registerReceiver(mIntentReceiver, mIntentFilter);
        app.setWindowAnimationStartListener(mRecentsPanel);
        super.onCreate(savedInstanceState);
    }

@@ -164,6 +169,7 @@ public class RecentsActivity extends Activity {
        final RecentTasksLoader recentTasksLoader = app.getRecentTasksLoader();
        recentTasksLoader.setRecentsPanel(null, mRecentsPanel);
        unregisterReceiver(mIntentReceiver);
        app.setWindowAnimationStartListener(null);
        super.onDestroy();
    }

Loading