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

Commit 9a1beceb authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Fade in grid preview" into ub-launcher3-rvc-dev

parents 0276b7e2 0d880c87
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.Messenger;
import android.view.Display;
import android.view.SurfaceControlViewHost;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;

import com.android.launcher3.InvariantDeviceProfile;

@@ -37,6 +38,8 @@ import java.util.concurrent.TimeUnit;
/** Render preview using surface view. */
public class PreviewSurfaceRenderer implements IBinder.DeathRecipient {

    private static final int FADE_IN_ANIMATION_DURATION = 200;

    private static final String KEY_HOST_TOKEN = "host_token";
    private static final String KEY_VIEW_WIDTH = "width";
    private static final String KEY_VIEW_HEIGHT = "height";
@@ -99,6 +102,11 @@ public class PreviewSurfaceRenderer implements IBinder.DeathRecipient {
            view.setPivotY(0);
            view.setTranslationX((mWidth - scale * view.getWidth()) / 2);
            view.setTranslationY((mHeight - scale * view.getHeight()) / 2);
            view.setAlpha(0);
            view.animate().alpha(1)
                    .setInterpolator(new AccelerateDecelerateInterpolator())
                    .setDuration(FADE_IN_ANIMATION_DURATION)
                    .start();
            mSurfaceControlViewHost.setView(view, view.getMeasuredWidth(),
                    view.getMeasuredHeight());
        });