亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

annuaire recherche
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
personnages


InputConnection

版本:Android 2.3 r1

?

結(jié)構(gòu)

繼承關(guān)系

public interface InputConnection

????????

android.view.inputmethod.InputConnection

?

子類及間接子類

間接子類

BaseInputConnection, InputConnectionWrapper

?

類概述

InputConnection接口是接收輸入的應(yīng)用程序與InputMethod間的通訊通道。它可以完成以下功能,如讀取光標(biāo)周圍的文本,向文本框提交文本,向應(yīng)用程序提交原始按鍵事件。

?BaseInputConnection的子類應(yīng)實現(xiàn)這一接口。

?

常量

public static final int GET_EXTRACTED_TEXT_MONITOR

標(biāo)志,用在getExtractedText(ExtractedTextRequest, int)中,表示提取的文本變化時你想接收到更新。

常量值: 1 (0x00000001)

?

public static final int GET_TEXT_WITH_STYLES

標(biāo)志,用在getTextAfterCursor(int, int)getTextBeforeCursor(int, int)中,表明返回的文本中包含樣式。不設(shè)置時,你將僅接收原始文本。設(shè)置時,你將收到復(fù)合的CharSequence,包括文本和樣式段。

常量值: 1 (0x00000001)

?

公共方法

public abstract boolean beginBatchEdit ()

通知編輯器你將開始批量編輯操作。編輯器盡量避免向你發(fā)送狀態(tài)更新,直到調(diào)用endBatchEdit()為止。

?

public abstract boolean clearMetaKeyStates (int states)

在指定的輸入連接中清除指定的元鍵(meta key)按下狀態(tài)。

參數(shù)

states ??? 清除的狀態(tài),可以是KeyEvent.getMetaState()中的一位或多位結(jié)果。

返回值

??? ???????? 成功返回true,當(dāng)連接無效時返回flase

?

public abstract boolean commitCompletion (CompletionInfo text)

提交用戶的選擇,選擇先前向 InputMethodSession.displayCompletions()提交的選項中的一個。其結(jié)果就像用戶從實際UI中做出一樣。

參數(shù)

text ???????? 提交的結(jié)果。

返回值

??? ???????? 成功返回true,當(dāng)連接無效時返回flase。

?

public abstract boolean commitText (CharSequence text, int newCursorPosition)

向文本框提交文本并設(shè)置新的光標(biāo)位置。之前設(shè)置的正編輯文字將自動刪除。

參數(shù)

text ???????? 提交的文本。

newCursorPosition ???????? 文本范圍內(nèi)新的光標(biāo)位置。如果大于0,從提交文本末尾-1處計起;<= 0,提交文本開始處計起。所以值為1時,光標(biāo)將定位于你剛剛插入文本之后。注意你不能光標(biāo)定位于提交文本中,因為編輯器可以修改你提供的文本,所以不必將光標(biāo)定位在哪。

返回值

??? ???????? 成功返回true,當(dāng)連接無效時返回flase。

?

public abstract boolean deleteSurroundingText (int leftLength, int rightLength)

刪除當(dāng)前光標(biāo)前的leftLength個字符,并刪除當(dāng)前光標(biāo)后的rightLength個字符,不包聯(lián)想輸入(composing)的文字。

參數(shù)

leftLength ????? 刪除的當(dāng)前光標(biāo)之前字符個數(shù)。

rightLength ??? 刪除的當(dāng)前光標(biāo)之后字符個數(shù)。

返回值

??? ???????? 成功返回true,當(dāng)連接無效時返回flase

?

public abstract boolean endBatchEdit ()

調(diào)用endBatchEdit()方法通知編輯器之前開始的批量編輯已完成。

?

public abstract boolean finishComposingText ()

強制結(jié)束文本編輯器,無論聯(lián)想輸入(composing text)是否激活。文本保持不變,移除任何與此文本的編輯樣式或其他狀態(tài)。光標(biāo)保持不變。

?

public abstract int getCursorCapsMode (int reqModes)

