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

Commit 532406ee authored by Jovana Knezevic's avatar Jovana Knezevic Committed by android-build-merger
Browse files

Merge "Fixing issues with alpha 0.0 on parent view." into pi-dev

am: 1bcc95ef

Change-Id: I42ad7eb35ce3c8d5c82c901b0392d55186785759
parents 3eb7e1d0 1bcc95ef
Loading
Loading
Loading
Loading
+25 −24
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ public class FullscreenUserSwitcher {

    public void hide() {
        mShowing = false;
        toggleSwitchInProgress(false);
        mParent.setVisibility(View.GONE);
    }

@@ -78,6 +77,7 @@ public class FullscreenUserSwitcher {
        // reboot, system fires ACTION_USER_SWITCHED change from -1 to 0 user. This is not an actual
        // user switch. We only want to trigger keyguard dismissal when foreground user changes.
        if (foregroundUserChanged()) {
            toggleSwitchInProgress(false);
            updateCurrentForegroundUser();
            mParent.post(this::dismissKeyguard);
        }
@@ -107,32 +107,33 @@ public class FullscreenUserSwitcher {

    private void toggleSwitchInProgress(boolean inProgress) {
        if (inProgress) {
            crossFade(mParent, mContainer);
            fadeOut(mContainer);
        } else {
            crossFade(mContainer, mParent);
            fadeIn(mContainer);
        }

    }

    private void crossFade(View incoming, View outgoing) {
        incoming.animate()
            .alpha(1.0f)
    private void fadeOut(View view) {
        view.animate()
                .alpha(0.0f)
                .setDuration(mShortAnimDuration)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                public void onAnimationStart(Animator animator) {
                    incoming.setAlpha(0.0f);
                    incoming.setVisibility(View.VISIBLE);
                    public void onAnimationEnd(Animator animation) {
                        view.setVisibility(View.GONE);
                    }
                });
    }

        outgoing.animate()
            .alpha(0.0f)
    private void fadeIn(View view) {
        view.animate()
                .alpha(1.0f)
                .setDuration(mShortAnimDuration)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                public void onAnimationEnd(Animator animation) {
                    outgoing.setVisibility(View.GONE);
                    public void onAnimationStart(Animator animator) {
                        view.setAlpha(0.0f);
                        view.setVisibility(View.VISIBLE);
                    }
                });
    }