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


Java AccessibilityNodeInfo.addAction方法代碼示例

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


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

示例1: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@SuppressLint("Override")
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
	super.onInitializeAccessibilityNodeInfo(info);

	info.setClassName(AbsHListView.class.getName());
	if (isEnabled()) {
		if (getFirstVisiblePosition() > 0) {
			info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
		}
		if (getLastVisiblePosition() < getCount() - 1) {
			info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
		}
	}
}
 
開發者ID:junchenChow,項目名稱:exciting-app,代碼行數:17,代碼來源:AbsHListView.java

示例2: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
  super.onInitializeAccessibilityNodeInfo(info);
  info.setClassName(DefaultTimeBar.class.getCanonicalName());
  info.setContentDescription(getProgressText());
  if (duration <= 0) {
    return;
  }
  if (Util.SDK_INT >= 21) {
    info.addAction(AccessibilityAction.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityAction.ACTION_SCROLL_BACKWARD);
  } else if (Util.SDK_INT >= 16) {
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
  }
}
 
開發者ID:yangchaojiang,項目名稱:yjPlay,代碼行數:18,代碼來源:DefaultTimeBar.java

示例3: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.setClassName(com.google.android.exoplayer2.ui.DefaultTimeBar.class.getCanonicalName());
    info.setContentDescription(getProgressText());
    if (duration <= 0) {
        return;
    }
    if (Util.SDK_INT >= 21) {
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
    } else if (Util.SDK_INT >= 16) {
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:rubensousa,項目名稱:PreviewSeekBar,代碼行數:18,代碼來源:CustomTimeBar.java

示例4: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the circle.
 */
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
    info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
 
開發者ID:ttpho,項目名稱:TimePicker,代碼行數:11,代碼來源:RadialPickerLayout.java

示例5: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the circle.
 */
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    if (Build.VERSION.SDK_INT >= 14) {
        super.onInitializeAccessibilityNodeInfo(info);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:RadialPickerLayout.java

示例6: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);

    int index = mWorkspace.indexOfChild(host);
    if (index < mWorkspace.getChildCount() - 1) {
        info.addAction(mActions.get(MOVE_FORWARD));
    }

    int startIndex = mWorkspace.numCustomPages();
    if (index > startIndex) {
        info.addAction(mActions.get(MOVE_BACKWARD));
    }
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:15,代碼來源:OverviewScreenAccessibilityDelegate.java

示例7: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);

    Context context = host.getContext();
    info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW)));

    if (Utilities.isWallpaperAllowed(context)) {
        info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS)));
    }
    info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS)));
    info.addAction(new AccessibilityAction(SETTINGS, context.getText(SETTINGS)));
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:14,代碼來源:OverviewAccessibilityDelegate.java

示例8: addSupportedActions

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@Override
public void addSupportedActions(View host, AccessibilityNodeInfo info, boolean fromKeyboard) {
    if ((host.getParent() instanceof DeepShortcutView)) {
        info.addAction(mActions.get(ADD_TO_WORKSPACE));
    } else if (host instanceof NotificationMainView) {
        NotificationMainView notificationView = (NotificationMainView) host;
        if (notificationView.canChildBeDismissed(notificationView)) {
            info.addAction(mActions.get(DISMISS_NOTIFICATION));
        }
    }
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:12,代碼來源:ShortcutMenuAccessibilityDelegate.java

示例9: addSupportedActions

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
public void addSupportedActions(View host, AccessibilityNodeInfo info, boolean fromKeyboard) {
    if (!(host.getTag() instanceof ItemInfo)) return;
    ItemInfo item = (ItemInfo) host.getTag();

    // If the request came from keyboard, do not add custom shortcuts as that is already
    // exposed as a direct shortcut
    if (!fromKeyboard && DeepShortcutManager.supportsShortcuts(item)) {
        info.addAction(mActions.get(DEEP_SHORTCUTS));
    }

    if (DeleteDropTarget.supportsAccessibleDrop(item)) {
        info.addAction(mActions.get(REMOVE));
    }
    if (UninstallDropTarget.supportsDrop(host.getContext(), item)) {
        info.addAction(mActions.get(UNINSTALL));
    }

    // Do not add move actions for keyboard request as this uses virtual nodes.
    if (!fromKeyboard && ((item instanceof ShortcutInfo)
            || (item instanceof LauncherAppWidgetInfo)
            || (item instanceof FolderInfo))) {
        info.addAction(mActions.get(MOVE));

        if (item.container >= 0) {
            info.addAction(mActions.get(MOVE_TO_WORKSPACE));
        } else if (item instanceof LauncherAppWidgetInfo) {
            if (!getSupportedResizeActions(host, (LauncherAppWidgetInfo) item).isEmpty()) {
                info.addAction(mActions.get(RESIZE));
            }
        }
    }

    if ((item instanceof AppInfo) || (item instanceof PendingAddItemInfo)) {
        info.addAction(mActions.get(ADD_TO_WORKSPACE));
    }
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:37,代碼來源:LauncherAccessibilityDelegate.java

示例10: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);

    int index = mWorkspace.indexOfChild(host);
    if (index < mWorkspace.getChildCount() - 1) {
        info.addAction(mActions.get(MOVE_FORWARD));
    }

    int startIndex = mWorkspace.numCustomPages() + (FeatureFlags.QSB_ON_FIRST_SCREEN ? 1 : 0);
    if (index > startIndex) {
        info.addAction(mActions.get(MOVE_BACKWARD));
    }
}
 
開發者ID:TeamBrainStorm,項目名稱:SimpleUILauncher,代碼行數:15,代碼來源:OverviewScreenAccessibilityDelegate.java

示例11: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the circle.
 */
@Override
@SuppressWarnings("deprecation")
public void onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    if(Build.VERSION.SDK_INT >= 21) {
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
    }
    else {
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:18,代碼來源:RadialPickerLayout.java

示例12: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * Necessary for accessibility, to ensure we support "scrolling" forward and backward
 * in the month list.
 */
@Override
@SuppressWarnings("deprecation")
public void onInitializeAccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    if(Build.VERSION.SDK_INT >= 21) {
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
        info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
    }
    else {
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
        info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:18,代碼來源:DayPickerView.java

示例13: createAccessibiltyNodeInfoForInputText

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
private AccessibilityNodeInfo createAccessibiltyNodeInfoForInputText() {
    AccessibilityNodeInfo info = mInputText.createAccessibilityNodeInfo();
    info.setSource(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT);
    if (mAccessibilityFocusedView != VIRTUAL_VIEW_ID_INPUT) {
        info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
    }
    if (mAccessibilityFocusedView == VIRTUAL_VIEW_ID_INPUT) {
        info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
    }
    return info;
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:12,代碼來源:NumberPicker.java

示例14: createAccessibilityNodeInfoForVirtualButton

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
        String text, int left, int top, int right, int bottom) {
    AccessibilityNodeInfo info = AccessibilityNodeInfo.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);
    // TODO 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(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
    }
    if (mAccessibilityFocusedView == virtualViewId) {
        info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
    }
    if (NumberPicker.this.isEnabled()) {
        info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
    }

    return info;
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:34,代碼來源:NumberPicker.java

示例15: onInitializeAccessibilityNodeInfo

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);

    Context context = host.getContext();
    info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW)));

    if (Utilities.isWallapaperAllowed(context)) {
        info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS)));
    }
    info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS)));
    info.addAction(new AccessibilityAction(SETTINGS, context.getText(SETTINGS)));
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:14,代碼來源:OverviewAccessibilityDelegate.java


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