取得當(dāng)前光標(biāo)位置的文本的大小寫狀態(tài)。參見TextUtils.getCapsMode 取得更多信息。此方法在輸入連接(connection)無效(如線程沖突)或客戶端等待時間過長(等待幾秒返回)時可能會失敗。上述情況時返回0。

參數(shù)

reqModes ????? 依據(jù)TextUtils.getCapsMode定義取得期望的狀態(tài)。通過已定義的常數(shù),你可以輕易地傳遞TextBoxAttribute.contentType當(dāng)前。

返回值

??? ???????? 返回當(dāng)前有效的大小寫狀態(tài)。

?

public abstract ExtractedText getExtractedText (ExtractedTextRequest request, int flags)

獲取當(dāng)前輸入連接的編輯器中的當(dāng)前文本,并監(jiān)視是否有變化。函數(shù)返回當(dāng)前文本,當(dāng)文本變化時輸入連接可選擇性向輸入法發(fā)送更新。

此方法在輸入聯(lián)接無效時(如線程沖突)或客戶端等待時間過長(等待幾秒返回)時可能會失敗。上述情況時返回null值。

參數(shù)

request ? 描述文本如何返回

flags ?????? 控制客戶端的附加選項,0GET_EXTRACTED_TEXT_MONITOR

返回值

??? ???????? 返回一個ExtractedText對象描述文本視窗的狀態(tài),及所包含的提取文本。

?

public abstract CharSequence getSelectedText (int flags)

如果有的話取得所選的文本。

此方法在輸入連接無效時(如線程沖突)或客戶端等待時間過長(等待幾秒返回)時可能會失敗。上述情況時返回null值。

參數(shù)

flags ?????? 提供附加選項控制,控制文本如何返回??蔀?/span>0 GET_TEXT_WITH_STYLES

返回值

??? ???????? 如果有的話返回當(dāng)前選取文本,如果沒有文本被選中返回null。

?

public abstract CharSequence getTextAfterCursor (int n, int flags)

取得當(dāng)前光標(biāo)位置后的 n 個字符文本。

此方法在輸入連接無效時(如線程沖突)或客戶端等待時間過長(等待幾秒返回)時可能會失敗。上述情況時返回null值。

參數(shù)

n ???? 期望的文本長度

flags ?????? 提供附加選項控制,控制文本如何返回??蔀?/span>0 GET_TEXT_WITH_STYLES

返回值

??? ???????? 返回當(dāng)前光標(biāo)后的文本,返回的文本長度可能小于 n

?

public abstract CharSequence getTextBeforeCursor (int n, int flags)

取得當(dāng)前光標(biāo)位置前的 n 個字符文本。

本此方法在輸入連接無效(如線程沖突)或客戶端等待時間過長(等待幾秒返回)時可能會失敗。上述情況時返回null值。

參數(shù)

n ???? 期望的文本長度

flags ?????? 提供附加選項控制,控制文本如何返回。可為0 GET_TEXT_WITH_STYLES

返回值

??? ???????? 返回當(dāng)前光標(biāo)前的文本,返回的文本長度可能小于 n

?

public abstract boolean performContextMenuAction (int id)

在區(qū)域中執(zhí)行調(diào)用上下文菜單動作,其id可能下列之一:selectAll, startSelectingText, stopSelectingText, cut, copy, paste, copyUrl, switchInputMethod。

?

public abstract boolean performEditorAction (int editorAction)

讓編輯器執(zhí)行一個它可以完成的操作。

參數(shù)

editorAction ? 必須是動作常量EditorInfo.editorType中的一個,如EditorInfo.EDITOR_ACTION_GO。

返回值

??? ???????? 成功返回true,如輸入連接無效返回false

?

public abstract boolean performPrivateCommand (String action, Bundle data)

API從輸入法向所連接的編輯器發(fā)送私有命令。這可用于提供僅用于特定輸入法及其客戶端功能的特定域(domain-specific)。注意,因為InputConnection協(xié)議是異步的,你無法取回結(jié)果或知道客戶端是否懂得命令;你可能使用 EditorInfo來確定客戶端是否支持某一命令。

參數(shù)

