mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-26 22:44:57 -04:00
Move field initialization outside the init block
This commit is contained in:
parent
6025aab5fc
commit
8fa8f40c83
@ -38,22 +38,19 @@ import org.kiwix.kiwixmobile.core.R
|
|||||||
class CompatFindActionModeCallback internal constructor(context: Context) :
|
class CompatFindActionModeCallback internal constructor(context: Context) :
|
||||||
ActionMode.Callback, TextWatcher, View.OnClickListener {
|
ActionMode.Callback, TextWatcher, View.OnClickListener {
|
||||||
private val tag = "CompatFindActionMode"
|
private val tag = "CompatFindActionMode"
|
||||||
@JvmField var isActive: Boolean
|
@JvmField var isActive: Boolean = false
|
||||||
|
|
||||||
@SuppressLint("InflateParams")
|
@SuppressLint("InflateParams")
|
||||||
private val customView: View = LayoutInflater.from(context).inflate(R.layout.webview_search, null)
|
private val customView: View = LayoutInflater.from(context).inflate(R.layout.webview_search, null)
|
||||||
private val editText: EditText
|
private val editText: EditText = customView.findViewById(R.id.edit)
|
||||||
private val findResultsTextView: TextView
|
private val findResultsTextView: TextView = customView.findViewById(R.id.find_results)
|
||||||
private var webView: WebView? = null
|
private var webView: WebView? = null
|
||||||
private val input: InputMethodManager
|
private val input: InputMethodManager =
|
||||||
|
context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
private var actionMode: ActionMode? = null
|
private var actionMode: ActionMode? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
editText = customView.findViewById(R.id.edit)
|
|
||||||
editText.setOnClickListener(this)
|
editText.setOnClickListener(this)
|
||||||
findResultsTextView = customView.findViewById(R.id.find_results)
|
|
||||||
input = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
|
||||||
isActive = false
|
|
||||||
setText("")
|
setText("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user