diff options
author | Selim Cinek <cinek@google.com> | 2014-11-11 13:41:02 +0100 |
---|---|---|
committer | Selim Cinek <cinek@google.com> | 2014-11-12 14:48:48 +0100 |
commit | f9c0e8f02f3483d6aa9e762c97a2c02ea50eeb02 (patch) | |
tree | b5f79c6f5af6883f43ca8e5ce4ef6c55e3e1a9be /packages/Keyguard/src/com/android/keyguard/DisappearAnimationUtils.java | |
parent | 72e32fd55538715f72299a08e14834257847d8dc (diff) | |
download | frameworks_base-f9c0e8f02f3483d6aa9e762c97a2c02ea50eeb02.zip frameworks_base-f9c0e8f02f3483d6aa9e762c97a2c02ea50eeb02.tar.gz frameworks_base-f9c0e8f02f3483d6aa9e762c97a2c02ea50eeb02.tar.bz2 |
Added dissapear animation to pattern and pin input
Bug: 18232017
Change-Id: I062d55b0870ccaad6093b672f5076c3f80c10f94
Diffstat (limited to 'packages/Keyguard/src/com/android/keyguard/DisappearAnimationUtils.java')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/DisappearAnimationUtils.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/DisappearAnimationUtils.java b/packages/Keyguard/src/com/android/keyguard/DisappearAnimationUtils.java new file mode 100644 index 0000000..6fff0ba --- /dev/null +++ b/packages/Keyguard/src/com/android/keyguard/DisappearAnimationUtils.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.keyguard; + +import android.content.Context; +import android.view.View; +import android.view.animation.AnimationUtils; +import android.view.animation.Interpolator; + +/** + * A class to make nice disappear transitions for views in a tabular layout. + */ +public class DisappearAnimationUtils extends AppearAnimationUtils { + + public DisappearAnimationUtils(Context ctx) { + this(ctx, DEFAULT_APPEAR_DURATION, + 1.0f, 1.0f, + AnimationUtils.loadInterpolator(ctx, android.R.interpolator.linear_out_slow_in)); + } + + public DisappearAnimationUtils(Context ctx, long duration, float translationScaleFactor, + float delayScaleFactor, Interpolator interpolator) { + super(ctx, duration, translationScaleFactor, delayScaleFactor, interpolator); + mScaleTranslationWithRow = true; + mAppearing = false; + } + + protected long calculateDelay(int row, int col) { + return (long) ((row * 60 + col * (Math.pow(row, 0.4) + 0.4) * 10) * mDelayScale); + } +} |