1c383a500aa59423264811be3874461bf8adbfea0Zonr Chang/* 20a813a3ef2a82f19d7eab9e23ae8493197143803Stephen Hines * Copyright (C) 2014 The Android Open Source Project 3c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * 4c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * Licensed under the Apache License, Version 2.0 (the "License"); 5c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * you may not use this file except in compliance with the License. 6c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * You may obtain a copy of the License at 7c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * 8c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * http://www.apache.org/licenses/LICENSE-2.0 9c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * 10c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * Unless required by applicable law or agreed to in writing, software 11c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * distributed under the License is distributed on an "AS IS" BASIS, 12c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * See the License for the specific language governing permissions and 14c383a500aa59423264811be3874461bf8adbfea0Zonr Chang * limitations under the License. 15c383a500aa59423264811be3874461bf8adbfea0Zonr Chang */ 16c383a500aa59423264811be3874461bf8adbfea0Zonr Chang 17e639eb5caa2c386b4a60659a4929e8a6141a2cbeStephen Hinespackage android.support.v4.view; 18e639eb5caa2c386b4a60659a4929e8a6141a2cbeStephen Hines 19462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liaoimport android.graphics.Rect; 20e639eb5caa2c386b4a60659a4929e8a6141a2cbeStephen Hines 21462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao/** 22e639eb5caa2c386b4a60659a4929e8a6141a2cbeStephen Hines * Describes a set of insets for window content. 23462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao * 24e639eb5caa2c386b4a60659a4929e8a6141a2cbeStephen Hines * <p>WindowInsetsCompats are immutable and may be expanded to include more inset types in the 25e639eb5caa2c386b4a60659a4929e8a6141a2cbeStephen Hines * future. To adjust insets, use one of the supplied clone methods to obtain a new 26be27482cdeaf08576bc39b72a15d35d13014a636Logan * WindowInsetsCompat instance with the adjusted properties.</p> 27462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao */ 28be27482cdeaf08576bc39b72a15d35d13014a636Loganpublic class WindowInsetsCompat { 299ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao 309ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao /** Private ctor */ 31462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao WindowInsetsCompat() {} 323fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines 333fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines /** 34462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao * Returns the left system window inset in pixels. 356315f76e3cc6ff2d012d1183a0b030d4ff0dc808zonr * 3623c4358f12bd9d0ba7166eceebd683db95a41b3fStephen Hines * <p>The system window inset represents the area of a full-screen window that is 379ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * partially or fully obscured by the status bar, navigation bar, IME or other system windows. 38462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao * </p> 39462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao * 406315f76e3cc6ff2d012d1183a0b030d4ff0dc808zonr * @return The left system window inset 416315f76e3cc6ff2d012d1183a0b030d4ff0dc808zonr */ 426315f76e3cc6ff2d012d1183a0b030d4ff0dc808zonr public int getSystemWindowInsetLeft() { 436315f76e3cc6ff2d012d1183a0b030d4ff0dc808zonr return 0; 446315f76e3cc6ff2d012d1183a0b030d4ff0dc808zonr } 459ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao 46462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao /** 47462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao * Returns the top system window inset in pixels. 48a41ce1d98094da84643995d40d71c529905123fcZonr Chang * 49a41ce1d98094da84643995d40d71c529905123fcZonr Chang * <p>The system window inset represents the area of a full-screen window that is 50a41ce1d98094da84643995d40d71c529905123fcZonr Chang * partially or fully obscured by the status bar, navigation bar, IME or other system windows. 51593a894650e81be54173106ec266f0311cebebd3Stephen Hines * </p> 52a41ce1d98094da84643995d40d71c529905123fcZonr Chang * 53462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao * @return The top system window inset 54462aefd62cc646d2ff753c1d003ef3cd7bbea26Shih-wei Liao */ 559ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao public int getSystemWindowInsetTop() { 569ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao return 0; 579ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 589ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao 599ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao /** 60a41ce1d98094da84643995d40d71c529905123fcZonr Chang * Returns the right system window inset in pixels. 619ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 629ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * <p>The system window inset represents the area of a full-screen window that is 63593a894650e81be54173106ec266f0311cebebd3Stephen Hines * partially or fully obscured by the status bar, navigation bar, IME or other system windows. 649ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * </p> 659ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 669ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return The right system window inset 679e5b503349719144f63ccb7c62ee9c291a7d83b8Stephen Hines */ 689e5b503349719144f63ccb7c62ee9c291a7d83b8Stephen Hines public int getSystemWindowInsetRight() { 693fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines return 0; 70c9454afec1649846512993d0ef65a9f868976bb4Chris Wailes } 71fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0Stephen Hines 729ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao /** 7323c4358f12bd9d0ba7166eceebd683db95a41b3fStephen Hines * Returns the bottom system window inset in pixels. 749ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 759ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * <p>The system window inset represents the area of a full-screen window that is 76a41ce1d98094da84643995d40d71c529905123fcZonr Chang * partially or fully obscured by the status bar, navigation bar, IME or other system windows. 77a41ce1d98094da84643995d40d71c529905123fcZonr Chang * </p> 789ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 799ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return The bottom system window inset 809ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao */ 819ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao public int getSystemWindowInsetBottom() { 829ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao return 0; 839ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 840a813a3ef2a82f19d7eab9e23ae8493197143803Stephen Hines 850a813a3ef2a82f19d7eab9e23ae8493197143803Stephen Hines /** 8696ab06cbe40b2d73c0eb614f814cd761d8962b6bStephen Hines * Returns true if this WindowInsets has nonzero system window insets. 8782754d87921c94e70562aa977cc92e28fc38b1d0Stephen Hines * 88be27482cdeaf08576bc39b72a15d35d13014a636Logan * <p>The system window inset represents the area of a full-screen window that is 8996ab06cbe40b2d73c0eb614f814cd761d8962b6bStephen Hines * partially or fully obscured by the status bar, navigation bar, IME or other system windows. 909ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * </p> 919ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 929ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return true if any of the system window inset values are nonzero 939ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao */ 94c17e198ffcd37bfc57e3add1f6eee952ae2a2eabStephen Hines public boolean hasSystemWindowInsets() { 95c17e198ffcd37bfc57e3add1f6eee952ae2a2eabStephen Hines return false; 969ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 979ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao 98593a894650e81be54173106ec266f0311cebebd3Stephen Hines /** 999ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * Returns true if this WindowInsets has any nonzero insets. 1009ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 1019ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return true if any inset values are nonzero 1029e5b503349719144f63ccb7c62ee9c291a7d83b8Stephen Hines */ 1039e5b503349719144f63ccb7c62ee9c291a7d83b8Stephen Hines public boolean hasInsets() { 1043fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines return false; 1054cc67fce91f43215d61b2695746eab102a3db516Stephen Hines } 106fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0Stephen Hines 107fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0Stephen Hines /** 1089ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * Check if these insets have been fully consumed. 1099e5b503349719144f63ccb7c62ee9c291a7d83b8Stephen Hines * 1109e5b503349719144f63ccb7c62ee9c291a7d83b8Stephen Hines * <p>Insets are considered "consumed" if the applicable <code>consume*</code> methods 111be27482cdeaf08576bc39b72a15d35d13014a636Logan * have been called such that all insets have been set to zero. This affects propagation of 112be27482cdeaf08576bc39b72a15d35d13014a636Logan * insets through the view hierarchy; insets that have not been fully consumed will continue 113f2174cfd6a556b51aadf2b8765e50df080e8f18eStephen Hines * to propagate down to child views.</p> 11423c4358f12bd9d0ba7166eceebd683db95a41b3fStephen Hines * 1159ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * <p>The result of this method is equivalent to the return value of 1169ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * {@link android.view.View#fitSystemWindows(android.graphics.Rect)}.</p> 1179e5b503349719144f63ccb7c62ee9c291a7d83b8Stephen Hines * 1189ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return true if the insets have been fully consumed. 1199207a2e495c8363606861e4f034504ec5c153dabLogan Chien */ 1202ef9bc0cfbca2152d972c0975005f8c897c2a42cStephen Hines public boolean isConsumed() { 1212ef9bc0cfbca2152d972c0975005f8c897c2a42cStephen Hines return false; 122c9454afec1649846512993d0ef65a9f868976bb4Chris Wailes } 1234a4bf92a8add68629a7e6e59ef81c3c3fe603a75Stephen Hines 1244a4bf92a8add68629a7e6e59ef81c3c3fe603a75Stephen Hines /** 1259ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * Returns true if the associated window has a round shape. 126fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0Stephen Hines * 127fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0Stephen Hines * <p>A round window's left, top, right and bottom edges reach all the way to the 128fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0Stephen Hines * associated edges of the window but the corners may not be visible. Views responding 129fc4f78b9c7941132fb048a83f0e4ba528c3b4fd0Stephen Hines * to round insets should take care to not lay out critical elements within the corners 1309ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * where they may not be accessible.</p> 1319ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 1329ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return True if the window is round 1339ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao */ 1349ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao public boolean isRound() { 1359ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao return false; 1369ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 1379ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao 1389ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao /** 1399ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * Returns a copy of this WindowInsets with the system window insets fully consumed. 1409ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 1419ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return A modified copy of this WindowInsets 142dde98533fad4c6534af537ae583aa4db35a1c699Tim Murray */ 1434cc67fce91f43215d61b2695746eab102a3db516Stephen Hines public WindowInsetsCompat consumeSystemWindowInsets() { 1444cc67fce91f43215d61b2695746eab102a3db516Stephen Hines return this; 1459ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 1460a813a3ef2a82f19d7eab9e23ae8493197143803Stephen Hines 1470a813a3ef2a82f19d7eab9e23ae8493197143803Stephen Hines /** 1480a813a3ef2a82f19d7eab9e23ae8493197143803Stephen Hines * Returns a copy of this WindowInsets with selected system window insets replaced 14912fc283f4108fd6f7f0164c121ff2f6fb5044225Jean-Luc Brouillet * with new values. 15012fc283f4108fd6f7f0164c121ff2f6fb5044225Jean-Luc Brouillet * 1510a813a3ef2a82f19d7eab9e23ae8493197143803Stephen Hines * @param left New left inset in pixels 152c808a99831115928b4648f4c8b86dc682594217aStephen Hines * @param top New top inset in pixels 153a41ce1d98094da84643995d40d71c529905123fcZonr Chang * @param right New right inset in pixels 154a41ce1d98094da84643995d40d71c529905123fcZonr Chang * @param bottom New bottom inset in pixels 155a41ce1d98094da84643995d40d71c529905123fcZonr Chang * @return A modified copy of this WindowInsets 156a41ce1d98094da84643995d40d71c529905123fcZonr Chang */ 157641558f02fe6ce0ee3ae5076eb366c25e2ad5903Zonr Chang public WindowInsetsCompat replaceSystemWindowInsets(int left, int top, int right, int bottom) { 158641558f02fe6ce0ee3ae5076eb366c25e2ad5903Zonr Chang return this; 159641558f02fe6ce0ee3ae5076eb366c25e2ad5903Zonr Chang } 160641558f02fe6ce0ee3ae5076eb366c25e2ad5903Zonr Chang 161641558f02fe6ce0ee3ae5076eb366c25e2ad5903Zonr Chang /** 162641558f02fe6ce0ee3ae5076eb366c25e2ad5903Zonr Chang * Returns a copy of this WindowInsets with selected system window insets replaced 163641558f02fe6ce0ee3ae5076eb366c25e2ad5903Zonr Chang * with new values. 1649ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 1659ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @param systemWindowInsets New system window insets. Each field is the inset in pixels 1669ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * for that edge 1679ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return A modified copy of this WindowInsets 1689ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao */ 1699ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao public WindowInsetsCompat replaceSystemWindowInsets(Rect systemWindowInsets) { 1709ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao return this; 1719ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 1729ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao 1739ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao /** 1749ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * Returns the top stable inset in pixels. 1759ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 1769ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * <p>The stable inset represents the area of a full-screen window that <b>may</b> be 1779ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * partially or fully obscured by the system UI elements. This value does not change 1789ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * based on the visibility state of those elements; for example, if the status bar is 1799ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * normally shown, but temporarily hidden, the stable inset will still provide the inset 1809ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * associated with the status bar being shown.</p> 1819ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 1829ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return The top stable inset 1839ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao */ 1849ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao public int getStableInsetTop() { 185593a894650e81be54173106ec266f0311cebebd3Stephen Hines return 0; 186593a894650e81be54173106ec266f0311cebebd3Stephen Hines } 187593a894650e81be54173106ec266f0311cebebd3Stephen Hines 188593a894650e81be54173106ec266f0311cebebd3Stephen Hines 189593a894650e81be54173106ec266f0311cebebd3Stephen Hines /** 190593a894650e81be54173106ec266f0311cebebd3Stephen Hines * Returns the left stable inset in pixels. 191593a894650e81be54173106ec266f0311cebebd3Stephen Hines * 192593a894650e81be54173106ec266f0311cebebd3Stephen Hines * <p>The stable inset represents the area of a full-screen window that <b>may</b> be 193593a894650e81be54173106ec266f0311cebebd3Stephen Hines * partially or fully obscured by the system UI elements. This value does not change 1949ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * based on the visibility state of those elements; for example, if the status bar is 1959ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * normally shown, but temporarily hidden, the stable inset will still provide the inset 1969ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * associated with the status bar being shown.</p> 1979ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 1989ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return The left stable inset 1999ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao */ 2009ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao public int getStableInsetLeft() { 2019ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao return 0; 2029ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 2039ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao 2049ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao /** 2059ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * Returns the right stable inset in pixels. 2069ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 2079ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * <p>The stable inset represents the area of a full-screen window that <b>may</b> be 2089ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * partially or fully obscured by the system UI elements. This value does not change 2099ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * based on the visibility state of those elements; for example, if the status bar is 2109ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * normally shown, but temporarily hidden, the stable inset will still provide the inset 2119ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * associated with the status bar being shown.</p> 2129ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * 2139ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao * @return The right stable inset 2149ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao */ 2159ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao public int getStableInsetRight() { 2169ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao return 0; 2179ef2f785e0cc490af678dfd685995dec787321ffShih-wei Liao } 21896ab06cbe40b2d73c0eb614f814cd761d8962b6bStephen Hines 21996ab06cbe40b2d73c0eb614f814cd761d8962b6bStephen Hines 22096ab06cbe40b2d73c0eb614f814cd761d8962b6bStephen Hines /** 22196ab06cbe40b2d73c0eb614f814cd761d8962b6bStephen Hines * Returns the bottom stable inset in pixels. 22296ab06cbe40b2d73c0eb614f814cd761d8962b6bStephen Hines * 22312fc283f4108fd6f7f0164c121ff2f6fb5044225Jean-Luc Brouillet * <p>The stable inset represents the area of a full-screen window that <b>may</b> be 22412fc283f4108fd6f7f0164c121ff2f6fb5044225Jean-Luc Brouillet * partially or fully obscured by the system UI elements. This value does not change 22512fc283f4108fd6f7f0164c121ff2f6fb5044225Jean-Luc Brouillet * based on the visibility state of those elements; for example, if the status bar is 22612fc283f4108fd6f7f0164c121ff2f6fb5044225Jean-Luc Brouillet * normally shown, but temporarily hidden, the stable inset will still provide the inset 22712fc283f4108fd6f7f0164c121ff2f6fb5044225Jean-Luc Brouillet * associated with the status bar being shown.</p> 22882754d87921c94e70562aa977cc92e28fc38b1d0Stephen Hines * 2293fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines * @return The bottom stable inset 2303fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines */ 2313fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines public int getStableInsetBottom() { 2323fd0a94a5cf1656569b1aea07043cc63939dcb46Stephen Hines return 0; 233d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet } 234ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray 235d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet /** 236ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * Returns true if this WindowInsets has nonzero stable insets. 237ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * 238ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * <p>The stable inset represents the area of a full-screen window that <b>may</b> be 239ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * partially or fully obscured by the system UI elements. This value does not change 240ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * based on the visibility state of those elements; for example, if the status bar is 241ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * normally shown, but temporarily hidden, the stable inset will still provide the inset 242d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet * associated with the status bar being shown.</p> 243ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * 244ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * @return true if any of the stable inset values are nonzero 245ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray */ 246ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray public boolean hasStableInsets() { 247ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray return false; 248ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray } 249ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray 250d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet /** 251d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet * Returns a copy of this WindowInsets with the stable insets fully consumed. 252d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet * 253ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray * @return A modified copy of this WindowInsetsCompat 254ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray */ 255ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray public WindowInsetsCompat consumeStableInsets() { 256d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet return this; 257ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray } 258ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray 259d3f7527b105d21f1c69d3473eb88a762f2c3ab5aJean-Luc Brouillet} 260ee4016d1247d3fbe50822de279d3da273d8aef4cTim Murray