當前位置: 首頁>>代碼示例>>Java>>正文


Java AccessibilityNodeInfoCompat.setClassName方法代碼示例

本文整理匯總了Java中android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.setClassName方法的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityNodeInfoCompat.setClassName方法的具體用法?Java AccessibilityNodeInfoCompat.setClassName怎麽用?Java AccessibilityNodeInfoCompat.setClassName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.view.accessibility.AccessibilityNodeInfoCompat的用法示例。


在下文中一共展示了AccessibilityNodeInfoCompat.setClassName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: copyNodeInfoNoChildren

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
/**
 * This should really be in AccessibilityNodeInfoCompat, but there unfortunately
 * seem to be a few elements that are not easily cloneable using the underlying API.
 * Leave it private here as it's not general-purpose useful.
 */
private void copyNodeInfoNoChildren(AccessibilityNodeInfoCompat dest,
    AccessibilityNodeInfoCompat src) {
  final Rect rect = mTmpRect;

  src.getBoundsInParent(rect);
  dest.setBoundsInParent(rect);

  src.getBoundsInScreen(rect);
  dest.setBoundsInScreen(rect);

  dest.setVisibleToUser(src.isVisibleToUser());
  dest.setPackageName(src.getPackageName());
  dest.setClassName(src.getClassName());
  dest.setContentDescription(src.getContentDescription());

  dest.setEnabled(src.isEnabled());
  dest.setClickable(src.isClickable());
  dest.setFocusable(src.isFocusable());
  dest.setFocused(src.isFocused());
  dest.setAccessibilityFocused(src.isAccessibilityFocused());
  dest.setSelected(src.isSelected());
  dest.setLongClickable(src.isLongClickable());

  dest.addAction(src.getActions());
}
 
開發者ID:rogues-dev,項目名稱:superglue,代碼行數:31,代碼來源:DebugDrawerLayout.java

