use of android.view.animation.ScaleAnimation in project PhotoNoter by yydcdut.
the class AnimationTextView method initAnimation.
private void initAnimation() {
mAnimation = new ScaleAnimation(3.0f, 1.0f, 3.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mAnimation.setDuration(1000);
}
use of android.view.animation.ScaleAnimation in project UltimateAndroid by cymcsg.
the class RayMenu method createItemDisapperAnimation.
private static Animation createItemDisapperAnimation(final long duration, final boolean isClicked) {
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(new ScaleAnimation(1.0f, isClicked ? 2.0f : 0.0f, 1.0f, isClicked ? 2.0f : 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
animationSet.setDuration(duration);
animationSet.setInterpolator(new DecelerateInterpolator());
animationSet.setFillAfter(true);
return animationSet;
}
use of android.view.animation.ScaleAnimation in project newsrob by marianokamp.
the class ShowArticleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ("1".equals(NewsRob.getDebugProperties(this).getProperty("traceArticleDetailViewLaunch", "0")))
Debug.startMethodTracing("traceArticleDetialViewLaunch");
boolean isHwAccelerationEnabled = EntryManager.getInstance(this).isHardwareAccelerationAdvEnabled();
PL.log("User set hw accel to enabled=" + isHwAccelerationEnabled + " (activity: " + this + ").", this);
if (isHwAccelerationEnabled && !getEntryManager().isLightColorSchemeSelected()) {
PL.log("HW accel still disabled because of dark theme.", this);
isHwAccelerationEnabled = false;
}
if (isHwAccelerationEnabled)
SDK11Helper.enableHWAccelerationForActivity(this);
setTheme(getEntryManager().getCurrentThemeResourceId());
// setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
// gui
debug = "1".equals(NewsRob.getDebugProperties(this).getProperty("_articleDetailViewVerbose", "0"));
savedContentCursorPosition = -1;
requestWindowFeature(Window.FEATURE_NO_TITLE);
if (getIntent().getExtras() == null) {
finish();
return;
}
setContentView(com.newsrob.R.layout.show_article);
googleAdsUtil = new GoogleAdsUtil(getEntryManager());
uiHelper = new UIHelper(getEntryManager());
RelativeLayout container = getContainer();
registerForContextMenu(container);
container.setOnClickListener(this);
container.setOnLongClickListener(new View.OnLongClickListener() {
public boolean onLongClick(View v) {
lastLongClickTarget = v;
return false;
}
});
embeddedWebClient = new EmbeddedWebViewClient();
createWebView(container);
createOnScreenControls(container);
// end-gui
// runnables
refreshUIRunnable = new Runnable() {
public void run() {
refreshUI();
}
};
hideTitlePreviewRunnable = new Runnable() {
public void run() {
hideTitlePreview();
}
};
titlePreviewContainer = findViewById(R.id.title_preview);
hideAnimation = new ScaleAnimation(1f, 0f, 1f, 0f, Animation.RELATIVE_TO_PARENT, 0.5f, Animation.RELATIVE_TO_PARENT, 0.5f);
hideAnimation.setDuration(300);
hideAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
titlePreviewContainer.setVisibility(View.INVISIBLE);
}
});
showAnimation = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_PARENT, 0.5f, Animation.RELATIVE_TO_PARENT, 0.5f);
showAnimation.setDuration(300);
showAnimation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
titlePreviewContainer.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
}
});
// end-runnables
initialize(getIntent());
}
use of android.view.animation.ScaleAnimation in project android-support-v4-googlemaps by petedoyle.
the class FragmentManagerImpl method makeOpenCloseAnimation.
static Animation makeOpenCloseAnimation(Context context, float startScale, float endScale, float startAlpha, float endAlpha) {
AnimationSet set = new AnimationSet(false);
ScaleAnimation scale = new ScaleAnimation(startScale, endScale, startScale, endScale, Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF, .5f);
scale.setInterpolator(DECELERATE_QUINT);
scale.setDuration(ANIM_DUR);
set.addAnimation(scale);
AlphaAnimation alpha = new AlphaAnimation(startAlpha, endAlpha);
alpha.setInterpolator(DECELERATE_CUBIC);
alpha.setDuration(ANIM_DUR);
set.addAnimation(alpha);
return set;
}
use of android.view.animation.ScaleAnimation in project android_frameworks_base by ResurrectionRemix.
the class AppTransition method createAspectScaledThumbnailFreeformAnimationLocked.
private AnimationSet createAspectScaledThumbnailFreeformAnimationLocked(Rect sourceFrame, Rect destFrame, @Nullable Rect surfaceInsets, boolean enter) {
final float sourceWidth = sourceFrame.width();
final float sourceHeight = sourceFrame.height();
final float destWidth = destFrame.width();
final float destHeight = destFrame.height();
final float scaleH = enter ? sourceWidth / destWidth : destWidth / sourceWidth;
final float scaleV = enter ? sourceHeight / destHeight : destHeight / sourceHeight;
AnimationSet set = new AnimationSet(true);
final int surfaceInsetsH = surfaceInsets == null ? 0 : surfaceInsets.left + surfaceInsets.right;
final int surfaceInsetsV = surfaceInsets == null ? 0 : surfaceInsets.top + surfaceInsets.bottom;
// We want the scaling to happen from the center of the surface. In order to achieve that,
// we need to account for surface insets that will be used to enlarge the surface.
final float scaleHCenter = ((enter ? destWidth : sourceWidth) + surfaceInsetsH) / 2;
final float scaleVCenter = ((enter ? destHeight : sourceHeight) + surfaceInsetsV) / 2;
final ScaleAnimation scale = enter ? new ScaleAnimation(scaleH, 1, scaleV, 1, scaleHCenter, scaleVCenter) : new ScaleAnimation(1, scaleH, 1, scaleV, scaleHCenter, scaleVCenter);
final int sourceHCenter = sourceFrame.left + sourceFrame.width() / 2;
final int sourceVCenter = sourceFrame.top + sourceFrame.height() / 2;
final int destHCenter = destFrame.left + destFrame.width() / 2;
final int destVCenter = destFrame.top + destFrame.height() / 2;
final int fromX = enter ? sourceHCenter - destHCenter : destHCenter - sourceHCenter;
final int fromY = enter ? sourceVCenter - destVCenter : destVCenter - sourceVCenter;
final TranslateAnimation translation = enter ? new TranslateAnimation(fromX, 0, fromY, 0) : new TranslateAnimation(0, fromX, 0, fromY);
set.addAnimation(scale);
set.addAnimation(translation);
final IRemoteCallback callback = mAnimationFinishedCallback;
if (callback != null) {
set.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
mService.mH.obtainMessage(H.DO_ANIMATION_CALLBACK, callback).sendToTarget();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
return set;
}
Aggregations