1bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell/* 2bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * Copyright (C) 2011 The Android Open Source Project 3bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * 4bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * Licensed under the Apache License, Version 2.0 (the "License"); 5bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * you may not use this file except in compliance with the License. 6bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * You may obtain a copy of the License at 7bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * 8bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * http://www.apache.org/licenses/LICENSE-2.0 9bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * 10bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * Unless required by applicable law or agreed to in writing, software 11bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * distributed under the License is distributed on an "AS IS" BASIS, 12bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * See the License for the specific language governing permissions and 14bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell * limitations under the License. 15bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell */ 16bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell 17bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powellpackage android.support.v4.view; 18bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell 19bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powellimport android.view.View; 209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.View.AccessibilityDelegate; 219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.accessibility.AccessibilityEvent; 229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.accessibility.AccessibilityNodeInfo; 23bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell 24bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell/** 259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Helper for accessing newer features in View introduced in ICS. 26bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell */ 27bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powellclass ViewCompatICS { 289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 29bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell public static boolean canScrollHorizontally(View v, int direction) { 30bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell return v.canScrollHorizontally(direction); 31bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell } 32bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell 33bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell public static boolean canScrollVertically(View v, int direction) { 34bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell return v.canScrollVertically(direction); 35bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell } 369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public static void setAccessibilityDelegate(View v, Object delegate) { 389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov v.setAccessibilityDelegate((AccessibilityDelegate) delegate); 399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public static void onPopulateAccessibilityEvent(View v, AccessibilityEvent event) { 429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov v.onPopulateAccessibilityEvent(event); 439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) { 469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov v.onInitializeAccessibilityEvent(event); 479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public static void onInitializeAccessibilityNodeInfo(View v, Object info) { 509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov v.onInitializeAccessibilityNodeInfo((AccessibilityNodeInfo) info); 519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 52bc889e39e279fcf8c3d35fc11d8052c002eddf38Adam Powell} 53