Chromium Code Reviews| OLD | NEW |
|---|---|
| 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.toolbar; | 5 package org.chromium.chrome.browser.toolbar; |
| 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.AnimatorSet; | 9 import android.animation.AnimatorSet; |
| 10 import android.animation.ObjectAnimator; | 10 import android.animation.ObjectAnimator; |
| (...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1447 mToolbarShadow.setVisibility(VISIBLE); | 1447 mToolbarShadow.setVisibility(VISIBLE); |
| 1448 mPreTextureCaptureAlpha = getAlpha(); | 1448 mPreTextureCaptureAlpha = getAlpha(); |
| 1449 setAlpha(1); | 1449 setAlpha(1); |
| 1450 } else { | 1450 } else { |
| 1451 setAlpha(mPreTextureCaptureAlpha); | 1451 setAlpha(mPreTextureCaptureAlpha); |
| 1452 updateShadowVisibility(); | 1452 updateShadowVisibility(); |
| 1453 mPreTextureCaptureAlpha = 1f; | 1453 mPreTextureCaptureAlpha = 1f; |
| 1454 } | 1454 } |
| 1455 } | 1455 } |
| 1456 | 1456 |
| 1457 // TODO(dtrainor): This is always true when in the tab switcher (crbug.com/7 10750). | |
| 1457 private boolean isTabSwitcherAnimationRunning() { | 1458 private boolean isTabSwitcherAnimationRunning() { |
| 1458 return mTabSwitcherState == ENTERING_TAB_SWITCHER | 1459 return mTabSwitcherState == ENTERING_TAB_SWITCHER |
| 1459 || mTabSwitcherState == EXITING_TAB_SWITCHER; | 1460 || mTabSwitcherState == EXITING_TAB_SWITCHER; |
| 1460 } | 1461 } |
| 1461 | 1462 |
| 1462 private void updateViewsForTabSwitcherMode() { | 1463 private void updateViewsForTabSwitcherMode() { |
| 1463 int tabSwitcherViewsVisibility = mTabSwitcherState != STATIC_TAB ? VISI BLE : INVISIBLE; | 1464 int tabSwitcherViewsVisibility = mTabSwitcherState != STATIC_TAB ? VISI BLE : INVISIBLE; |
| 1464 int browsingViewsVisibility = mTabSwitcherState != STATIC_TAB ? INVISIBL E : VISIBLE; | 1465 int browsingViewsVisibility = mTabSwitcherState != STATIC_TAB ? INVISIBL E : VISIBLE; |
| 1465 | 1466 |
| 1466 for (View view : mTabSwitcherModeViews) { | 1467 for (View view : mTabSwitcherModeViews) { |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2130 mToggleTabStackButton.setImageDrawable(mUseLightToolbarDrawables | 2131 mToggleTabStackButton.setImageDrawable(mUseLightToolbarDrawables |
| 2131 ? mTabSwitcherButtonDrawableLight : mTabSwitcherButtonDrawab le); | 2132 ? mTabSwitcherButtonDrawableLight : mTabSwitcherButtonDrawab le); |
| 2132 if (mTabSwitcherAnimationTabStackDrawable != null) { | 2133 if (mTabSwitcherAnimationTabStackDrawable != null) { |
| 2133 mTabSwitcherAnimationTabStackDrawable.setTint( | 2134 mTabSwitcherAnimationTabStackDrawable.setTint( |
| 2134 mUseLightToolbarDrawables ? mLightModeTint : mDarkModeTi nt); | 2135 mUseLightToolbarDrawables ? mLightModeTint : mDarkModeTi nt); |
| 2135 } | 2136 } |
| 2136 } | 2137 } |
| 2137 | 2138 |
| 2138 mMenuButton.setTint(mUseLightToolbarDrawables ? mLightModeTint : mDarkMo deTint); | 2139 mMenuButton.setTint(mUseLightToolbarDrawables ? mLightModeTint : mDarkMo deTint); |
| 2139 | 2140 |
| 2141 setMenuButtonHighlightDrawable(mHighlightingMenu); | |
| 2140 if (mShowMenuBadge && inOrEnteringStaticTab) { | 2142 if (mShowMenuBadge && inOrEnteringStaticTab) { |
| 2141 setAppMenuUpdateBadgeDrawable(mUseLightToolbarDrawables); | 2143 setAppMenuUpdateBadgeDrawable(mUseLightToolbarDrawables); |
| 2142 } | 2144 } |
| 2143 ColorStateList tint = mUseLightToolbarDrawables ? mLightModeTint : mDark ModeTint; | 2145 ColorStateList tint = mUseLightToolbarDrawables ? mLightModeTint : mDark ModeTint; |
| 2144 if (mIsHomeButtonEnabled) mHomeButton.setTint(tint); | 2146 if (mIsHomeButtonEnabled) mHomeButton.setTint(tint); |
| 2145 | 2147 |
| 2146 mLocationBar.updateVisualsForState(); | 2148 mLocationBar.updateVisualsForState(); |
| 2147 // Remove the side padding for incognito to ensure the badge icon aligns correctly with the | 2149 // Remove the side padding for incognito to ensure the badge icon aligns correctly with the |
| 2148 // background of the location bar. | 2150 // background of the location bar. |
| 2149 if (isIncognito) { | 2151 if (isIncognito) { |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 2173 | 2175 |
| 2174 getMenuButtonWrapper().setVisibility(View.VISIBLE); | 2176 getMenuButtonWrapper().setVisibility(View.VISIBLE); |
| 2175 } | 2177 } |
| 2176 | 2178 |
| 2177 @Override | 2179 @Override |
| 2178 public LocationBar getLocationBar() { | 2180 public LocationBar getLocationBar() { |
| 2179 return mLocationBar; | 2181 return mLocationBar; |
| 2180 } | 2182 } |
| 2181 | 2183 |
| 2182 @Override | 2184 @Override |
| 2185 public boolean useLightDrawables() { | |
| 2186 return mUseLightToolbarDrawables; | |
| 2187 } | |
| 2188 | |
| 2189 @Override | |
| 2190 protected void setMenuButtonHighlightDrawable(boolean highlighting) { | |
| 2191 System.out.println("dtrainor: tab switcher anim " + isTabSwitcherAnimati onRunning() + ", " | |
|
Ted C
2017/04/12 18:05:57
?
David Trainor- moved to gerrit
2017/04/12 18:59:37
Sorry... logging from figuring out why this wasn't
| |
| 2192 + highlighting); | |
| 2193 highlighting &= !isTabSwitcherAnimationRunning(); | |
| 2194 super.setMenuButtonHighlightDrawable(highlighting); | |
| 2195 } | |
| 2196 | |
| 2197 @Override | |
| 2183 public void showAppMenuUpdateBadge() { | 2198 public void showAppMenuUpdateBadge() { |
| 2184 super.showAppMenuUpdateBadge(); | 2199 super.showAppMenuUpdateBadge(); |
| 2185 | 2200 |
| 2186 // Set up variables. | 2201 // Set up variables. |
| 2187 if (!mBrowsingModeViews.contains(mMenuBadge)) { | 2202 if (!mBrowsingModeViews.contains(mMenuBadge)) { |
| 2188 mBrowsingModeViews.add(mMenuBadge); | 2203 mBrowsingModeViews.add(mMenuBadge); |
| 2189 } | 2204 } |
| 2190 | 2205 |
| 2191 // Finish any in-progress animations and set the TabSwitcherAnimationMen uBadgeDrawables. | 2206 // Finish any in-progress animations and set the TabSwitcherAnimationMen uBadgeDrawables. |
| 2192 finishAnimations(); | 2207 finishAnimations(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2271 }); | 2286 }); |
| 2272 | 2287 |
| 2273 if (mControlsVisibilityDelegate != null) { | 2288 if (mControlsVisibilityDelegate != null) { |
| 2274 mFullscreenCalloutToken = | 2289 mFullscreenCalloutToken = |
| 2275 mControlsVisibilityDelegate.showControlsPersistentAndClearOl dToken( | 2290 mControlsVisibilityDelegate.showControlsPersistentAndClearOl dToken( |
| 2276 mFullscreenCalloutToken); | 2291 mFullscreenCalloutToken); |
| 2277 } | 2292 } |
| 2278 } | 2293 } |
| 2279 } | 2294 } |
| 2280 | 2295 |
| OLD | NEW |