OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.fullscreen; | 5 package org.chromium.chrome.browser.fullscreen; |
6 | 6 |
7 import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN; | 7 import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN; |
8 import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; | 8 import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; |
9 import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE; | 9 import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE; |
10 | 10 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 if ((bottom - top) <= (oldBottom - oldTop)) return; | 291 if ((bottom - top) <= (oldBottom - oldTop)) return; |
292 if (mDelegate.shouldShowNotificationToast()) { | 292 if (mDelegate.shouldShowNotificationToast()) { |
293 showNotificationToast(); | 293 showNotificationToast(); |
294 } | 294 } |
295 contentView.removeOnLayoutChangeListener(this); | 295 contentView.removeOnLayoutChangeListener(this); |
296 } | 296 } |
297 }; | 297 }; |
298 contentView.addOnLayoutChangeListener(mFullscreenOnLayoutChangeListener)
; | 298 contentView.addOnLayoutChangeListener(mFullscreenOnLayoutChangeListener)
; |
299 contentView.setSystemUiVisibility(systemUiVisibility); | 299 contentView.setSystemUiVisibility(systemUiVisibility); |
300 | 300 |
| 301 // Request a layout so the updated system visibility takes affect. |
| 302 contentView.getRootView().requestLayout(); |
| 303 |
301 mContentViewCoreInFullscreen = contentViewCore; | 304 mContentViewCoreInFullscreen = contentViewCore; |
302 mTabInFullscreen = tab; | 305 mTabInFullscreen = tab; |
303 } | 306 } |
304 | 307 |
305 /** | 308 /** |
306 * Create and show the fullscreen notification toast. | 309 * Create and show the fullscreen notification toast. |
307 */ | 310 */ |
308 private void showNotificationToast() { | 311 private void showNotificationToast() { |
309 if (mNotificationToast == null) { | 312 if (mNotificationToast == null) { |
310 int resId = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) | 313 int resId = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 private static int getExtraFullscreenUIFlags() { | 364 private static int getExtraFullscreenUIFlags() { |
362 int flags = 0; | 365 int flags = 0; |
363 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | 366 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
364 flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; | 367 flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; |
365 flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; | 368 flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; |
366 flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; | 369 flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; |
367 } | 370 } |
368 return flags; | 371 return flags; |
369 } | 372 } |
370 } | 373 } |
OLD | NEW |