diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt index b42587aae..855d82720 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt @@ -22,7 +22,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick class ATEAutoCompleteTextView(context: Context, attrs: AttributeSet) : AppCompatAutoCompleteTextView(context, attrs) { - var callBack: CallBack? = null + var delCallBack: DelCallBack? = null var showDel: Boolean = false init { @@ -48,12 +48,12 @@ class ATEAutoCompleteTextView(context: Context, attrs: AttributeSet) : performFiltering(text, KeyEvent.KEYCODE_UNKNOWN) } - fun setSelectValues(values: List, showDel: Boolean = false) { + fun setFilterValues(values: List, showDel: Boolean = false) { this.showDel = showDel setAdapter(MyAdapter(context, values)) } - fun setSelectValues(vararg value: String, showDel: Boolean = false) { + fun setFilterValues(vararg value: String, showDel: Boolean = false) { this.showDel = showDel setAdapter(MyAdapter(context, value.toMutableList())) } @@ -69,7 +69,7 @@ class ATEAutoCompleteTextView(context: Context, attrs: AttributeSet) : view.iv_delete.onClick { getItem(position)?.let { remove(it) - callBack?.delete(it) + delCallBack?.delete(it) performFiltering() } } @@ -77,7 +77,7 @@ class ATEAutoCompleteTextView(context: Context, attrs: AttributeSet) : } } - interface CallBack { + interface DelCallBack { fun delete(value: String) } }