use of android.view.animation.TranslateAnimation in project cw-omnibus by commonsguy.
the class SlidingPanel method toggle.
public void toggle() {
TranslateAnimation anim = null;
isOpen = !isOpen;
if (isOpen) {
setVisibility(View.VISIBLE);
anim = new TranslateAnimation(0.0f, 0.0f, getHeight(), 0.0f);
} else {
anim = new TranslateAnimation(0.0f, 0.0f, 0.0f, getHeight());
anim.setAnimationListener(collapseListener);
}
anim.setDuration(speed);
anim.setInterpolator(new AccelerateInterpolator(1.0f));
startAnimation(anim);
}
use of android.view.animation.TranslateAnimation in project cw-omnibus by commonsguy.
the class SlidingPanel method toggle.
public void toggle() {
TranslateAnimation anim = null;
AnimationSet set = new AnimationSet(true);
isOpen = !isOpen;
if (isOpen) {
setVisibility(View.VISIBLE);
anim = new TranslateAnimation(0.0f, 0.0f, getHeight(), 0.0f);
} else {
anim = new TranslateAnimation(0.0f, 0.0f, 0.0f, getHeight());
anim.setAnimationListener(collapseListener);
set.addAnimation(fadeOut);
}
set.addAnimation(anim);
set.setDuration(speed);
set.setInterpolator(new AccelerateInterpolator(1.0f));
startAnimation(set);
}
use of android.view.animation.TranslateAnimation in project nmid-headline by miao1007.
the class PlatformListPage method initAnim.
private void initAnim() {
animShow = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 0);
animShow.setDuration(300);
animHide = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1);
animHide.setDuration(300);
}
use of android.view.animation.TranslateAnimation in project actor-platform by actorapp.
the class AttachFragment method hide.
@Override
public void hide() {
if (root != null && root.getVisibility() == View.VISIBLE) {
onHidden();
fastAttachAdapter.clearSelected();
messenger().getGalleryScannerActor().send(new GalleryScannerActor.Hide());
fastShare.scrollToPosition(0);
hideView(root);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP && !isFastShareFullScreen) {
View internal = fastShare;
int cx = internal.getWidth() - Screen.dp(56 + 56);
int cy = internal.getHeight() - Screen.dp(56 / 2);
float finalRadius = (float) Math.hypot(cx, cy);
Animator anim = ViewAnimationUtils.createCircularReveal(internal, cx, cy, finalRadius, 0);
anim.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
internal.setAlpha(1);
}
@Override
public void onAnimationEnd(Animator animator) {
internal.setAlpha(0);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
anim.setDuration(200);
anim.start();
} else {
TranslateAnimation animation = new TranslateAnimation(0, 0, 0, root.getHeight());
animation.setInterpolator(MaterialInterpolator.getInstance());
animation.setDuration(250);
fastShare.startAnimation(animation);
bottomBackground.startAnimation(animation);
}
}
}
use of android.view.animation.TranslateAnimation in project actor-platform by actorapp.
the class InputBarFragment method hideAudio.
protected void hideAudio(boolean cancel) {
if (!isAudioVisible) {
return;
}
isAudioVisible = false;
showView(attachButton);
showView(messageEditText);
showView(emojiButton);
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
voiceRecordActor.send(new VoiceCaptureActor.Stop(cancel));
TranslateAnimation animation = new TranslateAnimation(0, Screen.getWidth(), 0, 0);
animation.setDuration(160);
audioContainer.clearAnimation();
audioContainer.setAnimation(animation);
audioContainer.animate();
audioContainer.setVisibility(View.GONE);
messageEditText.requestFocus();
}
Aggregations