本文整理汇总了Java中com.googlecode.eyesfree.braille.selfbraille.WriteData.setSelectionEnd方法的典型用法代码示例。如果您正苦于以下问题:Java WriteData.setSelectionEnd方法的具体用法?Java WriteData.setSelectionEnd怎么用?Java WriteData.setSelectionEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.eyesfree.braille.selfbraille.WriteData
的用法示例。
在下文中一共展示了WriteData.setSelectionEnd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendBrailleText
import com.googlecode.eyesfree.braille.selfbraille.WriteData; //导入方法依赖的package包/类
private static void sendBrailleText(final View view, final String text, final int selectionStart, final int selectionEnd) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain(view, VIRTUAL_CURSOR_POSITION);
WriteData data = WriteData.forInfo(info);
data.setText(text);
// Set either the focus blink or the current caret position/selection
data.setSelectionStart(selectionStart);
data.setSelectionEnd(selectionEnd);
sSelfBrailleClient.write(data);
}
示例2: braille
import com.googlecode.eyesfree.braille.selfbraille.WriteData; //导入方法依赖的package包/类
@JavascriptInterface
@SuppressWarnings("unused")
public void braille(String jsonString) {
try {
JSONObject jsonObj = new JSONObject(jsonString);
WriteData data = WriteData.forView(mView);
data.setText(jsonObj.getString("text"));
data.setSelectionStart(jsonObj.getInt("startIndex"));
data.setSelectionEnd(jsonObj.getInt("endIndex"));
mSelfBrailleClient.write(data);
} catch (JSONException ex) {
Log.w(TAG, "Error parsing JS JSON object", ex);
}
}