Search in sources :

Example 1 with ProfileSourceAnimation

use of com.waz.zclient.pages.main.participants.ProfileSourceAnimation in project wire-android by wireapp.

the class PendingConnectRequestFragment method onCreateAnimation.

//////////////////////////////////////////////////////////////////////////////////////////
//
//  Lifecycle
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    Animation animation = super.onCreateAnimation(transit, enter, nextAnim);
    if (getControllerFactory().getConversationScreenController().getPopoverLaunchMode() != DialogLaunchMode.AVATAR && getControllerFactory().getConversationScreenController().getPopoverLaunchMode() != DialogLaunchMode.COMMON_USER) {
        // No animation when request is shown in conversation list
        IConnectStore.UserRequester userRequester = IConnectStore.UserRequester.valueOf(getArguments().getString(ARGUMENT_USER_REQUESTER));
        if (userRequester != IConnectStore.UserRequester.CONVERSATION || isBelowUserProfile) {
            int centerX = ViewUtils.getOrientationIndependentDisplayWidth(getActivity()) / 2;
            int centerY = ViewUtils.getOrientationIndependentDisplayHeight(getActivity()) / 2;
            int duration;
            int delay = 0;
            if (isBelowUserProfile) {
                if (LayoutSpec.isTablet(getActivity())) {
                    animation = new ProfileTabletAnimation(enter, getResources().getInteger(R.integer.framework_animation_duration_long), -getResources().getDimensionPixelSize(R.dimen.participant_dialog__initial_width));
                } else {
                    if (enter) {
                        isBelowUserProfile = false;
                        duration = getResources().getInteger(R.integer.reopen_profile_source__animation_duration);
                        delay = getResources().getInteger(R.integer.reopen_profile_source__delay);
                    } else {
                        duration = getResources().getInteger(R.integer.reopen_profile_source__animation_duration);
                    }
                    animation = new ProfileSourceAnimation(enter, duration, delay, centerX, centerY);
                }
            } else if (nextAnim != 0) {
                if (LayoutSpec.isTablet(getActivity())) {
                    animation = new ProfileTabletAnimation(enter, getResources().getInteger(R.integer.framework_animation_duration_long), getResources().getDimensionPixelSize(R.dimen.participant_dialog__initial_width));
                } else {
                    if (enter) {
                        duration = getResources().getInteger(R.integer.open_profile__animation_duration);
                        delay = getResources().getInteger(R.integer.open_profile__delay);
                    } else {
                        duration = getResources().getInteger(R.integer.close_profile__animation_duration);
                    }
                    animation = new ProfileAnimation(enter, duration, delay, centerX, centerY);
                }
            }
        }
    }
    return animation;
}
Also used : ProfileTabletAnimation(com.waz.zclient.pages.main.participants.ProfileTabletAnimation) ProfileAnimation(com.waz.zclient.pages.main.participants.ProfileAnimation) IConnectStore(com.waz.zclient.core.stores.connect.IConnectStore) ProfileSourceAnimation(com.waz.zclient.pages.main.participants.ProfileSourceAnimation) ProfileSourceAnimation(com.waz.zclient.pages.main.participants.ProfileSourceAnimation) ProfileTabletAnimation(com.waz.zclient.pages.main.participants.ProfileTabletAnimation) Animation(android.view.animation.Animation) ProfileAnimation(com.waz.zclient.pages.main.participants.ProfileAnimation)

Example 2 with ProfileSourceAnimation

use of com.waz.zclient.pages.main.participants.ProfileSourceAnimation in project wire-android by wireapp.

the class SendConnectRequestFragment method onCreateAnimation.

//////////////////////////////////////////////////////////////////////////////////////////
//
//  Lifecycle
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    Animation animation = super.onCreateAnimation(transit, enter, nextAnim);
    if (getControllerFactory().getConversationScreenController().getPopoverLaunchMode() != DialogLaunchMode.AVATAR && getControllerFactory().getConversationScreenController().getPopoverLaunchMode() != DialogLaunchMode.COMMON_USER) {
        int centerX = ViewUtils.getOrientationIndependentDisplayWidth(getActivity()) / 2;
        int centerY = ViewUtils.getOrientationIndependentDisplayHeight(getActivity()) / 2;
        int duration;
        int delay = 0;
        if (isBelowUserProfile) {
            if (LayoutSpec.isTablet(getActivity())) {
                animation = new ProfileTabletAnimation(enter, getResources().getInteger(R.integer.framework_animation_duration_long), -getResources().getDimensionPixelSize(R.dimen.participant_dialog__initial_width));
            } else {
                if (enter) {
                    isBelowUserProfile = false;
                    duration = getResources().getInteger(R.integer.reopen_profile_source__animation_duration);
                    delay = getResources().getInteger(R.integer.reopen_profile_source__delay);
                } else {
                    duration = getResources().getInteger(R.integer.reopen_profile_source__animation_duration);
                }
                animation = new ProfileSourceAnimation(enter, duration, delay, centerX, centerY);
            }
        } else if (nextAnim != 0) {
            if (LayoutSpec.isTablet(getActivity())) {
                animation = new ProfileTabletAnimation(enter, getResources().getInteger(R.integer.framework_animation_duration_long), getResources().getDimensionPixelSize(R.dimen.participant_dialog__initial_width));
            } else {
                if (enter) {
                    duration = getResources().getInteger(R.integer.open_profile__animation_duration);
                    delay = getResources().getInteger(R.integer.open_profile__delay);
                } else {
                    duration = getResources().getInteger(R.integer.close_profile__animation_duration);
                }
                animation = new ProfileAnimation(enter, duration, delay, centerX, centerY);
            }
        }
    }
    return animation;
}
Also used : ProfileTabletAnimation(com.waz.zclient.pages.main.participants.ProfileTabletAnimation) ProfileAnimation(com.waz.zclient.pages.main.participants.ProfileAnimation) ProfileSourceAnimation(com.waz.zclient.pages.main.participants.ProfileSourceAnimation) ProfileSourceAnimation(com.waz.zclient.pages.main.participants.ProfileSourceAnimation) ProfileTabletAnimation(com.waz.zclient.pages.main.participants.ProfileTabletAnimation) Animation(android.view.animation.Animation) ProfileAnimation(com.waz.zclient.pages.main.participants.ProfileAnimation)

