1/* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.support.v4.view; 18 19import android.view.WindowInsets; 20 21class WindowInsetsCompatApi20 { 22 public static Object consumeSystemWindowInsets(Object insets) { 23 return ((WindowInsets) insets).consumeSystemWindowInsets(); 24 } 25 26 public static int getSystemWindowInsetBottom(Object insets) { 27 return ((WindowInsets) insets).getSystemWindowInsetBottom(); 28 } 29 30 public static int getSystemWindowInsetLeft(Object insets) { 31 return ((WindowInsets) insets).getSystemWindowInsetLeft(); 32 } 33 34 public static int getSystemWindowInsetRight(Object insets) { 35 return ((WindowInsets) insets).getSystemWindowInsetRight(); 36 } 37 38 public static int getSystemWindowInsetTop(Object insets) { 39 return ((WindowInsets) insets).getSystemWindowInsetTop(); 40 } 41 42 public static boolean hasInsets(Object insets) { 43 return ((WindowInsets) insets).hasInsets(); 44 } 45 46 public static boolean hasSystemWindowInsets(Object insets) { 47 return ((WindowInsets) insets).hasSystemWindowInsets(); 48 } 49 50 public static boolean isRound(Object insets) { 51 return ((WindowInsets) insets).isRound(); 52 } 53 54 public static Object replaceSystemWindowInsets(Object insets, int left, int top, int right, 55 int bottom) { 56 return ((WindowInsets) insets).replaceSystemWindowInsets(left, top, right, bottom); 57 } 58 59 public static Object getSourceWindowInsets(Object src) { 60 return new WindowInsets((WindowInsets) src); 61 } 62} 63