use of android.view.animation.Animation 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;
}
use of android.view.animation.Animation 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;
}
use of android.view.animation.Animation in project wire-android by wireapp.
the class TabbedParticipantBodyFragment method onCreateAnimation.
@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
final Fragment parent = getParentFragment();
// is being removed.
if (!enter && parent != null && parent.isRemoving()) {
// This is a workaround for the bug where child fragments disappear when
// the parent is removed (as all children are first removed from the parent)
// See https://code.google.com/p/android/issues/detail?id=55228
Animation doNothingAnim = new AlphaAnimation(1, 1);
doNothingAnim.setDuration(ViewUtils.getNextAnimationDuration(parent));
return doNothingAnim;
} else {
return super.onCreateAnimation(transit, enter, nextAnim);
}
}
use of android.view.animation.Animation in project wire-android by wireapp.
the class ParticipantsDialogFragment method setVisible.
@SuppressLint("RtlHardcoded")
private void setVisible(final boolean show) {
if (getView() == null || isInConfigurationChange) {
removeFragment();
return;
}
Animation animation;
if (show) {
switch(selfGravity) {
case Gravity.TOP:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_show_gravity_top);
break;
case Gravity.RIGHT:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_show_gravity_right);
break;
case Gravity.LEFT:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_show_gravity_left);
break;
case Gravity.BOTTOM:
default:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_show_gravity_bottom);
}
} else {
switch(selfGravity) {
case Gravity.TOP:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_hide_gravity_top);
break;
case Gravity.RIGHT:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_hide_gravity_right);
break;
case Gravity.LEFT:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_hide_gravity_left);
break;
case Gravity.BOTTOM:
default:
animation = AnimationUtils.loadAnimation(getActivity(), R.anim.popover_hide_gravity_bottom);
}
}
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
if (show) {
return;
}
removeFragment();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
getView().startAnimation(animation);
}
use of android.view.animation.Animation in project wire-android by wireapp.
the class ParticipantHeaderFragment method onCreateAnimation.
@Override
public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
final Fragment parent = getParentFragment();
// is being removed.
if (!enter && parent != null && parent.isRemoving()) {
// This is a workaround for the bug where child fragments disappear when
// the parent is removed (as all children are first removed from the parent)
// See https://code.google.com/p/android/issues/detail?id=55228
Animation doNothingAnim = new AlphaAnimation(1, 1);
doNothingAnim.setDuration(ViewUtils.getNextAnimationDuration(parent));
return doNothingAnim;
} else {
return super.onCreateAnimation(transit, enter, nextAnim);
}
}
Aggregations