示例2: copyNodeInfoNoChildren

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
private void copyNodeInfoNoChildren(AccessibilityNodeInfoCompat dest, AccessibilityNodeInfoCompat src) {
    Rect rect = this.mTmpRect;
    src.getBoundsInParent(rect);
    dest.setBoundsInParent(rect);
    src.getBoundsInScreen(rect);
    dest.setBoundsInScreen(rect);
    dest.setVisibleToUser(src.isVisibleToUser());
    dest.setPackageName(src.getPackageName());
    dest.setClassName(src.getClassName());
    dest.setContentDescription(src.getContentDescription());
    dest.setEnabled(src.isEnabled());
    dest.setClickable(src.isClickable());
    dest.setFocusable(src.isFocusable());
    dest.setFocused(src.isFocused());
    dest.setAccessibilityFocused(src.isAccessibilityFocused());
    dest.setSelected(src.isSelected());
    dest.setLongClickable(src.isLongClickable());
    dest.addAction(src.getActions());
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:20,代碼來源:DrawerLayout.java

示例3: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(TextInputLayout.class.getSimpleName());
    CharSequence text = TextInputLayout.this.mCollapsingTextHelper.getText();
    if (!TextUtils.isEmpty(text)) {
        info.setText(text);
    }
    if (TextInputLayout.this.mEditText != null) {
        info.setLabelFor(TextInputLayout.this.mEditText);
    }
    CharSequence error = TextInputLayout.this.mErrorView != null ? TextInputLayout.this.mErrorView.getText() : null;
    if (!TextUtils.isEmpty(error)) {
        info.setContentInvalid(true);
        info.setError(error);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:TextInputLayout.java

示例4: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(DirectionalViewpager.class.getName());
    info.setScrollable(canScroll());
    if (isHorizontal()) {
        if (canScrollHorizontally(1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        }
        if (canScrollHorizontally(-1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        }
    } else {
        if (internalCanScrollVertically(1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        }
        if (internalCanScrollVertically(-1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        }
    }
}
 
開發者ID:zwmlibs,項目名稱:BookReader-master,代碼行數:22,代碼來源:DirectionalViewpager.java

示例5: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    if (DrawerLayout.CAN_HIDE_DESCENDANTS) {
        super.onInitializeAccessibilityNodeInfo(host, info);
    } else {
        AccessibilityNodeInfoCompat superNode = AccessibilityNodeInfoCompat.obtain(info);
        super.onInitializeAccessibilityNodeInfo(host, superNode);
        info.setSource(host);
        ViewParent parent = ViewCompat.getParentForAccessibility(host);
        if (parent instanceof View) {
            info.setParent((View) parent);
        }
        copyNodeInfoNoChildren(info, superNode);
        superNode.recycle();
        addChildrenForAccessibility(info, (ViewGroup) host);
    }
    info.setClassName(DrawerLayout.class.getName());
    info.setFocusable(false);
    info.setFocused(false);
    info.removeAction(AccessibilityActionCompat.ACTION_FOCUS);
    info.removeAction(AccessibilityActionCompat.ACTION_CLEAR_FOCUS);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:22,代碼來源:DrawerLayout.java

示例6: onPopulateNodeForVirtualView

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
protected void onPopulateNodeForVirtualView(int virtualViewId, AccessibilityNodeInfoCompat node) {
    node.setClassName(getClass().getName());
    node.addAction(AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_CLICK);

    final int type = getTypeFromId(virtualViewId);
    final int value = getValueFromId(virtualViewId);
    final CharSequence description = getVirtualViewDescription(type, value);
    node.setContentDescription(description);

    getBoundsForVirtualView(virtualViewId, mTempRect);
    node.setBoundsInParent(mTempRect);

    final boolean selected = isVirtualViewSelected(type, value);
    node.setSelected(selected);

    final int nextId = getVirtualViewIdAfter(type, value);
    if (nextId != INVALID_ID) {
        node.setTraversalBefore(RadialTimePickerView.this, nextId);
    }
}
 
開發者ID:Gericop,項目名稱:DateTimePicker,代碼行數:22,代碼來源:RadialTimePickerView.java

示例7: copyNodeInfoNoChildren

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
/**
 * This should really be in AccessibilityNodeInfoCompat, but there unfortunately
 * seem to be a few elements that are not easily cloneable using the underlying API.
 * Leave it private here as it's not general-purpose useful.
 */
private void copyNodeInfoNoChildren(AccessibilityNodeInfoCompat dest,
                                    AccessibilityNodeInfoCompat src) {
    final Rect rect = mTmpRect;

    src.getBoundsInParent(rect);
    dest.setBoundsInParent(rect);

    src.getBoundsInScreen(rect);
    dest.setBoundsInScreen(rect);

    dest.setVisibleToUser(src.isVisibleToUser());
    dest.setPackageName(src.getPackageName());
    dest.setClassName(src.getClassName());
    dest.setContentDescription(src.getContentDescription());

    dest.setEnabled(src.isEnabled());
    dest.setClickable(src.isClickable());
    dest.setFocusable(src.isFocusable());
    dest.setFocused(src.isFocused());
    dest.setAccessibilityFocused(src.isAccessibilityFocused());
    dest.setSelected(src.isSelected());
    dest.setLongClickable(src.isLongClickable());

    dest.addAction(src.getActions());

    dest.setMovementGranularities(src.getMovementGranularities());
}
 
開發者ID:zhudongya123,項目名稱:WechatChatroomHelper,代碼行數:33,代碼來源:BGASwipeBackLayout.java

示例8: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    final AccessibilityNodeInfoCompat superNode = AccessibilityNodeInfoCompat.obtain(info);
    super.onInitializeAccessibilityNodeInfo(host, superNode);
    copyNodeInfoNoChildren(info, superNode);
    superNode.recycle();

    info.setClassName(ResideLayout.class.getName());
    info.setSource(host);

    final ViewParent parent = ViewCompat.getParentForAccessibility(host);
    if (parent instanceof View) {
        info.setParent((View) parent);
    }

    // This is a best-approximation of addChildrenForAccessibility()
    // that accounts for filtering.
    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);
        if (!filter(child) && (child.getVisibility() == View.VISIBLE)) {
            // Force importance to "yes" since we can't read the value.
            ViewCompat.setImportantForAccessibility(
                    child, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
            info.addChild(child);
        }
    }
}
 
開發者ID:Jusenr,項目名稱:AppFirCloud,代碼行數:29,代碼來源:ResideLayout.java

示例9: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(RecyclerView.class.getName());
    if (!shouldIgnore() && mRecyclerView.getLayoutManager() != null) {
        mRecyclerView.getLayoutManager().onInitializeAccessibilityNodeInfo(info);
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:9,代碼來源:RecyclerViewAccessibilityDelegate.java

示例10: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    final AccessibilityNodeInfoCompat superNode = AccessibilityNodeInfoCompat.obtain(info);
    super.onInitializeAccessibilityNodeInfo(host, superNode);
    copyNodeInfoNoChildren(info, superNode);
    superNode.recycle();

    info.setClassName(BGASwipeBackLayout.class.getName());
    info.setSource(host);

    final ViewParent parent = ViewCompat.getParentForAccessibility(host);
    if (parent instanceof View) {
        info.setParent((View) parent);
    }

    // This is a best-approximation of addChildrenForAccessibility()
    // that accounts for filtering.
    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);
        if (!filter(child) && (child.getVisibility() == View.VISIBLE)) {
            // Force importance to "yes" since we can't read the value.
            ViewCompat.setImportantForAccessibility(
                    child, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
            info.addChild(child);
        }
    }
}
 
開發者ID:zhudongya123,項目名稱:WechatChatroomHelper,代碼行數:29,代碼來源:BGASwipeBackLayout.java

示例11: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(ViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:smallsilver,項目名稱:VerticalWebView,代碼行數:13,代碼來源:VerticalParentViewPager.java

示例12: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(YViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:12,代碼來源:YViewPager.java

示例13: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(YViewPagerOrigin.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:13,代碼來源:YViewPagerOrigin.java

示例14: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(ViewPager.class.getName());
    info.setScrollable(canScroll());
    if (internalCanScrollVertically(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (internalCanScrollVertically(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:simplezhli,項目名稱:ChangeTabLayout,代碼行數:13,代碼來源:VerticalViewPager.java

示例15: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    final AccessibilityNodeInfoCompat superNode = AccessibilityNodeInfoCompat.obtain(info);
    super.onInitializeAccessibilityNodeInfo(host, superNode);
    copyNodeInfoNoChildren(info, superNode);
    superNode.recycle();

    info.setClassName(BGASwipeBackLayout2.class.getName());
    info.setSource(host);

    final ViewParent parent = ViewCompat.getParentForAccessibility(host);
    if (parent instanceof View) {
        info.setParent((View) parent);
    }

    // This is a best-approximation of addChildrenForAccessibility()
    // that accounts for filtering.
    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);
        if (!filter(child) && (child.getVisibility() == View.VISIBLE)) {
            // Force importance to "yes" since we can't read the value.
            ViewCompat.setImportantForAccessibility(
                    child, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
            info.addChild(child);
        }
    }
}
 
開發者ID:zhudongya123,項目名稱:WechatChatroomHelper,代碼行數:29,代碼來源:BGASwipeBackLayout2.java


注:本文中的android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.setClassName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。