当前位置: 首页>>代码示例>>Java>>正文


Java Utilities.sendCustomAccessibilityEvent方法代码示例

本文整理汇总了Java中com.android.launcher3.Utilities.sendCustomAccessibilityEvent方法的典型用法代码示例。如果您正苦于以下问题:Java Utilities.sendCustomAccessibilityEvent方法的具体用法?Java Utilities.sendCustomAccessibilityEvent怎么用?Java Utilities.sendCustomAccessibilityEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.launcher3.Utilities的用法示例。


在下文中一共展示了Utilities.sendCustomAccessibilityEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doneEditingFolderName

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public void doneEditingFolderName(boolean commit) {
    mFolderName.setHint(sHintText);
    // Convert to a string here to ensure that no other state associated with the text field
    // gets saved.
    String newTitle = mFolderName.getText().toString();
    mInfo.setTitle(newTitle);
    LauncherModel.updateItemInDatabase(mLauncher, mInfo);

    if (commit) {
        Utilities.sendCustomAccessibilityEvent(
                this, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED,
                getContext().getString(R.string.folder_renamed, newTitle));
    }

    // This ensures that focus is gained every time the field is clicked, which selects all
    // the text and brings up the soft keyboard if necessary.
    mFolderName.clearFocus();

    Selection.setSelection((Spannable) mFolderName.getText(), 0, 0);
    mIsEditingName = false;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:22,代码来源:Folder.java

示例2: sendTapOutsideFolderAccessibilityEvent

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
private void sendTapOutsideFolderAccessibilityEvent(boolean isEditingName) {
    int stringId = isEditingName ? R.string.folder_tap_to_rename : R.string.folder_tap_to_close;
    Utilities.sendCustomAccessibilityEvent(
            this, AccessibilityEvent.TYPE_VIEW_FOCUSED, getContext().getString(stringId));
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:6,代码来源:DragLayer.java


注:本文中的com.android.launcher3.Utilities.sendCustomAccessibilityEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。