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.compositor.bottombar.readermode; | 5 package org.chromium.chrome.browser.compositor.bottombar.readermode; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 | 8 |
| 9 import org.chromium.chrome.R; | 9 import org.chromium.chrome.R; |
| 10 import org.chromium.chrome.browser.compositor.LayerTitleCache; | 10 import org.chromium.chrome.browser.compositor.LayerTitleCache; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 public float getOffsetY() { | 304 public float getOffsetY() { |
| 305 // Do not attempt to auto-hide the reader mode bar if the toolbar is les s than a certain | 305 // Do not attempt to auto-hide the reader mode bar if the toolbar is les s than a certain |
| 306 // height. | 306 // height. |
| 307 boolean shouldAutoHide = getToolbarHeight() >= getBarHeightPeeking(); | 307 boolean shouldAutoHide = getToolbarHeight() >= getBarHeightPeeking(); |
| 308 // This will cause the reader mode bar to behave like the top controls; sliding out of | 308 // This will cause the reader mode bar to behave like the top controls; sliding out of |
| 309 // view as the page scrolls. | 309 // view as the page scrolls. |
| 310 return super.getOffsetY() + (shouldAutoHide ? getTopControlsOffsetDp() : 0.0f); | 310 return super.getOffsetY() + (shouldAutoHide ? getTopControlsOffsetDp() : 0.0f); |
| 311 } | 311 } |
| 312 | 312 |
| 313 @Override | 313 @Override |
| 314 public void onSizeChanged(float width, float height) { | 314 public void onSizeChanged(float width, float height, float visibleViewportOf fsetY) { |
|
Changwan Ryu
2016/07/07 03:29:32
onLayoutChanged?
mdjones
2016/07/07 18:33:40
Done.
| |
| 315 super.onSizeChanged(width, height); | 315 super.onSizeChanged(width, height, visibleViewportOffsetY); |
| 316 if (mManagerDelegate != null) { | 316 if (mManagerDelegate != null) { |
| 317 mManagerDelegate.onSizeChanged(); | 317 mManagerDelegate.onSizeChanged(); |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 | 320 |
| 321 @Override | 321 @Override |
| 322 protected float calculateBasePageDesiredOffset() { | 322 protected float calculateBasePageDesiredOffset() { |
| 323 return -getToolbarHeight(); | 323 return -getToolbarHeight(); |
| 324 } | 324 } |
| 325 | 325 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 356 /** | 356 /** |
| 357 * Destroys the ReaderModeBarControl. | 357 * Destroys the ReaderModeBarControl. |
| 358 */ | 358 */ |
| 359 protected void destroyReaderModeBarControl() { | 359 protected void destroyReaderModeBarControl() { |
| 360 if (mReaderModeBarControl != null) { | 360 if (mReaderModeBarControl != null) { |
| 361 mReaderModeBarControl.destroy(); | 361 mReaderModeBarControl.destroy(); |
| 362 mReaderModeBarControl = null; | 362 mReaderModeBarControl = null; |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 } | 365 } |
| OLD | NEW |