Android EditText 監聽輸入完成

1 EditText 添加TextChangedListener

在 TextWatcher中的 afterTextChanged 回調中添加 延遲處理的線程
editRunable 爲 輸入完成觸發的任務

 override fun afterTextChanged(s: Editable) {
 if (editRunable != null) {
                    handler.removeCallbacks(editRunable)
                }              handler.postDelayed(editRunable,800)
}

2 軟鍵盤的監聽

軟鍵盤監聽難度 等同於 app 包活

github gay友提供的庫

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章