1/* 2 * Copyright (C) 2012 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.graphics.drawable.Drawable; 20import android.os.Bundle; 21import android.view.View; 22import android.view.ViewParent; 23 24/** 25 * Jellybean-specific View API access 26 */ 27class ViewCompatJB { 28 29 public static boolean hasTransientState(View view) { 30 return view.hasTransientState(); 31 } 32 33 public static void setHasTransientState(View view, boolean hasTransientState) { 34 view.setHasTransientState(hasTransientState); 35 } 36 37 public static void postInvalidateOnAnimation(View view) { 38 view.postInvalidateOnAnimation(); 39 } 40 41 public static void postInvalidateOnAnimation(View view, int left, int top, 42 int right, int bottom) { 43 view.postInvalidate(left, top, right, bottom); 44 } 45 46 public static void postOnAnimation(View view, Runnable action) { 47 view.postOnAnimation(action); 48 } 49 50 public static void postOnAnimationDelayed(View view, Runnable action, long delayMillis) { 51 view.postOnAnimationDelayed(action, delayMillis); 52 } 53 54 public static int getImportantForAccessibility(View view) { 55 return view.getImportantForAccessibility(); 56 } 57 58 public static void setImportantForAccessibility(View view, int mode) { 59 view.setImportantForAccessibility(mode); 60 } 61 62 public static boolean performAccessibilityAction(View view, int action, Bundle arguments) { 63 return view.performAccessibilityAction(action, arguments); 64 } 65 66 public static Object getAccessibilityNodeProvider(View view) { 67 return view.getAccessibilityNodeProvider(); 68 } 69 70 public static ViewParent getParentForAccessibility(View view) { 71 return view.getParentForAccessibility(); 72 } 73 74 public static int getMinimumWidth(View view) { 75 return view.getMinimumWidth(); 76 } 77 78 public static int getMinimumHeight(View view) { 79 return view.getMinimumHeight(); 80 } 81 82 public static void requestApplyInsets(View view) { 83 view.requestFitSystemWindows(); 84 } 85 86 public static boolean getFitsSystemWindows(View view) { 87 return view.getFitsSystemWindows(); 88 } 89 90 public static boolean hasOverlappingRendering(View view) { 91 return view.hasOverlappingRendering(); 92 } 93 94 public static void setBackground(View view, Drawable drawable) { 95 view.setBackground(drawable); 96 } 97} 98