Example 3 with ProfileSourceAnimation

use of com.waz.zclient.pages.main.participants.ProfileSourceAnimation in project wire-android by wireapp.

the class BlockedUserProfileFragment method onCreateAnimation.

//////////////////////////////////////////////////////////////////////////////////////////
//
// Lifecycle
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
    Animation animation = super.onCreateAnimation(transit, enter, nextAnim);
    if (getControllerFactory().getConversationScreenController().getPopoverLaunchMode() != DialogLaunchMode.AVATAR && getControllerFactory().getConversationScreenController().getPopoverLaunchMode() != DialogLaunchMode.COMMON_USER) {
        int centerX = ViewUtils.getOrientationIndependentDisplayWidth(getActivity()) / 2;
        int centerY = ViewUtils.getOrientationIndependentDisplayHeight(getActivity()) / 2;
        int duration;
        int delay = 0;
        // Fade out animation when starting conversation directly with this user when unblocking
        if (!goToConversationWithUser || enter) {
            if (isBelowUserProfile) {
                if (LayoutSpec.isTablet(getActivity())) {
                    animation = new ProfileTabletAnimation(enter, getResources().getInteger(R.integer.framework_animation_duration_long), -getResources().getDimensionPixelSize(R.dimen.participant_dialog__initial_width));
                } else {
                    if (enter) {
                        isBelowUserProfile = false;
                        duration = getResources().getInteger(R.integer.reopen_profile_source__animation_duration);
                        delay = getResources().getInteger(R.integer.reopen_profile_source__delay);
                    } else {
                        duration = getResources().getInteger(R.integer.reopen_profile_source__animation_duration);
                    }
                    animation = new ProfileSourceAnimation(enter, duration, delay, centerX, centerY);
                }
            } else if (nextAnim != 0) {
                if (LayoutSpec.isTablet(getActivity())) {
                    animation = new ProfileTabletAnimation(enter, getResources().getInteger(R.integer.framework_animation_duration_long), getResources().getDimensionPixelSize(R.dimen.participant_dialog__initial_width));
                } else {
                    if (enter) {
                        duration = getResources().getInteger(R.integer.open_profile__animation_duration);
                        delay = getResources().getInteger(R.integer.open_profile__delay);
                    } else {
                        duration = getResources().getInteger(R.integer.close_profile__animation_duration);
                    }
                    animation = new ProfileAnimation(enter, duration, delay, centerX, centerY);
                }
            }
        } else {
            goToConversationWithUser = false;
            duration = getResources().getInteger(R.integer.framework_animation_duration_medium);
            animation = new FadeAnimation(duration, 1, 0);
        }
    }
    return animation;
}
Also used : ProfileTabletAnimation(com.waz.zclient.pages.main.participants.ProfileTabletAnimation) ProfileAnimation(com.waz.zclient.pages.main.participants.ProfileAnimation) ProfileSourceAnimation(com.waz.zclient.pages.main.participants.ProfileSourceAnimation) FadeAnimation(com.waz.zclient.ui.animation.fragment.FadeAnimation) ProfileSourceAnimation(com.waz.zclient.pages.main.participants.ProfileSourceAnimation) ProfileTabletAnimation(com.waz.zclient.pages.main.participants.ProfileTabletAnimation) Animation(android.view.animation.Animation) FadeAnimation(com.waz.zclient.ui.animation.fragment.FadeAnimation) ProfileAnimation(com.waz.zclient.pages.main.participants.ProfileAnimation)

Aggregations

Animation (android.view.animation.Animation)3 ProfileAnimation (com.waz.zclient.pages.main.participants.ProfileAnimation)3 ProfileSourceAnimation (com.waz.zclient.pages.main.participants.ProfileSourceAnimation)3 ProfileTabletAnimation (com.waz.zclient.pages.main.participants.ProfileTabletAnimation)3 IConnectStore (com.waz.zclient.core.stores.connect.IConnectStore)1 FadeAnimation (com.waz.zclient.ui.animation.fragment.FadeAnimation)1