优化
This commit is contained in:
@@ -289,7 +289,7 @@ class AnalyzeUrl(
|
|||||||
private fun fetchStart(): ConcurrentRecord? {
|
private fun fetchStart(): ConcurrentRecord? {
|
||||||
source ?: return null
|
source ?: return null
|
||||||
val concurrentRate = source.concurrentRate
|
val concurrentRate = source.concurrentRate
|
||||||
if (concurrentRate.isNullOrEmpty()) {
|
if (concurrentRate.isNullOrEmpty() || concurrentRate == "0") {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
val rateIndex = concurrentRate.indexOf("/")
|
val rateIndex = concurrentRate.indexOf("/")
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ import io.legado.app.utils.viewbindingdelegate.viewBinding
|
|||||||
import io.legado.app.utils.visible
|
import io.legado.app.utils.visible
|
||||||
import splitties.views.onClick
|
import splitties.views.onClick
|
||||||
|
|
||||||
class ImportHttpTtsDialog() : BaseDialogFragment(R.layout.dialog_recycler_view) {
|
class ImportHttpTtsDialog() : BaseDialogFragment(R.layout.dialog_recycler_view),
|
||||||
|
CodeDialog.Callback {
|
||||||
|
|
||||||
constructor(source: String, finishOnDismiss: Boolean = false) : this() {
|
constructor(source: String, finishOnDismiss: Boolean = false) : this() {
|
||||||
arguments = Bundle().apply {
|
arguments = Bundle().apply {
|
||||||
@@ -176,4 +177,13 @@ class ImportHttpTtsDialog() : BaseDialogFragment(R.layout.dialog_recycler_view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCodeSave(code: String, requestId: String?) {
|
||||||
|
requestId?.toInt()?.let {
|
||||||
|
HttpTTS.fromJson(code).getOrNull()?.let { source ->
|
||||||
|
viewModel.allSources[it] = source
|
||||||
|
adapter.setItem(it, source)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -73,6 +73,7 @@ class HttpTtsEditDialog() : BaseDialogFragment(R.layout.dialog_http_tts_edit, tr
|
|||||||
binding.tvName.setText(httpTTS.name)
|
binding.tvName.setText(httpTTS.name)
|
||||||
binding.tvUrl.setText(httpTTS.url)
|
binding.tvUrl.setText(httpTTS.url)
|
||||||
binding.tvContentType.setText(httpTTS.contentType)
|
binding.tvContentType.setText(httpTTS.contentType)
|
||||||
|
binding.tvConcurrentRate.setText(httpTTS.concurrentRate)
|
||||||
binding.tvLoginUrl.setText(httpTTS.loginUrl)
|
binding.tvLoginUrl.setText(httpTTS.loginUrl)
|
||||||
binding.tvLoginUi.setText(httpTTS.loginUi)
|
binding.tvLoginUi.setText(httpTTS.loginUi)
|
||||||
binding.tvLoginCheckJs.setText(httpTTS.loginCheckJs)
|
binding.tvLoginCheckJs.setText(httpTTS.loginCheckJs)
|
||||||
@@ -121,6 +122,7 @@ class HttpTtsEditDialog() : BaseDialogFragment(R.layout.dialog_http_tts_edit, tr
|
|||||||
name = binding.tvName.text.toString(),
|
name = binding.tvName.text.toString(),
|
||||||
url = binding.tvUrl.text.toString(),
|
url = binding.tvUrl.text.toString(),
|
||||||
contentType = binding.tvContentType.text?.toString(),
|
contentType = binding.tvContentType.text?.toString(),
|
||||||
|
concurrentRate = binding.tvConcurrentRate.text?.toString(),
|
||||||
loginUrl = binding.tvLoginUrl.text?.toString(),
|
loginUrl = binding.tvLoginUrl.text?.toString(),
|
||||||
loginUi = binding.tvLoginUi.text?.toString(),
|
loginUi = binding.tvLoginUi.text?.toString(),
|
||||||
loginCheckJs = binding.tvLoginCheckJs.text?.toString(),
|
loginCheckJs = binding.tvLoginCheckJs.text?.toString(),
|
||||||
|
|||||||
@@ -85,6 +85,11 @@ class TocActivity : VMBaseActivity<ActivityChapterListBinding, TocViewModel>() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
setOnQueryTextFocusChangeListener { v, hasFocus ->
|
||||||
|
if (!hasFocus) {
|
||||||
|
searchView?.isIconified = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return super.onCompatCreateOptionsMenu(menu)
|
return super.onCompatCreateOptionsMenu(menu)
|
||||||
}
|
}
|
||||||
@@ -116,15 +121,6 @@ class TocActivity : VMBaseActivity<ActivityChapterListBinding, TocViewModel>() {
|
|||||||
return super.onCompatOptionsItemSelected(item)
|
return super.onCompatOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun finish() {
|
|
||||||
if (tabLayout.isGone) {
|
|
||||||
searchView?.onActionViewCollapsed()
|
|
||||||
tabLayout.visible()
|
|
||||||
} else {
|
|
||||||
super.finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
private inner class TabFragmentPageAdapter :
|
private inner class TabFragmentPageAdapter :
|
||||||
FragmentPagerAdapter(supportFragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
|
FragmentPagerAdapter(supportFragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
|
||||||
|
|||||||
@@ -75,6 +75,20 @@
|
|||||||
|
|
||||||
</io.legado.app.ui.widget.text.TextInputLayout>
|
</io.legado.app.ui.widget.text.TextInputLayout>
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.text.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/concurrent_rate"
|
||||||
|
tools:ignore="HardcodedText">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.code.CodeView
|
||||||
|
android:id="@+id/tv_concurrent_rate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck" />
|
||||||
|
|
||||||
|
</io.legado.app.ui.widget.text.TextInputLayout>
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.TextInputLayout
|
<io.legado.app.ui.widget.text.TextInputLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
Reference in New Issue
Block a user