This commit is contained in:
Horis
2023-03-17 16:07:31 +08:00
parent dd6683f89d
commit 06ec8ceaef
2 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
package io.legado.app.ui.book.import.remote
import android.annotation.SuppressLint
import android.net.Uri
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
@@ -10,15 +11,16 @@ import androidx.core.view.isGone
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
import io.legado.app.data.appDb
import io.legado.app.data.entities.Book
import io.legado.app.help.config.AppConfig
import io.legado.app.help.config.LocalConfig
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.theme.backgroundColor
import io.legado.app.model.remote.RemoteBook
import io.legado.app.ui.about.AppLogDialog
import io.legado.app.ui.book.import.BaseImportBookActivity
import io.legado.app.ui.widget.SelectActionBar
import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.utils.ArchiveUtils
import io.legado.app.utils.FileDoc
import io.legado.app.utils.find
import io.legado.app.utils.showDialogFragment
@@ -210,7 +212,7 @@ class RemoteBookActivity : BaseImportBookActivity<RemoteBookViewModel>(),
R.string.archive_not_found
) {
okButton {
viewModel.addToBookshelf(hashSetOf<RemoteBook>(remoteBook)) {
viewModel.addToBookshelf(hashSetOf(remoteBook)) {
onDownloadFinish?.invoke()
}
}

View File

@@ -38,11 +38,11 @@ class SearchView @JvmOverloads constructor(
if (textView == null) {
textView = findViewById(androidx.appcompat.R.id.search_src_text)
mSearchHintIcon = this.context.getDrawable(R.drawable.ic_search_hint)
updateQueryHint()
}
// 改变字体
textView!!.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f)
textView!!.gravity = Gravity.CENTER_VERTICAL
updateQueryHint()
} catch (e: Exception) {
e.printOnDebug()
}
@@ -54,7 +54,7 @@ class SearchView @JvmOverloads constructor(
if (mSearchHintIcon == null) {
return hintText
}
val textSize = (textView!!.textSize * 0.8).toInt()
val textSize = textView!!.textSize.toInt()
mSearchHintIcon!!.setBounds(0, 0, textSize, textSize)
val ssb = SpannableStringBuilder(" ")
ssb.setSpan(CenteredImageSpan(mSearchHintIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)