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

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

Issue 960733002: [Andorid] ClipDrawable progress bar experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated test Created 5 years, 9 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 4
5 package org.chromium.chrome.browser.widget; 5 package org.chromium.chrome.browser.widget;
6 6
7 import android.animation.Animator; 7 import android.animation.Animator;
8 import android.animation.AnimatorListenerAdapter; 8 import android.animation.AnimatorListenerAdapter;
9 import android.animation.ObjectAnimator; 9 import android.animation.ObjectAnimator;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 for (int i = 0; i < ld.getNumberOfLayers(); i++) { 121 for (int i = 0; i < ld.getNumberOfLayers(); i++) {
122 ld.getDrawable(i).setBounds(currentDrawable.getBounds()); 122 ld.getDrawable(i).setBounds(currentDrawable.getBounds());
123 } 123 }
124 } 124 }
125 } 125 }
126 126
127 /** 127 /**
128 * @return Whether or not this progress bar has animations running for showi ng/hiding itself. 128 * @return Whether or not this progress bar has animations running for showi ng/hiding itself.
129 */ 129 */
130 @VisibleForTesting 130 @VisibleForTesting
131 boolean isAnimatingForShowOrHide() { 131 public boolean isAnimatingForShowOrHide() {
132 return (mShowAnimator != null && mShowAnimator.isStarted()) 132 return (mShowAnimator != null && mShowAnimator.isStarted())
133 || (mHideAnimator != null && mHideAnimator.isStarted()); 133 || (mHideAnimator != null && mHideAnimator.isStarted());
134 } 134 }
135 135
136 private void buildAnimators() { 136 private void buildAnimators() {
137 if (mShowAnimator != null && mShowAnimator.isRunning()) mShowAnimator.en d(); 137 if (mShowAnimator != null && mShowAnimator.isRunning()) mShowAnimator.en d();
138 if (mHideAnimator != null && mHideAnimator.isRunning()) mHideAnimator.en d(); 138 if (mHideAnimator != null && mHideAnimator.isRunning()) mHideAnimator.en d();
139 139
140 mShowAnimator = ObjectAnimator.ofFloat(this, View.SCALE_Y, 0.f, 1.f); 140 mShowAnimator = ObjectAnimator.ofFloat(this, View.SCALE_Y, 0.f, 1.f);
141 mShowAnimator.setDuration(SHOW_HIDE_DURATION_MS); 141 mShowAnimator.setDuration(SHOW_HIDE_DURATION_MS);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (mHideAnimator.isRunning()) mHideAnimator.end(); 177 if (mHideAnimator.isRunning()) mHideAnimator.end();
178 178
179 if (willShow) { 179 if (willShow) {
180 mShowAnimator.start(); 180 mShowAnimator.start();
181 } else { 181 } else {
182 mHideAnimator.start(); 182 mHideAnimator.start();
183 } 183 }
184 } 184 }
185 } 185 }
186 } 186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698