| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch; | 4 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch; |
| 5 | 5 |
| 6 import android.content.Context; | 6 import android.content.Context; |
| 7 import android.support.v4.view.animation.PathInterpolatorCompat; | 7 import android.support.v4.view.animation.PathInterpolatorCompat; |
| 8 import android.text.TextUtils; | 8 import android.text.TextUtils; |
| 9 import android.view.animation.Interpolator; | 9 import android.view.animation.Interpolator; |
| 10 | 10 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 /** | 176 /** |
| 177 * The height and width of the static image. | 177 * The height and width of the static image. |
| 178 */ | 178 */ |
| 179 private int mStaticImageSize; | 179 private int mStaticImageSize; |
| 180 | 180 |
| 181 /** | 181 /** |
| 182 * The static image visibility percentage, which dictates how and where to d
raw the static | 182 * The static image visibility percentage, which dictates how and where to d
raw the static |
| 183 * image. The static image is not visible at all at 0.f and completely visib
le at 1.f. | 183 * image. The static image is not visible at all at 0.f and completely visib
le at 1.f. |
| 184 */ | 184 */ |
| 185 private float mStaticImageVisibilityPercentage = 0.f; | 185 private float mStaticImageVisibilityPercentage; |
| 186 | 186 |
| 187 /** | 187 /** |
| 188 * Hides the static image if it is visible and makes the icon sprite visible
. Also resets the | 188 * Hides the static image if it is visible and makes the icon sprite visible
. Also resets the |
| 189 * thumbnail URL and quick action icon resource id. | 189 * thumbnail URL and quick action icon resource id. |
| 190 * @param animate Whether hiding the thumbnail should be animated. | 190 * @param animate Whether hiding the thumbnail should be animated. |
| 191 */ | 191 */ |
| 192 public void hideStaticImage(boolean animate) { | 192 public void hideStaticImage(boolean animate) { |
| 193 getIconSpriteControl().setIsVisible(true); | 193 getIconSpriteControl().setIsVisible(true); |
| 194 if ((mThumbnailVisible || mQuickActionIconVisible) && animate) { | 194 if ((mThumbnailVisible || mQuickActionIconVisible) && animate) { |
| 195 animateStaticImageVisibility(false); | 195 animateStaticImageVisibility(false); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 public void onPropertyAnimationFinished(AnimationType prop) { | 270 public void onPropertyAnimationFinished(AnimationType prop) { |
| 271 if (prop == AnimationType.STATIC_IMAGE_VISIBILITY) { | 271 if (prop == AnimationType.STATIC_IMAGE_VISIBILITY) { |
| 272 if (mStaticImageVisibilityPercentage == 0.f) { | 272 if (mStaticImageVisibilityPercentage == 0.f) { |
| 273 onStaticImageHidden(); | 273 onStaticImageHidden(); |
| 274 } else if (mStaticImageVisibilityPercentage == 1.f) { | 274 } else if (mStaticImageVisibilityPercentage == 1.f) { |
| 275 getIconSpriteControl().setIsVisible(false); | 275 getIconSpriteControl().setIsVisible(false); |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 } | 279 } |
| OLD | NEW |