Commit e2c14a91 authored by wanglei's avatar wanglei

...

parent 8f439292
......@@ -18,7 +18,6 @@ import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.lifecycleScope
......@@ -42,7 +41,6 @@ import com.base.browserwhite.utils.BarUtils.setStatusBarLightMode
import com.base.browserwhite.utils.LinkSearchUtils
import com.base.browserwhite.utils.LogEx
import com.base.browserwhite.utils.SpBeanUtils
import com.base.browserwhite.utils.SpBeanUtils.HISTORY_SP_KEY
import com.base.browserwhite.utils.SpBeanUtils.SEARCH_RECORD_SP_KEY
import com.base.browserwhite.utils.Utils
import com.base.browserwhite.utils.Utils.dpToPx
......@@ -97,7 +95,7 @@ class SearchActivity : BaseActivity<ActivitySearchBinding>() {
RxBus.get().post(CHANGE_SEARCH_URL, link)
setResult(10087)
}
// RxBus.get().post(Constants.RESET_SEARCH_VIEW, 1)
RxBus.get().post(Constants.RESET_SEARCH_VIEW, 1)
finish()
overridePendingTransition(0, 0)
}
......@@ -189,6 +187,9 @@ class SearchActivity : BaseActivity<ActivitySearchBinding>() {
querySearchTip(it.toString())
}
binding.editWeb.setOnFocusChangeListener { v, hasFocus ->
if (hasFocus) {
binding.editWeb.selectAll()
}
}
binding.editWeb.setOnEditorActionListener { v, actionId, event ->
......@@ -219,9 +220,6 @@ class SearchActivity : BaseActivity<ActivitySearchBinding>() {
}, 400)
binding.editWeb.setOnClickListener {
binding.editWeb.selectAll()
}
binding.ivClear.setOnClickListener {
binding.editWeb.setText("")
searchAdapter.submitList(listOf())
......
......@@ -371,42 +371,44 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
}
)
}
binding.ivPageSearchClose.setOnClickListener {
binding.editPageSearch.setText("")
binding.llPageSearch.visibility = View.GONE
binding.clBottom.visibility = View.VISIBLE
}
binding.editPageSearch.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
override fun afterTextChanged(s: Editable?) {
val key = s.toString()
if (currentFragment != null) {
currentFragment?.findAll(key)
}
// binding.ivPageSearchClose.setOnClickListener {
// binding.editPageSearch.setText("")
// binding.llPageSearch.visibility = View.GONE
// binding.clBottom.visibility = View.VISIBLE
// }
// binding.editPageSearch.addTextChangedListener(object : TextWatcher {
// override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
//
// }
//
// override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
// }
//
// override fun afterTextChanged(s: Editable?) {
// val key = s.toString()
// if (currentFragment != null) {
// currentFragment?.findAll(key)
// }
//
// }
// })
}
})
binding.ivLeftSearch.setOnClickListener {
if(currentFragment!=null){
if (currentFragment != null) {
currentFragment?.lastSearch()
}
}
binding.ivRightSearch.setOnClickListener {
if(currentFragment!=null){
if (currentFragment != null) {
currentFragment?.nextSearch()
}
}
}
fun setSearchNum(int: Int,max:Int) {
binding.tvPageSearchNumber.text =""+int+"/"+max
fun setSearchNum(int: Int, max: Int) {
binding.tvPageSearchNumber.text = "" + int + "/" + max
}
override fun onResume() {
......
......@@ -6,7 +6,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:fitsSystemWindows="true"
tools:context=".ui.activity.webbrowser.WebBrowserActivity">
......@@ -218,20 +217,20 @@
android:background="@drawable/bg_storke_070709_20"
android:orientation="horizontal">
<EditText
android:id="@+id/edit_page_search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="15dp"
android:layout_weight="1"
android:background="@null"
android:drawableStart="@mipmap/sousuoicon_page_search"
android:drawablePadding="5dp"
android:hint="Search"
android:singleLine="true"
android:textSize="16sp"
tools:ignore="Autofill,HardcodedText,NestedWeights,TextFields" />
<!-- <EditText-->
<!-- android:id="@+id/edit_page_search"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center_vertical"-->
<!-- android:layout_marginHorizontal="15dp"-->
<!-- android:layout_weight="1"-->
<!-- android:background="@null"-->
<!-- android:drawableStart="@mipmap/sousuoicon_page_search"-->
<!-- android:drawablePadding="5dp"-->
<!-- android:hint="Search"-->
<!-- android:singleLine="true"-->
<!-- android:textSize="16sp"-->
<!-- tools:ignore="Autofill,HardcodedText,NestedWeights,TextFields" />-->
<TextView
android:id="@+id/tv_page_search_number"
......
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