action ???? 要執(zhí)行的命令名稱。必須是作用域名,前綴你自己的包名,這樣不同的開發(fā)者就不會建立讓人沖突的命令。

data ??????? 命令中的數(shù)據(jù)

返回值

??? ???????? 當(dāng)命令發(fā)送后返回true(無論相關(guān)的編輯是否理解它),如輸入連接無效返回false。

?

public abstract boolean reportFullscreenMode (boolean enabled)

IME調(diào)用,通知客戶端將在全屏與普通模式間切換。它在 InputMethodService的標(biāo)準(zhǔn)實現(xiàn)中被調(diào)用。

?

public abstract boolean sendKeyEvent (KeyEvent event)

向當(dāng)前輸入連接所附著的進程發(fā)送按鍵事件。事件像普通按鍵事件一樣由當(dāng)前焦點,通常是提供InputConnection的視圖。但由于協(xié)議的異步性這一點并不總是這樣,焦點可能在事件收到時發(fā)生改變。

本方法可用于向應(yīng)用程序發(fā)送按鍵事件。如屏幕鍵盤可以用這一方法模擬硬件鍵盤。標(biāo)準(zhǔn)鍵盤有三種:數(shù)字(12鍵),預(yù)測鍵盤(20鍵)和字母(QWERTY)。你可以通過事件的設(shè)備碼(device id)確定鍵盤類型。

在你向本API發(fā)送的所有按鍵事件中,你可能希望設(shè)置KeyEvent.FLAG_SOFT_KEYBOARD標(biāo)志,但這一標(biāo)志不可設(shè)置。

參數(shù)

event ????? 按鍵事件

返回值

??? ???????? 成功返回true,當(dāng)輸入連接無效返回false。

???????? 參見

??? ???????? KeyEvent

??? ???????? NUMERIC

??? ???????? PREDICTIVE

??? ???????? ALPHA

?

public abstract boolean setComposingRegion (int start, int end)

將特定區(qū)域設(shè)為正在編輯文本。以前設(shè)置的正在編輯文本自動移除。文本使用默認(rèn)正在編輯文本樣式。(審核注:”composing text”的翻譯還需要后期用例子來推測其含義。)

參數(shù)

start ?????? 正在編輯文本開始的位置

end ???????? 正在編輯文本結(jié)束的位置。

返回值

??? ???????? 成功返回true,當(dāng)輸入聯(lián)接無效時返回false

?

public abstract boolean setComposingText (CharSequence text, int newCursorPosition)

將當(dāng)前的光標(biāo)旁正在聯(lián)想文本(composing text)替代為給定文本,并設(shè)置新光標(biāo)位置。以前設(shè)置的正在編輯文本自動移除。(譯者注:

InputConnection ic = getCurrentInputConnection();

ic.setComposingText("Composi", 1);

參數(shù)

text ???????? 如必要正在編輯文本有樣式。如文本沒有附帶樣式對象,正在編輯文本將應(yīng)用默認(rèn)樣式。見如何在文本上附加樣式{#link android.text.Spanned}。{#link android.text.SpannableString}{#link android.text.SpannableStringBuilder}是兩種界面實現(xiàn)方式。

newCursorPosition ???????? 文本范圍內(nèi)新的光標(biāo)位置。如果大于0,從提交文本末尾-1處計起;<= 0,提交文本開始處計起。所以值為1時,光標(biāo)將定位于你剛剛插入文本之后。注意你不能光標(biāo)定位于提交文本中,因為編輯器可以修改你提供的文本,所以不必將光標(biāo)定位在哪。

返回值

??? ???????? 成功返回true,當(dāng)輸入聯(lián)接無效時返回false。

?

public abstract boolean setSelection (int start, int end)

設(shè)置文本編輯器的選定文本。設(shè)置到當(dāng)前光標(biāo)時,開始與結(jié)束取相同值。

返回值

??? ???????? 成功返回true,當(dāng)輸入聯(lián)接無效時返回false。

?

補充

文章鏈接

android sdk softkeyboard的自己解析(4)

???????? 開源項目

?????????????????? wifikeyboard


Article précédent: Article suivant: