1c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell/*
2c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * Copyright (C) 2012 The Android Open Source Project
3c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell *
4c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * Licensed under the Apache License, Version 2.0 (the "License");
5c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * you may not use this file except in compliance with the License.
6c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * You may obtain a copy of the License at
7c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell *
8c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell *      http://www.apache.org/licenses/LICENSE-2.0
9c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell *
10c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * Unless required by applicable law or agreed to in writing, software
11c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * distributed under the License is distributed on an "AS IS" BASIS,
12c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * See the License for the specific language governing permissions and
14c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * limitations under the License.
15c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell */
16c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell
17c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powellpackage android.support.v4.view;
18c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell
190d4ffdf13a16b1ce2f3bc458002374cdd25663c3alanvimport android.os.Bundle;
20c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powellimport android.view.View;
21c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell
22c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell/**
23c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell * Jellybean-specific View API access
24c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell */
25c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powellpublic class ViewCompatJB {
26c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell
27c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell    public static boolean hasTransientState(View view) {
28c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell        return view.hasTransientState();
29c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell    }
30c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell
31c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell    public static void setHasTransientState(View view, boolean hasTransientState) {
32c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell        view.setHasTransientState(hasTransientState);
33c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell    }
34c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell
35ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    public static void postInvalidateOnAnimation(View view) {
36ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell        view.postInvalidateOnAnimation();
37ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    }
38ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell
39ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    public static void postInvalidateOnAnimation(View view, int left, int top,
40ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell            int right, int bottom) {
41ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell        view.postInvalidate(left, top, right, bottom);
42ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    }
43ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell
44ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    public static void postOnAnimation(View view, Runnable action) {
45ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell        view.postOnAnimation(action);
46ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    }
47ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell
48ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    public static void postOnAnimationDelayed(View view, Runnable action, long delayMillis) {
49ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell        view.postOnAnimationDelayed(action, delayMillis);
50ec03704fbb4f0217d4c274d1c6cf56e6ea4dcfbdAdam Powell    }
5125121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov
5225121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov    public static int getImportantForAccessibility(View view) {
5325121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov        return view.getImportantForAccessibility();
5425121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov    }
5525121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov
5625121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov    public static void setImportantForAccessibility(View view, int mode) {
5725121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov        view.setImportantForAccessibility(mode);
5825121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov    }
5925121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov
600d4ffdf13a16b1ce2f3bc458002374cdd25663c3alanv    public static boolean performAccessibilityAction(View view, int action, Bundle arguments) {
610d4ffdf13a16b1ce2f3bc458002374cdd25663c3alanv        return view.performAccessibilityAction(action, arguments);
620d4ffdf13a16b1ce2f3bc458002374cdd25663c3alanv    }
630d4ffdf13a16b1ce2f3bc458002374cdd25663c3alanv
6425121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov    public static Object getAccessibilityNodeProvider(View view) {
6525121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov        return view.getAccessibilityNodeProvider();
6625121559b53b9f6c7ef7159203d42e11b9aee281Svetoslav Ganov    }
67c95beb648f59c89c6bd7b0eed0a8b266a1b287e2Adam Powell}
68