Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/PulseInterpolator.java

Issue 2779543005: Add support for highlighting menu items (Closed)
Patch Set: Moved PulseDrawable Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.widget;
6
7 import android.view.animation.Interpolator;
8
9 /**
10 * An {@link Interpolator} that pulses a value based on the passed in {@link Int erpolator}. The
11 * pulse will fade in and out after a delay.
12 */
13 public class PulseInterpolator implements Interpolator {
14 private final Interpolator mInterpolator;
15
16 /**
17 * Creates a new {@link PulseInterpolator} instance.
18 * @param interpolator The {@link Interpolator} responsible for handling the fade out and in.
19 */
20 public PulseInterpolator(Interpolator interpolator) {
21 mInterpolator = interpolator;
22 }
23
24 @Override
25 public float getInterpolation(float input) {
26 if (input < 0.4f) return 0.f;
27 if (input < 0.8f) return mInterpolator.getInterpolation((input - 0.4f) / 0.4f);
28 return mInterpolator.getInterpolation(1.f - (input - 0.8f) / 0.2f);
29 }
30 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/widget/PulseDrawable.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698