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.transition;
18
19import android.os.Build;
20import android.support.annotation.NonNull;
21import android.view.ViewGroup;
22
23/**
24 * Compatibility utilities for platform features of {@link ViewGroup}.
25 */
26class ViewGroupUtils {
27
28    private static final ViewGroupUtilsImpl IMPL;
29
30    static {
31        if (Build.VERSION.SDK_INT >= 18) {
32            IMPL = new ViewGroupUtilsApi18();
33        } else {
34            IMPL = new ViewGroupUtilsApi14();
35        }
36    }
37
38    /**
39     * Backward-compatible {@link ViewGroup#getOverlay()}.
40     */
41    static ViewGroupOverlayImpl getOverlay(@NonNull ViewGroup group) {
42        return IMPL.getOverlay(group);
43    }
44
45    /**
46     * Provides access to the hidden ViewGroup#suppressLayout method.
47     */
48    static void suppressLayout(@NonNull ViewGroup group, boolean suppress) {
49        IMPL.suppressLayout(group, suppress);
50    }
51
52}
53