diff --git a/app/build.gradle b/app/build.gradle index 3c8a18f6c..037194e73 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -167,7 +167,7 @@ dependencies { implementation 'org.nanohttpd:nanohttpd-websocket:2.3.1' //二维码 - implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.6' + implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.7' //颜色选择 implementation 'com.jaredrummler:colorpicker:1.1.0' diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 7ace22ee4..524a248bf 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -2,6 +2,14 @@ * 旧版数据导入教程:先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】。 * 请关注[开源阅读软件]()支持我,同时关注合作公众号[小说拾遗](),阅读公众号小编。 +**2020/03/07** +* 添加标题上下间距调整 +* 添加标题大小调整 +* 书籍整理添加批量启用禁用更新 +* 换源禁用书源不显示 +* 修复搜索界面简介最下面显示半行文字 +* 搜索历史改为多行 + **2020/03/06** * 添加隐藏标题 * 行距段距改成倍距,根据字体大小变化 diff --git a/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt b/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt index 779cfd1e2..c02450091 100644 --- a/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt @@ -27,7 +27,7 @@ interface SearchBookDao { select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl, t1.type, t1.time, t1.intro, t1.kind, t1.latestChapterTitle, t1.tocUrl, t1.variable, t1.wordCount, t2.customOrder as originOrder from searchBooks as t1 inner join book_sources as t2 on t1.origin = t2.bookSourceUrl - where t1.name = :name and t1.author = :author + where t1.name = :name and t1.author = :author and t2.enabled = 1 order by t2.customOrder """ ) @@ -38,7 +38,7 @@ interface SearchBookDao { select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl, t1.type, t1.time, t1.intro, t1.kind, t1.latestChapterTitle, t1.tocUrl, t1.variable, t1.wordCount, t2.customOrder as originOrder from searchBooks as t1 inner join book_sources as t2 on t1.origin = t2.bookSourceUrl - where t1.name = :name and t1.author = :author and originName like '%'||:key||'%' + where t1.name = :name and t1.author = :author and originName like '%'||:key||'%' and t2.enabled = 1 order by t2.customOrder """ ) @@ -49,7 +49,7 @@ interface SearchBookDao { select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl, t1.type, t1.time, t1.intro, t1.kind, t1.latestChapterTitle, t1.tocUrl, t1.variable, t1.wordCount, t2.customOrder as originOrder from searchBooks as t1 inner join book_sources as t2 on t1.origin = t2.bookSourceUrl - where t1.name = :name and t1.author = :author and t1.coverUrl is not null and t1.coverUrl <> '' + where t1.name = :name and t1.author = :author and t1.coverUrl is not null and t1.coverUrl <> '' and t2.enabled = 1 order by t2.customOrder """ ) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 77dc45e9a..b1a17905f 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -70,12 +70,11 @@ object ReadBookConfig { val dm = resources.displayMetrics val width = dm.widthPixels val height = dm.heightPixels - bg = durConfig.bgDrawable(width, height) - bg?.let { - if (it is BitmapDrawable) { - bgMeanColor = BitmapUtils.getMeanColor(it.bitmap) - } else if (it is ColorDrawable) { - bgMeanColor = it.color + bg = durConfig.bgDrawable(width, height).apply { + if (this is BitmapDrawable) { + bgMeanColor = BitmapUtils.getMeanColor(bitmap) + } else if (this is ColorDrawable) { + bgMeanColor = color } } } @@ -169,7 +168,10 @@ object ReadBookConfig { get() = if (shareLayout) shareConfig.titleMode else durConfig.titleMode set(value) = if (shareLayout) shareConfig.titleMode = value else durConfig.titleMode = value - + var titleSize: Int + get() = if (shareLayout) shareConfig.titleSize else durConfig.titleSize + set(value) = + if (shareLayout) shareConfig.titleSize = value else durConfig.titleSize = value var titleTopSpacing: Int get() = if (shareLayout) shareConfig.titleTopSpacing else durConfig.titleTopSpacing set(value) = @@ -271,6 +273,7 @@ object ReadBookConfig { var lineSpacingExtra: Int = 12,//行间距 var paragraphSpacing: Int = 12,//段距 var titleMode: Int = 0,//标题居中 + var titleSize: Int = 0, var titleTopSpacing: Int = 0, var titleBottomSpacing: Int = 0, var paddingBottom: Int = 6, diff --git a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt index 14ea49b25..568615aa1 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt @@ -39,7 +39,7 @@ object BookContent { var contentData = analyzeContent( book, baseUrl, body, contentRule, bookChapter, bookSource ) - content.append(contentData.content.replace(bookChapter.title, "")) + content.append(contentData.content.replace(bookChapter.title, "")).append("\n") if (contentData.nextUrl.size == 1) { var nextUrl = contentData.nextUrl[0] val nextChapterUrl = if (!nextChapterUrlF.isNullOrEmpty()) @@ -64,7 +64,7 @@ object BookContent { ) nextUrl = if (contentData.nextUrl.isNotEmpty()) contentData.nextUrl[0] else "" - content.append(contentData.content) + content.append(contentData.content).append("\n") } } Debug.log(bookSource.bookSourceUrl, "◇本章总页数:${nextUrlList.size}") @@ -91,7 +91,7 @@ object BookContent { } } for (item in contentDataList) { - content.append(item.content) + content.append(item.content).append("\n") } } diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt index c0907f002..f03cc1df5 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt @@ -32,6 +32,7 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi get() = getViewModel(ArrangeBookViewModel::class.java) override val groupList: ArrayList = arrayListOf() private val groupRequestCode = 22 + private val addToGroupRequestCode = 34 private lateinit var adapter: ArrangeBookAdapter private var groupLiveData: LiveData>? = null private var booksLiveData: LiveData>? = null @@ -102,7 +103,6 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi else -> App.db.bookDao().observeByGroup(groupId) } booksLiveData?.observe(this, Observer { - adapter.selectedBooks.clear() adapter.setItems(it) upSelectCount() }) @@ -115,25 +115,21 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi R.id.menu_all -> { title_bar.subtitle = item.title groupId = -1 - adapter.selectedBooks.clear() initBookData() } R.id.menu_local -> { title_bar.subtitle = item.title groupId = -2 - adapter.selectedBooks.clear() initBookData() } R.id.menu_audio -> { title_bar.subtitle = item.title groupId = -3 - adapter.selectedBooks.clear() initBookData() } else -> if (item.groupId == R.id.menu_group) { title_bar.subtitle = item.title groupId = item.itemId - adapter.selectedBooks.clear() initBookData() } } @@ -144,9 +140,14 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi when (item?.itemId) { R.id.menu_del_selection -> alert(titleResource = R.string.draw, messageResource = R.string.sure_del) { - okButton { viewModel.deleteBook(*adapter.selectedBooks.toTypedArray()) } + okButton { viewModel.deleteBook(*adapter.selectedBooks()) } noButton { } }.show().applyTint() + R.id.menu_update_enable -> + viewModel.upCanUpdate(adapter.selectedBooks(), true) + R.id.menu_update_disable -> + viewModel.upCanUpdate(adapter.selectedBooks(), false) + R.id.menu_add_to_group -> selectGroup(0, addToGroupRequestCode) } return false } @@ -168,7 +169,7 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi when (requestCode) { groupRequestCode -> { val books = arrayListOf() - adapter.selectedBooks.forEach { + adapter.selectedBooks().forEach { books.add(it.copy(group = groupId)) } viewModel.updateBook(*books.toTypedArray()) @@ -178,11 +179,18 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi viewModel.updateBook(it.copy(group = groupId)) } } + addToGroupRequestCode -> { + val books = arrayListOf() + adapter.selectedBooks().forEach { + books.add(it.copy(group = it.group or groupId)) + } + viewModel.updateBook(*books.toTypedArray()) + } } } override fun upSelectCount() { - select_action_bar.upCountView(adapter.selectedBooks.size, adapter.getItems().size) + select_action_bar.upCountView(adapter.selectedBooks().size, adapter.getItems().size) } override fun deleteBook(book: Book) { diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt index 66eff5706..96fe1344e 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt @@ -13,7 +13,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick class ArrangeBookAdapter(context: Context, val callBack: CallBack) : SimpleRecyclerAdapter(context, R.layout.item_arrange_book) { val groupRequestCode = 12 - val selectedBooks: HashSet = hashSetOf() + private val selectedBooks: HashSet = hashSetOf() var actionItem: Book? = null fun selectAll(selectAll: Boolean) { @@ -40,6 +40,16 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) : callBack.upSelectCount() } + fun selectedBooks(): Array { + val books = arrayListOf() + selectedBooks.forEach { + if (getItems().contains(it)) { + books.add(it) + } + } + return books.toTypedArray() + } + override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList) { with(holder.itemView) { tv_name.text = if (item.author.isEmpty()) { diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookViewModel.kt index 4f4972de9..82ec712d2 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookViewModel.kt @@ -8,6 +8,15 @@ import io.legado.app.data.entities.Book class ArrangeBookViewModel(application: Application) : BaseViewModel(application) { + fun upCanUpdate(books: Array, canUpdate: Boolean) { + execute { + books.forEach { + it.canUpdate = canUpdate + } + App.db.bookDao().update(*books) + } + } + fun updateBook(vararg book: Book) { execute { App.db.bookDao().update(*book) diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 621a41fa9..769b47b21 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -86,8 +86,13 @@ class BookInfoActivity : } } R.id.menu_can_update -> { - viewModel.bookData.value?.let { - it.canUpdate = !it.canUpdate + if (viewModel.inBookshelf) { + viewModel.bookData.value?.let { + it.canUpdate = !it.canUpdate + viewModel.saveBook() + } + } else { + toast(R.string.after_add_bookshelf) } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index e85a0db31..de1f1d728 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -152,10 +152,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo PaddingConfigDialog().show(supportFragmentManager, "paddingConfig") } - fun showTypeConfig() { - ReadTypeDialog().show(supportFragmentManager, "readTypeDialog") - } - fun showBgTextConfig() { BgTextConfigDialog().show(supportFragmentManager, "bgTextConfig") } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt index 3c2bbb78a..68a1d11aa 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.book.read.config +import android.annotation.SuppressLint import android.content.DialogInterface import android.os.Bundle import android.util.DisplayMetrics @@ -13,6 +14,7 @@ import io.legado.app.R import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey import io.legado.app.help.ReadBookConfig +import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.selector import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.bottomBackground @@ -20,12 +22,10 @@ import io.legado.app.lib.theme.primaryColor import io.legado.app.ui.book.read.Help import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.widget.font.FontSelectDialog -import io.legado.app.utils.getIndexById -import io.legado.app.utils.getPrefString -import io.legado.app.utils.postEvent -import io.legado.app.utils.putPrefString +import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_book_read.* import kotlinx.android.synthetic.main.dialog_read_book_style.* +import kotlinx.android.synthetic.main.dialog_title_config.view.* import org.jetbrains.anko.sdk27.listeners.onCheckedChange import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onLongClick @@ -33,7 +33,6 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { val callBack get() = activity as? ReadBookActivity - lateinit var titleModes: Array override fun onStart() { super.onStart() @@ -63,7 +62,6 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - titleModes = requireContext().resources.getStringArray(R.array.title_mode) initView() initData() initViewEvent() @@ -76,6 +74,14 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { private fun initView() { root_view.setBackgroundColor(requireContext().bottomBackground) + dsb_text_size.valueFormat = { + (it + 5).toString() + } + dsb_text_letter_spacing.valueFormat = { + ((it - 50) / 100f).toString() + } + dsb_line_size.valueFormat = { ((it - 10) / 10f).toString() } + dsb_paragraph_spacing.valueFormat = { (it / 10f).toString() } } private fun initData() { @@ -95,11 +101,7 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { postEvent(EventBus.UP_CONFIG, true) } tv_title_mode.onClick { - requireContext().selector("标题模式", titleModes.toList()) { _, index -> - ReadBookConfig.titleMode = index - tv_title_mode.text = titleModes[index] - postEvent(EventBus.UP_CONFIG, true) - } + showTitleConfig() } tv_text_bold.onClick { ReadBookConfig.apply { @@ -124,15 +126,9 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { dismiss() callBack?.showPaddingConfig() } - tv_type.onClick { - dismiss() - callBack?.showTypeConfig() - } rg_page_anim.onCheckedChange { _, checkedId -> - rg_page_anim.getIndexById(checkedId).let { - ReadBookConfig.pageAnim = it - callBack?.page_view?.upPageAnim() - } + ReadBookConfig.pageAnim = rg_page_anim.getIndexById(checkedId) + callBack?.page_view?.upPageAnim() } cb_share_layout.onCheckedChangeListener = { checkBox, isChecked -> if (checkBox.isPressed) { @@ -141,19 +137,20 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { postEvent(EventBus.UP_CONFIG, true) } } - iv_default1.onClick { - ReadBookConfig.lineSpacingExtra = 16 - ReadBookConfig.paragraphSpacing = 6 + dsb_text_size.onChanged = { + ReadBookConfig.textSize = it + 5 + postEvent(EventBus.UP_CONFIG, true) + } + dsb_text_letter_spacing.onChanged = { + ReadBookConfig.letterSpacing = (it - 50) / 100f postEvent(EventBus.UP_CONFIG, true) } - iv_default2.onClick { - ReadBookConfig.lineSpacingExtra = 13 - ReadBookConfig.paragraphSpacing = 3 + dsb_line_size.onChanged = { + ReadBookConfig.lineSpacingExtra = it postEvent(EventBus.UP_CONFIG, true) } - iv_default3.onClick { - ReadBookConfig.lineSpacingExtra = 10 - ReadBookConfig.paragraphSpacing = 0 + dsb_paragraph_spacing.onChanged = { + ReadBookConfig.paragraphSpacing = it postEvent(EventBus.UP_CONFIG, true) } bg0.onClick { changeBg(0) } @@ -168,6 +165,36 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { bg4.onLongClick { showBgTextConfig(4) } } + @SuppressLint("InflateParams") + private fun showTitleConfig() = ReadBookConfig.apply { + requireContext().alert(R.string.title) { + val rootView = LayoutInflater.from(requireContext()) + .inflate(R.layout.dialog_title_config, null).apply { + rg_title_mode.checkByIndex(titleMode) + dsb_title_size.progress = titleSize + dsb_title_top.progress = titleTopSpacing + dsb_title_bottom.progress = titleBottomSpacing + rg_title_mode.onCheckedChange { _, checkedId -> + titleMode = rg_title_mode.getIndexById(checkedId) + postEvent(EventBus.UP_CONFIG, true) + } + dsb_title_size.onChanged = { + titleSize = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_title_top.onChanged = { + titleTopSpacing = it + postEvent(EventBus.UP_CONFIG, true) + } + dsb_title_bottom.onChanged = { + titleBottomSpacing = it + postEvent(EventBus.UP_CONFIG, true) + } + } + customView = rootView + }.show() + } + private fun changeBg(index: Int) { if (ReadBookConfig.styleSelect != index) { ReadBookConfig.styleSelect = index @@ -187,17 +214,20 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { private fun upStyle() { ReadBookConfig.let { - tv_title_mode.text = titleModes.getOrElse(it.titleMode) { titleModes[0] } tv_text_bold.isSelected = it.textBold + dsb_text_size.progress = it.textSize - 5 + dsb_text_letter_spacing.progress = (it.letterSpacing * 100).toInt() + 50 + dsb_line_size.progress = it.lineSpacingExtra + dsb_paragraph_spacing.progress = it.paragraphSpacing } } - private fun setBg() { - bg0.setTextColor(ReadBookConfig.getConfig(0).textColor()) - bg1.setTextColor(ReadBookConfig.getConfig(1).textColor()) - bg2.setTextColor(ReadBookConfig.getConfig(2).textColor()) - bg3.setTextColor(ReadBookConfig.getConfig(3).textColor()) - bg4.setTextColor(ReadBookConfig.getConfig(4).textColor()) + private fun setBg() = ReadBookConfig.apply { + bg0.setTextColor(getConfig(0).textColor()) + bg1.setTextColor(getConfig(1).textColor()) + bg2.setTextColor(getConfig(2).textColor()) + bg3.setTextColor(getConfig(3).textColor()) + bg4.setTextColor(getConfig(4).textColor()) for (i in 0..4) { val iv = when (i) { 1 -> bg1 @@ -206,22 +236,22 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { 4 -> bg4 else -> bg0 } - iv.setImageDrawable(ReadBookConfig.getConfig(i).bgDrawable(100, 150)) + iv.setImageDrawable(getConfig(i).bgDrawable(100, 150)) } } - private fun upBg() { - bg0.borderColor = requireContext().primaryColor - bg1.borderColor = requireContext().primaryColor - bg2.borderColor = requireContext().primaryColor - bg3.borderColor = requireContext().primaryColor - bg4.borderColor = requireContext().primaryColor + private fun upBg() = requireContext().apply { + bg0.borderColor = primaryColor + bg1.borderColor = primaryColor + bg2.borderColor = primaryColor + bg3.borderColor = primaryColor + bg4.borderColor = primaryColor when (ReadBookConfig.styleSelect) { - 1 -> bg1.borderColor = requireContext().accentColor - 2 -> bg2.borderColor = requireContext().accentColor - 3 -> bg3.borderColor = requireContext().accentColor - 4 -> bg4.borderColor = requireContext().accentColor - else -> bg0.borderColor = requireContext().accentColor + 1 -> bg1.borderColor = accentColor + 2 -> bg2.borderColor = accentColor + 3 -> bg3.borderColor = accentColor + 4 -> bg4.borderColor = accentColor + else -> bg0.borderColor = accentColor } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadTypeDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadTypeDialog.kt deleted file mode 100644 index c5247a455..000000000 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadTypeDialog.kt +++ /dev/null @@ -1,91 +0,0 @@ -package io.legado.app.ui.book.read.config - -import android.content.DialogInterface -import android.os.Bundle -import android.util.DisplayMetrics -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import io.legado.app.R -import io.legado.app.base.BaseDialogFragment -import io.legado.app.constant.EventBus -import io.legado.app.help.ReadBookConfig -import io.legado.app.ui.book.read.Help -import io.legado.app.utils.postEvent -import kotlinx.android.synthetic.main.dialog_read_type.* - -class ReadTypeDialog : BaseDialogFragment() { - - override fun onStart() { - super.onStart() - val dm = DisplayMetrics() - activity?.let { - Help.upSystemUiVisibility(it) - it.windowManager?.defaultDisplay?.getMetrics(dm) - } - dialog?.window?.let { - val attr = it.attributes - attr.dimAmount = 0.0f - it.attributes = attr - it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) - } - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - return inflater.inflate(R.layout.dialog_read_type, container) - } - - override fun onDismiss(dialog: DialogInterface) { - super.onDismiss(dialog) - ReadBookConfig.save() - } - - override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { - initView() - initViewEvent() - upStyle() - } - - private fun initView() { - dsb_text_size.valueFormat = { - (it + 5).toString() - } - dsb_text_letter_spacing.valueFormat = { - ((it - 50) / 100f).toString() - } - dsb_line_size.valueFormat = { ((it - 10) / 10f).toString() } - dsb_paragraph_spacing.valueFormat = { (it / 10f).toString() } - } - - private fun initViewEvent() { - dsb_text_size.onChanged = { - ReadBookConfig.textSize = it + 5 - postEvent(EventBus.UP_CONFIG, true) - } - dsb_text_letter_spacing.onChanged = { - ReadBookConfig.letterSpacing = (it - 50) / 100f - postEvent(EventBus.UP_CONFIG, true) - } - dsb_line_size.onChanged = { - ReadBookConfig.lineSpacingExtra = it - postEvent(EventBus.UP_CONFIG, true) - } - dsb_paragraph_spacing.onChanged = { - ReadBookConfig.paragraphSpacing = it - postEvent(EventBus.UP_CONFIG, true) - } - } - - private fun upStyle() { - ReadBookConfig.let { - dsb_text_size.progress = it.textSize - 5 - dsb_text_letter_spacing.progress = (it.letterSpacing * 100).toInt() + 50 - dsb_line_size.progress = it.lineSpacingExtra - dsb_paragraph_spacing.progress = it.paragraphSpacing - } - } -} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index 3366c019d..81e483c75 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -28,6 +28,8 @@ object ChapterProvider { var visibleBottom = 0 private var lineSpacingExtra = 0 private var paragraphSpacing = 0 + private var titleTopSpacing = 0 + private var titleBottomSpacing = 0 var typeface: Typeface = Typeface.SANS_SERIF var titlePaint = TextPaint() var contentPaint = TextPaint() @@ -97,7 +99,7 @@ object ChapterProvider { stringBuilder: StringBuilder, isTitle: Boolean ): Float { - var durY = y + var durY = if (isTitle) y + titleTopSpacing else y val textPaint = if (isTitle) titlePaint else contentPaint val layout = StaticLayout( text, textPaint, visibleWidth, @@ -142,6 +144,7 @@ object ChapterProvider { durY += textPaint.textHeight * lineSpacingExtra / 10f textPages.last().height = durY } + if (isTitle) durY += titleBottomSpacing durY += textPaint.textHeight * paragraphSpacing / 10f return durY } @@ -262,18 +265,19 @@ object ChapterProvider { titlePaint.color = ReadBookConfig.durConfig.textColor() titlePaint.letterSpacing = ReadBookConfig.letterSpacing titlePaint.typeface = Typeface.create(typeface, Typeface.BOLD) + titlePaint.textSize = with(ReadBookConfig) { textSize + titleSize }.sp.toFloat() //正文 contentPaint.isAntiAlias = true contentPaint.color = ReadBookConfig.durConfig.textColor() contentPaint.letterSpacing = ReadBookConfig.letterSpacing val bold = if (ReadBookConfig.textBold) Typeface.BOLD else Typeface.NORMAL contentPaint.typeface = Typeface.create(typeface, bold) + contentPaint.textSize = ReadBookConfig.textSize.sp.toFloat() //间距 lineSpacingExtra = ReadBookConfig.lineSpacingExtra paragraphSpacing = ReadBookConfig.paragraphSpacing - titlePaint.textSize = (ReadBookConfig.textSize + 2).sp.toFloat() - contentPaint.textSize = ReadBookConfig.textSize.sp.toFloat() - + titleTopSpacing = ReadBookConfig.titleTopSpacing.dp + titleBottomSpacing = ReadBookConfig.titleBottomSpacing.dp upSize() } diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index a41fcd656..c86f96dba 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -11,6 +11,7 @@ import androidx.lifecycle.Observer import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.google.android.flexbox.FlexboxLayoutManager import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseActivity @@ -31,6 +32,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.startActivity +import java.text.Collator class SearchActivity : VMBaseActivity(R.layout.activity_book_search), @@ -49,7 +51,7 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se private var bookData: LiveData>? = null private var menu: Menu? = null private var precisionSearchMenuItem: MenuItem? = null - private var groups = hashSetOf() + private var groups = linkedSetOf() private var refreshTime = System.currentTimeMillis() override fun onActivityCreated(savedInstanceState: Bundle?) { @@ -133,11 +135,10 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se ATH.applyEdgeEffectColor(rv_bookshelf_search) ATH.applyEdgeEffectColor(rv_history_key) bookAdapter = BookAdapter(this, this) - rv_bookshelf_search.layoutManager = - LinearLayoutManager(this, RecyclerView.HORIZONTAL, false) + rv_bookshelf_search.layoutManager = FlexboxLayoutManager(this) rv_bookshelf_search.adapter = bookAdapter historyKeyAdapter = HistoryKeyAdapter(this, this) - rv_history_key.layoutManager = LinearLayoutManager(this, RecyclerView.HORIZONTAL, false) + rv_history_key.layoutManager = FlexboxLayoutManager(this) rv_history_key.adapter = historyKeyAdapter adapter = SearchAdapter(this, this) recycler_view.layoutManager = LinearLayoutManager(this) @@ -229,12 +230,13 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se if (selectedGroup == "") { item?.isChecked = true } - groups.map { - item = menu?.add(R.id.source_group, Menu.NONE, Menu.NONE, it) - if (it == selectedGroup) { - item?.isChecked = true + groups.sortedWith(Collator.getInstance(java.util.Locale.CHINESE)) + .map { + item = menu?.add(R.id.source_group, Menu.NONE, Menu.NONE, it) + if (it == selectedGroup) { + item?.isChecked = true + } } - } menu?.setGroupCheckable(R.id.source_group, true, true) } @@ -266,7 +268,8 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se } else { App.db.searchKeywordDao().liveDataSearch(key) } - historyData?.observe(this, Observer { historyKeyAdapter.setItems(it) + historyData?.observe(this, Observer { + historyKeyAdapter.setItems(it) if (it.isEmpty()) { tv_clear_history.invisible() } else { diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 31b1c2028..eba5950f4 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -40,6 +40,7 @@ import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.toast import java.io.File +import java.text.Collator class BookSourceActivity : VMBaseActivity(R.layout.activity_book_source), PopupMenu.OnMenuItemClickListener, @@ -197,9 +198,10 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity private fun upGroupMenu() { groupMenu?.removeGroup(R.id.source_group) - groups.map { - groupMenu?.add(R.id.source_group, Menu.NONE, Menu.NONE, it) - } + groups.sortedWith(Collator.getInstance(java.util.Locale.CHINESE)) + .map { + groupMenu?.add(R.id.source_group, Menu.NONE, Menu.NONE, it) + } } @SuppressLint("InflateParams") diff --git a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt index 22f5e7f3d..99d7d1e54 100644 --- a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt @@ -2,7 +2,6 @@ package io.legado.app.ui.config import android.content.SharedPreferences import android.os.Bundle -import android.os.Handler import android.view.View import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat @@ -170,14 +169,15 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnShar private fun upTheme(isNightTheme: Boolean) { if (AppConfig.isNightTheme == isNightTheme) { - App.INSTANCE.applyTheme() - recreateActivities() + listView.post { + App.INSTANCE.applyTheme() + recreateActivities() + } } } private fun recreateActivities() { postEvent(EventBus.RECREATE, "") - Handler().postDelayed({ activity?.recreate() }, 100L) } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index 5d922cae9..43375288e 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -7,7 +7,6 @@ import androidx.lifecycle.Observer import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseFragment @@ -75,21 +74,6 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), booksAdapter = BooksAdapterGrid(requireContext(),this) } rv_bookshelf.adapter = booksAdapter - booksAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { - override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { - super.onItemRangeInserted(positionStart, itemCount) - if (positionStart == 0) { - rv_bookshelf.scrollToPosition(0) - } - } - - override fun onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int) { - super.onItemRangeMoved(fromPosition, toPosition, itemCount) - if (toPosition == 0) { - rv_bookshelf.scrollToPosition(0) - } - } - }) } private fun upRecyclerData() { diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt index f4257732c..c8f93fc64 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt @@ -17,14 +17,15 @@ import io.legado.app.base.VMBaseFragment import io.legado.app.data.entities.BookSource import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.primaryTextColor -import io.legado.app.ui.book.source.edit.BookSourceEditActivity import io.legado.app.ui.book.explore.ExploreShowActivity +import io.legado.app.ui.book.source.edit.BookSourceEditActivity import io.legado.app.utils.getViewModel import io.legado.app.utils.splitNotBlank import io.legado.app.utils.startActivity import kotlinx.android.synthetic.main.fragment_find_book.* import kotlinx.android.synthetic.main.view_search.* import kotlinx.android.synthetic.main.view_title_bar.* +import java.text.Collator class ExploreFragment : VMBaseFragment(R.layout.fragment_find_book), @@ -119,9 +120,10 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_find_ private fun upGroupsMenu() { groupsMenu?.let { subMenu -> subMenu.removeGroup(R.id.menu_group_text) - groups.forEach { - subMenu.add(R.id.menu_group_text, Menu.NONE, Menu.NONE, it) - } + groups.sortedWith(Collator.getInstance(java.util.Locale.CHINESE)) + .forEach { + subMenu.add(R.id.menu_group_text, Menu.NONE, Menu.NONE, it) + } } } diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index 35934e4d6..c60ddaa39 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -39,6 +39,8 @@ import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.toast import java.io.File +import java.text.Collator +import java.util.* class RssSourceActivity : VMBaseActivity(R.layout.activity_rss_source), @@ -190,9 +192,10 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r private fun upGroupMenu() { groupMenu?.removeGroup(R.id.source_group) - groups.map { - groupMenu?.add(R.id.source_group, Menu.NONE, Menu.NONE, it) - } + groups.sortedWith(Collator.getInstance(java.util.Locale.CHINESE)) + .map { + groupMenu?.add(R.id.source_group, Menu.NONE, Menu.NONE, it) + } } private fun initLiveDataSource(key: String? = null) { diff --git a/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt b/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt index 2d830ca55..a2f354772 100644 --- a/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt @@ -38,7 +38,7 @@ class LabelsBar(context: Context, attrs: AttributeSet?) : LinearLayout(context, val tv = if (unUsedViews.isEmpty()) { AccentBgTextView(context, null).apply { setPadding(3.dp, 0, 3.dp, 0) - setRadios(2) + setRadius(2) val lp = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) lp.setMargins(0, 0, 2.dp, 0) layoutParams = lp diff --git a/app/src/main/java/io/legado/app/ui/widget/text/AccentBgTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/AccentBgTextView.kt index 6f48e81af..b2dcc2578 100644 --- a/app/src/main/java/io/legado/app/ui/widget/text/AccentBgTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/AccentBgTextView.kt @@ -14,31 +14,31 @@ import io.legado.app.utils.getCompatColor class AccentBgTextView(context: Context, attrs: AttributeSet?) : AppCompatTextView(context, attrs) { - private var radios = 0 + private var radius = 0 init { val typedArray = context.obtainStyledAttributes(attrs, R.styleable.AccentBgTextView) - radios = typedArray.getDimensionPixelOffset(R.styleable.AccentBgTextView_radius, radios) + radius = typedArray.getDimensionPixelOffset(R.styleable.AccentBgTextView_radius, radius) typedArray.recycle() upBackground() setTextColor(Color.WHITE) } - fun setRadios(radio: Int) { - this.radios = radio.dp + fun setRadius(radius: Int) { + this.radius = radius.dp upBackground() } private fun upBackground() { background = if (isInEditMode) { Selector.shapeBuild() - .setCornerRadius(radios) + .setCornerRadius(radius) .setDefaultBgColor(context.getCompatColor(R.color.colorAccent)) .setPressedBgColor(ColorUtils.darkenColor(context.getCompatColor(R.color.colorAccent))) .create() } else { Selector.shapeBuild() - .setCornerRadius(radios) + .setCornerRadius(radius) .setDefaultBgColor(ThemeStore.accentColor(context)) .setPressedBgColor(ColorUtils.darkenColor(ThemeStore.accentColor(context))) .create() diff --git a/app/src/main/java/io/legado/app/ui/widget/text/MultilineTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/MultilineTextView.kt new file mode 100644 index 000000000..839ca59bd --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/widget/text/MultilineTextView.kt @@ -0,0 +1,22 @@ +package io.legado.app.ui.widget.text + +import android.content.Context +import android.graphics.Canvas +import android.util.AttributeSet +import androidx.appcompat.widget.AppCompatTextView + +class MultilineTextView(context: Context?, attrs: AttributeSet?) : + AppCompatTextView(context, attrs) { + + override fun onDraw(canvas: Canvas?) { + calculateLines() + super.onDraw(canvas) + } + + private fun calculateLines() { + val mHeight = measuredHeight + val lHeight = lineHeight + val lines = mHeight / lHeight + setLines(lines) + } +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/widget/text/StrokeTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/StrokeTextView.kt index df4da33ea..3fa0544d3 100644 --- a/app/src/main/java/io/legado/app/ui/widget/text/StrokeTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/StrokeTextView.kt @@ -12,10 +12,24 @@ import io.legado.app.utils.getCompatColor open class StrokeTextView(context: Context, attrs: AttributeSet?) : AppCompatTextView(context, attrs) { + private var radius = 1.dp + init { + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.StrokeTextView) + radius = typedArray.getDimensionPixelOffset(R.styleable.StrokeTextView_radius, radius) + typedArray.recycle() + upBackground() + } + + fun setRadius(radius: Int) { + this.radius = radius.dp + upBackground() + } + + private fun upBackground() { if (isInEditMode) { background = Selector.shapeBuild() - .setCornerRadius(1.dp) + .setCornerRadius(radius) .setStrokeWidth(1.dp) .setDisabledStrokeColor(context.getCompatColor(R.color.md_grey_500)) .setDefaultStrokeColor(context.getCompatColor(R.color.tv_text_secondary)) @@ -31,7 +45,7 @@ open class StrokeTextView(context: Context, attrs: AttributeSet?) : ) } else { background = Selector.shapeBuild() - .setCornerRadius(1.dp) + .setCornerRadius(radius) .setStrokeWidth(1.dp) .setDisabledStrokeColor(context.getCompatColor(R.color.md_grey_500)) .setDefaultStrokeColor(ThemeStore.textColorSecondary(context)) diff --git a/app/src/main/java/io/legado/app/utils/EventBusKt.kt b/app/src/main/java/io/legado/app/utils/EventBusKt.kt index 6731e06d6..0d9473a3c 100644 --- a/app/src/main/java/io/legado/app/utils/EventBusKt.kt +++ b/app/src/main/java/io/legado/app/utils/EventBusKt.kt @@ -14,6 +14,10 @@ inline fun postEvent(tag: String, event: EVENT) { LiveEventBus.get(tag).post(event) } +inline fun postEventDelay(tag: String, event: EVENT, delay: Long) { + LiveEventBus.get(tag).postDelay(event, delay) +} + inline fun AppCompatActivity.observeEvent( vararg tags: String, noinline observer: (EVENT) -> Unit diff --git a/app/src/main/res/drawable/ic_type_default_1.xml b/app/src/main/res/drawable/ic_type_default_1.xml deleted file mode 100644 index 14d903eee..000000000 --- a/app/src/main/res/drawable/ic_type_default_1.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_type_default_2.xml b/app/src/main/res/drawable/ic_type_default_2.xml deleted file mode 100644 index a0c29bc99..000000000 --- a/app/src/main/res/drawable/ic_type_default_2.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_type_default_3.xml b/app/src/main/res/drawable/ic_type_default_3.xml deleted file mode 100644 index feb07717f..000000000 --- a/app/src/main/res/drawable/ic_type_default_3.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/dialog_read_book_style.xml b/app/src/main/res/layout/dialog_read_book_style.xml index b11e6e9df..4adff8b72 100644 --- a/app/src/main/res/layout/dialog_read_book_style.xml +++ b/app/src/main/res/layout/dialog_read_book_style.xml @@ -27,9 +27,10 @@ android:paddingRight="6dp" android:paddingTop="4dp" android:paddingBottom="4dp" - android:text="@string/title_center" + android:text="@string/title" android:gravity="center" - android:textSize="14sp" /> + android:textSize="14sp" + app:radius="3dp" /> + android:textSize="14sp" + app:radius="3dp" /> + android:textSize="14sp" + app:radius="3dp" /> + android:textSize="14sp" + app:radius="3dp" /> - - - - - - - - - - - - - - - - - - - - - - + android:textSize="14sp" + app:radius="3dp" /> + android:textSize="14sp" + app:radius="3dp" /> + + + + + + + + diff --git a/app/src/main/res/layout/dialog_read_type.xml b/app/src/main/res/layout/dialog_read_type.xml deleted file mode 100644 index c27a65f2d..000000000 --- a/app/src/main/res/layout/dialog_read_type.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_title_config.xml b/app/src/main/res/layout/dialog_title_config.xml new file mode 100644 index 000000000..9480c1602 --- /dev/null +++ b/app/src/main/res/layout/dialog_title_config.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_search.xml b/app/src/main/res/layout/item_search.xml index 78e5a44da..421082d13 100644 --- a/app/src/main/res/layout/item_search.xml +++ b/app/src/main/res/layout/item_search.xml @@ -7,8 +7,8 @@ @@ -43,7 +44,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:orientation="vertical" - android:layout_marginTop="8dp" + android:layout_marginTop="3dp" app:layout_constraintBottom_toBottomOf="@id/iv_cover" app:layout_constraintLeft_toLeftOf="@+id/tv_name" app:layout_constraintRight_toRightOf="@id/tv_name" @@ -75,10 +76,10 @@ android:textColor="@color/tv_text_default" android:textSize="12sp" /> - + android:layout_weight="1" + android:textSize="12sp" /> + android:layout_height="wrap_content" + android:textSize="12sp" /> @@ -56,12 +58,14 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:singleLine="true" /> + android:singleLine="true" + android:textSize="12sp" /> + android:layout_height="wrap_content" + android:textSize="12sp" /> diff --git a/app/src/main/res/menu/arrange_book_sel.xml b/app/src/main/res/menu/arrange_book_sel.xml index 1985d09cd..880569d40 100644 --- a/app/src/main/res/menu/arrange_book_sel.xml +++ b/app/src/main/res/menu/arrange_book_sel.xml @@ -5,4 +5,16 @@ android:id="@+id/menu_del_selection" android:title="@string/delete" /> + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/book_source_sel.xml b/app/src/main/res/menu/book_source_sel.xml index dff64669a..456bf4645 100644 --- a/app/src/main/res/menu/book_source_sel.xml +++ b/app/src/main/res/menu/book_source_sel.xml @@ -22,11 +22,6 @@ android:title="@string/disable_explore" app:showAsAction="never" /> - - - - 系统等宽字体 - - 标题靠左 - 标题居中 - 标题隐藏 - - \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index cc7adbeb8..d5a4d11e1 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -159,6 +159,10 @@ + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 368df1c1d..9c055c8d5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -330,6 +330,7 @@ 朗读时音量键翻页 Tip边距跟随边距调整 允许更新 + 禁止更新 反选 搜索书名、作者 书名、作者、URL @@ -620,7 +621,6 @@ 文本选择结束位置 文本选择开始位置 共用布局 - 标题居中 浏览器 导入默认规则 名称 @@ -634,4 +634,9 @@ 预设一 预设二 预设三 + 标题 + 靠左 + 居中 + 隐藏 + 加入分组