本文整理汇总了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;
}
示例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));
}