Commit 522d11b2 authored by wanglei's avatar wanglei

...

parent 21acec49
package com.base.browserwhite.ui.fragment package com.base.browserwhite.ui.fragment
import android.content.Intent import android.content.Intent
import android.view.KeyEvent
import android.view.inputmethod.EditorInfo.IME_ACTION_DONE
import android.widget.TextView
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
...@@ -147,11 +150,23 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() { ...@@ -147,11 +150,23 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
// } // }
} }
// binding.editWeb.setOnEditorActionListener { v, actionId, event -> binding.editWeb.setOnEditorActionListener(object : TextView.OnEditorActionListener {
// if (actionId == EditorInfo.IME_ACTION_DONE){ override fun onEditorAction(v: TextView?, actionId: Int, event: KeyEvent?): Boolean {
// return true; // 返回true表示事件已处理 if (actionId == IME_ACTION_DONE) {
// } requireActivity().startActivity(Intent(requireContext(), WebBrowserActivity::class.java).apply {
// }
val base = "https://www.google.com/"
val content = v?.text
val search = "search?q=${content}&oq=${content}"
putExtra("uri", "$base$search")
})
return true; // 返回true表示事件已处理
}
return false
}
})
binding.flScan.setOnClickListener { binding.flScan.setOnClickListener {
requireContext().startActivity(Intent(requireContext(), ScanQRCActivity::class.java)) requireContext().startActivity(Intent(requireContext(), ScanQRCActivity::class.java))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment