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


Java AccessibilityNodeInfoCompat.addAction方法代碼示例

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


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

示例1: 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:ynztlxdeai,項目名稱:TextReader,代碼行數:22,代碼來源:DirectionalViewpager.java

示例2: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@SuppressLint("NewApi")
@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:benniaobuguai,項目名稱:android-project-gallery,代碼行數:14,代碼來源:ViewPagerCompat.java

示例3: 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:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:VerticalViewPager.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(VelocityViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:reyanshmishra,項目名稱:Rey-MusicPlayer,代碼行數:13,代碼來源:VelocityViewPager.java

示例5: createAccessibilityNodeInfoForVirtualButton

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
                                                                          String text, int left, int top, int right, int bottom) {
    AccessibilityNodeInfoCompat info = AccessibilityNodeInfoCompat.obtain();
    info.setClassName(Button.class.getName());
    info.setPackageName(getContext().getPackageName());
    info.setSource(NumberPicker.this, virtualViewId);
    info.setParent(NumberPicker.this);
    info.setText(text);
    info.setClickable(true);
    info.setLongClickable(true);
    info.setEnabled(NumberPicker.this.isEnabled());
    Rect boundsInParent = mTempRect;
    boundsInParent.set(left, top, right, bottom);
    info.setVisibleToUser(isVisibleToUser(boundsInParent));
    info.setBoundsInParent(boundsInParent);
    Rect boundsInScreen = boundsInParent;
    int[] locationOnScreen = mTempArray;
    getLocationOnScreen(locationOnScreen);
    boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
    info.setBoundsInScreen(boundsInScreen);

    if (mAccessibilityFocusedView != virtualViewId) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS);
    }
    if (mAccessibilityFocusedView == virtualViewId) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
    }
    if (NumberPicker.this.isEnabled()) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_CLICK);
    }

    return info.unwrap();
}
 
開發者ID:Gericop,項目名稱:DateTimePicker,代碼行數:34,代碼來源:NumberPicker.java

示例6: onPopulateNodeForVirtualView

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

    node.setContentDescription(getItemDescription(virtualViewId));
    node.setBoundsInParent(mTempRect);
    node.addAction(AccessibilityNodeInfo.ACTION_CLICK);

    if (virtualViewId == mSelectedDay) {
        node.setSelected(true);
    }

}
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:15,代碼來源:MonthView.java

示例7: onPopulateNodeForVirtualView

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
protected void onPopulateNodeForVirtualView(int virtualViewId, AccessibilityNodeInfoCompat node) {
    final boolean hasBounds = getBoundsForDay(virtualViewId, mTempRect);

    if (!hasBounds) {
        // The day is invalid, kill the node.
        mTempRect.setEmpty();
        node.setContentDescription("");
        node.setBoundsInParent(mTempRect);
        node.setVisibleToUser(false);
        return;
    }

    node.setText(getDayText(virtualViewId));
    node.setContentDescription(getDayDescription(virtualViewId));
    node.setBoundsInParent(mTempRect);

    final boolean isDayEnabled = isDayEnabled(virtualViewId);
    if (isDayEnabled) {
        //node.addAction(AccessibilityAction.ACTION_CLICK);
        node.addAction(AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_CLICK);
    }

    node.setEnabled(isDayEnabled);

    if (virtualViewId == mActivatedDay) {
        // TODO: This should use activated once that's supported.
        node.setChecked(true);
    }
}
 
開發者ID:Gericop,項目名稱:DateTimePicker,代碼行數:31,代碼來源:SimpleMonthView.java

示例8: 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:Jusenr,項目名稱:RX_Demo,代碼行數:33,代碼來源: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(XCCycleViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:ruiqiao2017,項目名稱:Renrentou,代碼行數:13,代碼來源:XCCycleViewPager.java

示例10: 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

示例11: 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

示例12: 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

示例13: onPopulateNodeForVirtualView

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
protected void onPopulateNodeForVirtualView(int id, AccessibilityNodeInfoCompat node) {
    if (id == INVALID_ID) {
        throw new IllegalArgumentException("Invalid virtual view id");
    }

    node.setContentDescription(getLocationDescriptionForIconDrop(id));
    node.setBoundsInParent(getItemBounds(id));

    node.addAction(AccessibilityNodeInfoCompat.ACTION_CLICK);
    node.setClickable(true);
    node.setFocusable(true);
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:14,代碼來源:DragAndDropAccessibilityDelegate.java

示例14: createAccessibilityNodeInfoForVirtualButton

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
private AccessibilityNodeInfoCompat createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
                                                                                String text, int left, int top, int right, int bottom) {
    AccessibilityNodeInfoCompat info = AccessibilityNodeInfoCompat.obtain();
    info.setClassName(Button.class.getName());
    info.setPackageName(getContext().getPackageName());
    info.setSource(mNumberPicker, virtualViewId);
    info.setParent(mNumberPicker);
    info.setText(text);
    info.setClickable(true);
    info.setLongClickable(true);
    info.setEnabled(isEnabled());
    Rect boundsInParent = mTempRect;
    boundsInParent.set(left, top, right, bottom);
    info.setVisibleToUser(isVisibleToUser(boundsInParent));
    info.setBoundsInParent(boundsInParent);
    Rect boundsInScreen = boundsInParent;
    int[] locationOnScreen = mTempArray;
    mNumberPicker.getLocationOnScreen(locationOnScreen);
    boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
    info.setBoundsInScreen(boundsInScreen);
    if (mAccessibilityFocusedView != virtualViewId) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS);
    }
    if (mAccessibilityFocusedView == virtualViewId) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
    }
    if (isEnabled()) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_CLICK);
    }
    return info;
}
 
開發者ID:h6ah4i,項目名稱:android-numberpickercompat,代碼行數:32,代碼來源:AccessibilityNodeProviderImpl.java

示例15: onInitializeAccessibilityNodeInfo

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


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