179bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov/* 279bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * Copyright (C) 2015 The Android Open Source Project 379bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * 479bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * Licensed under the Apache License, Version 2.0 (the "License"); 579bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * you may not use this file except in compliance with the License. 679bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * You may obtain a copy of the License at 779bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * 879bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * http://www.apache.org/licenses/LICENSE-2.0 979bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * 1079bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * Unless required by applicable law or agreed to in writing, software 1179bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * distributed under the License is distributed on an "AS IS" BASIS, 1279bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1379bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * See the License for the specific language governing permissions and 1479bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov * limitations under the License. 1579bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov */ 16e8c9f7dbd2d75bce83410ce4b6bcf5c1c69a7cfbKirill Grouchnikovpackage android.support.v7.custom; 1779bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 1879bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikovimport android.content.Context; 1979bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikovimport android.os.Build; 2079bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikovimport android.util.AttributeSet; 2179bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikovimport android.view.View; 2279bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikovimport android.view.WindowInsets; 2379bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 2479bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikovimport android.support.v4.widget.DrawerLayout; 2579bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 2679bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikovpublic class CustomDrawerLayout extends DrawerLayout { 2779bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov private int mSystemWindowInsetTop; 2879bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 2979bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov public CustomDrawerLayout(Context context) { 3079bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov super(context); 3179bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov } 3279bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 3379bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov public CustomDrawerLayout(Context context, AttributeSet attrs) { 3479bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov super(context, attrs); 3579bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov } 3679bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 3779bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov public CustomDrawerLayout(Context context, AttributeSet attrs, int defStyle) { 3879bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov super(context, attrs, defStyle); 3979bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov } 4079bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 4179bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov public WindowInsets dispatchApplyWindowInsets(WindowInsets insets) { 4279bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov mSystemWindowInsetTop = insets.getSystemWindowInsetTop(); 4379bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov return super.dispatchApplyWindowInsets(insets); 4479bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov } 4579bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov 4679bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov public int getSystemWindowInsetTop() { 4779bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov return mSystemWindowInsetTop; 4879bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov } 4979bdaf9f66d9000feb54d8f4011fc412dd7829bcKirill Grouchnikov}