use of android.view.animation.Animation in project UltimateAndroid by cymcsg.
the class RayMenu method getItemClickListener.
private OnClickListener getItemClickListener(final OnClickListener listener) {
return new OnClickListener() {
@Override
public void onClick(final View viewClicked) {
Animation animation = bindItemAnimation(viewClicked, true, 400);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
postDelayed(new Runnable() {
@Override
public void run() {
itemDidDisappear();
}
}, 0);
}
});
final int itemCount = mRayLayout.getChildCount();
for (int i = 0; i < itemCount; i++) {
View item = mRayLayout.getChildAt(i);
if (viewClicked != item) {
bindItemAnimation(item, false, 300);
}
}
mRayLayout.invalidate();
mHintView.startAnimation(createHintSwitchAnimation(true));
if (listener != null) {
listener.onClick(viewClicked);
}
}
};
}
use of android.view.animation.Animation in project AntennaPod by AntennaPod.
the class VideoplayerActivity method hideVideoControls.
@SuppressLint("NewApi")
private void hideVideoControls() {
final Animation animation = AnimationUtils.loadAnimation(this, R.anim.fade_out);
if (animation != null) {
videoOverlay.startAnimation(animation);
controls.startAnimation(animation);
}
if (Build.VERSION.SDK_INT >= 14) {
int videoviewFlag = (Build.VERSION.SDK_INT >= 16) ? View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION : 0;
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | videoviewFlag);
videoOverlay.setFitsSystemWindows(true);
}
videoOverlay.setVisibility(View.GONE);
controls.setVisibility(View.GONE);
}
use of android.view.animation.Animation in project android_frameworks_base by DirtyUnicorns.
the class ViewGroup method bindLayoutAnimation.
private void bindLayoutAnimation(View child) {
Animation a = mLayoutAnimationController.getAnimationForView(child);
child.setAnimation(a);
}
use of android.view.animation.Animation in project android_frameworks_base by DirtyUnicorns.
the class WindowStateAnimator method applyAnimationLocked.
/**
* Choose the correct animation and set it to the passed WindowState.
* @param transit If AppTransition.TRANSIT_PREVIEW_DONE and the app window has been drawn
* then the animation will be app_starting_exit. Any other value loads the animation from
* the switch statement below.
* @param isEntrance The animation type the last time this was called. Used to keep from
* loading the same animation twice.
* @return true if an animation has been loaded.
*/
boolean applyAnimationLocked(int transit, boolean isEntrance) {
if ((mLocalAnimating && mAnimationIsEntrance == isEntrance) || mKeyguardGoingAwayAnimation) {
// keyguard exit animation such that it also fades out.
if (mAnimation != null && mKeyguardGoingAwayAnimation && transit == WindowManagerPolicy.TRANSIT_PREVIEW_DONE) {
applyFadeoutDuringKeyguardExitAnimation();
}
return true;
}
// Only apply an animation if the display isn't frozen. If it is
// frozen, there is no reason to animate and it can cause strange
// artifacts when we unfreeze the display if some different animation
// is running.
Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "WSA#applyAnimationLocked");
if (mService.okToDisplay()) {
int anim = mPolicy.selectAnimationLw(mWin, transit);
int attr = -1;
Animation a = null;
if (anim != 0) {
a = anim != -1 ? AnimationUtils.loadAnimation(mContext, anim) : null;
} else {
switch(transit) {
case WindowManagerPolicy.TRANSIT_ENTER:
attr = com.android.internal.R.styleable.WindowAnimation_windowEnterAnimation;
break;
case WindowManagerPolicy.TRANSIT_EXIT:
attr = com.android.internal.R.styleable.WindowAnimation_windowExitAnimation;
break;
case WindowManagerPolicy.TRANSIT_SHOW:
attr = com.android.internal.R.styleable.WindowAnimation_windowShowAnimation;
break;
case WindowManagerPolicy.TRANSIT_HIDE:
attr = com.android.internal.R.styleable.WindowAnimation_windowHideAnimation;
break;
}
if (attr >= 0) {
a = mService.mAppTransition.loadAnimationAttr(mWin.mAttrs, attr);
}
}
if (DEBUG_ANIM)
Slog.v(TAG, "applyAnimation: win=" + this + " anim=" + anim + " attr=0x" + Integer.toHexString(attr) + " a=" + a + " transit=" + transit + " isEntrance=" + isEntrance + " Callers " + Debug.getCallers(3));
if (a != null) {
if (DEBUG_ANIM)
logWithStack(TAG, "Loaded animation " + a + " for " + this);
setAnimation(a);
mAnimationIsEntrance = isEntrance;
}
} else {
clearAnimation();
}
Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
if (mWin.mAttrs.type == TYPE_INPUT_METHOD) {
mService.adjustForImeIfNeeded(mWin.mDisplayContent);
if (isEntrance) {
mWin.setDisplayLayoutNeeded();
mService.mWindowPlacerLocked.requestTraversal();
}
}
return mAnimation != null;
}
use of android.view.animation.Animation in project android_frameworks_base by DirtyUnicorns.
the class WindowStateAnimator method setMoveAnimation.
void setMoveAnimation(int left, int top) {
final Animation a = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.window_move_from_decor);
setAnimation(a);
mAnimDx = mWin.mLastFrame.left - left;
mAnimDy = mWin.mLastFrame.top - top;
mAnimateMove = true;
}
Aggregations