mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -77,8 +77,8 @@ abstract class BaseActivity<VB : ViewBinding>(
|
||||
findViewById<TitleBar>(R.id.title_bar)
|
||||
?.onMultiWindowModeChanged(isInMultiWindowMode, fullScreen)
|
||||
}
|
||||
onActivityCreated(savedInstanceState)
|
||||
observeLiveBus()
|
||||
onActivityCreated(savedInstanceState)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
|
||||
@@ -32,8 +32,8 @@ abstract class BaseFragment(@LayoutRes layoutID: Int) : Fragment(layoutID),
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
onMultiWindowModeChanged()
|
||||
onFragmentCreated(view, savedInstanceState)
|
||||
observeLiveBus()
|
||||
onFragmentCreated(view, savedInstanceState)
|
||||
}
|
||||
|
||||
abstract fun onFragmentCreated(view: View, savedInstanceState: Bundle?)
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.MotionEvent
|
||||
import android.widget.EditText
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.core.view.allViews
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.VMBaseActivity
|
||||
import io.legado.app.constant.AppLog
|
||||
@@ -119,6 +120,13 @@ class SearchContentActivity :
|
||||
mLayoutManager.scrollToPositionWithOffset(adapter.itemCount - 1, 0)
|
||||
}
|
||||
}
|
||||
binding.tvCurrentSearchInfo.setOnClickListener {
|
||||
searchView.allViews.forEach { view ->
|
||||
if (view is EditText) {
|
||||
view.showSoftInput()
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.fbStop.setOnClickListener {
|
||||
searchJob?.cancel()
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.Build
|
||||
import android.text.Html
|
||||
import android.view.View
|
||||
import android.view.View.*
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.*
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
@@ -41,6 +42,11 @@ fun View.hideSoftInput() = run {
|
||||
inputMethodManager.hideSoftInputFromWindow(this.windowToken, 0)
|
||||
}
|
||||
|
||||
fun View.showSoftInput() = run {
|
||||
requestFocus()
|
||||
inputMethodManager.showSoftInput(this, InputMethodManager.RESULT_SHOWN)
|
||||
}
|
||||
|
||||
fun View.disableAutoFill() = run {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
this.importantForAutofill = IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
|
||||
|
||||
@@ -54,6 +54,10 @@
|
||||
android:textColor="@color/primaryText"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_search_content_top"
|
||||
android:layout_width="36dp"
|
||||
|
||||
Reference in New Issue
Block a user