From 8051cc8d81bbb053d923b4f222728d93cf320158 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 20:54:08 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt | 5 ++++- app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt | 5 ++++- app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt | 5 ++++- app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt | 3 +-- app/src/main/java/io/legado/app/ui/widget/TitleBar.kt | 5 ++++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt index 5198599e4..010ebba78 100644 --- a/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt @@ -13,7 +13,10 @@ import io.legado.app.utils.progressAdd import kotlinx.android.synthetic.main.view_detail_seek_bar.view.* import org.jetbrains.anko.sdk27.listeners.onClick -class DetailSeekBar(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs), +class DetailSeekBar @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : FrameLayout(context, attrs), SeekBar.OnSeekBarChangeListener { private val isBottomBackground: Boolean var valueFormat: ((progress: Int) -> 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 4d51c5b80..01c4957db 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 @@ -8,7 +8,10 @@ import io.legado.app.ui.widget.text.AccentBgTextView import io.legado.app.utils.dp @Suppress("unused", "MemberVisibilityCanBePrivate") -class LabelsBar(context: Context, attrs: AttributeSet?) : LinearLayout(context, attrs) { +class LabelsBar @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : LinearLayout(context, attrs) { private val unUsedViews = arrayListOf() private val usedViews = arrayListOf() diff --git a/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt b/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt index fd478ae42..3fc481e8b 100644 --- a/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/SelectActionBar.kt @@ -17,7 +17,10 @@ import kotlinx.android.synthetic.main.view_select_action_bar.view.* import org.jetbrains.anko.sdk27.listeners.onClick @Suppress("unused") -class SelectActionBar(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs) { +class SelectActionBar @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : FrameLayout(context, attrs) { private var callBack: CallBack? = null private var selMenu: PopupMenu? = null diff --git a/app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt b/app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt index 76668e772..95e54ac63 100644 --- a/app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt +++ b/app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt @@ -14,11 +14,10 @@ import io.legado.app.utils.getCompatColor /** * ShadowLayout.java * - * * Created by lijiankun on 17/8/11. */ @Suppress("unused") -class ShadowLayout( +class ShadowLayout @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null ) : RelativeLayout(context, attrs) { diff --git a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt index a30873671..51a04f97d 100644 --- a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt @@ -22,7 +22,10 @@ import org.jetbrains.anko.bottomPadding import org.jetbrains.anko.topPadding @Suppress("unused") -class TitleBar(context: Context, attrs: AttributeSet?) : AppBarLayout(context, attrs) { +class TitleBar @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : AppBarLayout(context, attrs) { val toolbar: Toolbar val menu: Menu From 3ec4ce4524e13947df9fa7c14fb1c4a64381bc87 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 20:56:41 +0800 Subject: [PATCH 02/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/widget/BatteryView.kt | 5 ++++- .../java/io/legado/app/ui/widget/text/AccentBgTextView.kt | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt b/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt index 1711a650e..3c3c1d7c3 100644 --- a/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt @@ -12,7 +12,10 @@ import androidx.appcompat.widget.AppCompatTextView import io.legado.app.utils.dp import java.io.File -class BatteryView(context: Context, attrs: AttributeSet?) : AppCompatTextView(context, attrs) { +class BatteryView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : AppCompatTextView(context, attrs) { private val batteryPaint = Paint() private val outFrame = Rect() private val polar = Rect() 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 3d9df36f0..ccaffaf79 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 @@ -11,8 +11,10 @@ import io.legado.app.utils.ColorUtils import io.legado.app.utils.dp import io.legado.app.utils.getCompatColor -class AccentBgTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : - AppCompatTextView(context, attrs) { +class AccentBgTextView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : AppCompatTextView(context, attrs) { private var radius = 0 From 34fea0ce5d738451a9031d92f9ea44b1783de6e1 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 21:04:25 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/widget/anima/RotateLoading.kt | 22 ++++++------------- .../dynamiclayout/DynamicFrameLayout.kt | 5 ++++- .../app/ui/widget/image/CircleImageView.kt | 6 +++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt index 13c4f346d..e587da788 100644 --- a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt +++ b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt @@ -18,9 +18,13 @@ import io.legado.app.utils.dp * Created by Victor on 2015/4/28. */ @Suppress("MemberVisibilityCanBePrivate") -class RotateLoading : View { +class RotateLoading @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : View(context, attrs, defStyleAttr) { - private lateinit var mPaint: Paint + private var mPaint: Paint private var loadingRectF: RectF? = null private var shadowRectF: RectF? = null @@ -55,19 +59,7 @@ class RotateLoading : View { private val hidden = Runnable { this.stopInternal() } - constructor(context: Context) : super(context) { - initView(context, null) - } - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - initView(context, attrs) - } - - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { - initView(context, attrs) - } - - private fun initView(context: Context, attrs: AttributeSet?) { + init { loadingColor = context.accentColor thisWidth = DEFAULT_WIDTH.dp shadowPosition = DEFAULT_SHADOW_POSITION.dp diff --git a/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt b/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt index 683cbc5d9..d3115bdc9 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dynamiclayout/DynamicFrameLayout.kt @@ -13,7 +13,10 @@ import io.legado.app.R import kotlinx.android.synthetic.main.view_dynamic.view.* @Suppress("unused") -class DynamicFrameLayout(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs), ViewSwitcher { +class DynamicFrameLayout @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : FrameLayout(context, attrs), ViewSwitcher { private var errorView: View? = null private var errorImage: AppCompatImageView? = null diff --git a/app/src/main/java/io/legado/app/ui/widget/image/CircleImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/CircleImageView.kt index 2364deab7..f5781183e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/CircleImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/CircleImageView.kt @@ -25,8 +25,10 @@ import kotlin.math.min import kotlin.math.pow @Suppress("unused", "MemberVisibilityCanBePrivate") -class CircleImageView(context: Context, attrs: AttributeSet) : - AppCompatImageView(context, attrs) { +class CircleImageView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : AppCompatImageView(context, attrs) { private val mDrawableRect = RectF() private val mBorderRect = RectF() From b0f740dc820a96dbd7fd5721e0a77bf86fb7af8a Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 21:11:17 +0800 Subject: [PATCH 04/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/widget/seekbar/VerticalSeekBar.kt | 40 +++++-------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt index ab4509954..c700f4794 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt @@ -17,7 +17,15 @@ import java.lang.reflect.InvocationTargetException import java.lang.reflect.Method @Suppress("SameParameterValue") -class VerticalSeekBar : AppCompatSeekBar { +class VerticalSeekBar @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyle: Int = 0 +) : AppCompatSeekBar( + context, + attrs, + defStyle +) { private var mIsDragging: Boolean = false private var mThumb: Drawable? = null @@ -54,38 +62,12 @@ class VerticalSeekBar : AppCompatSeekBar { } } - constructor(context: Context) : super(context) { - initialize(context, null, 0, 0) - } - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - initialize(context, attrs, 0, 0) - } - - constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super( - context, - attrs, - defStyle - ) { - initialize(context, attrs, defStyle, 0) - } - - private fun initialize( - context: Context, - attrs: AttributeSet?, - defStyleAttr: Int, - defStyleRes: Int - ) { + init { ATH.setTint(this, ThemeStore.accentColor(context)) ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR) if (attrs != null) { - val a = context.obtainStyledAttributes( - attrs, - R.styleable.VerticalSeekBar, - defStyleAttr, - defStyleRes - ) + val a = context.obtainStyledAttributes(attrs, R.styleable.VerticalSeekBar, defStyle, 0) val rotationAngle = a.getInteger(R.styleable.VerticalSeekBar_seekBarRotation, 0) if (isValidRotationAngle(rotationAngle)) { mRotationAngle = rotationAngle From e19ecbadc1a555e85abf2453b38fe20edf5c94e9 Mon Sep 17 00:00:00 2001 From: 10bits Date: Tue, 20 Oct 2020 21:28:25 +0800 Subject: [PATCH 05/39] =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/widget/recycler/LoadMoreView.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt index 01cb906cb..57df4f6e0 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt @@ -32,7 +32,13 @@ class LoadMoreView(context: Context) : FrameLayout(context) { fun stopLoad() { rotate_loading.hide() } - + + fun hasMore() { + hasMore = true + tv_text.invisible() + rotate_loading.show() + } + fun noMore(msg: String? = null) { hasMore = false rotate_loading.hide() @@ -44,4 +50,4 @@ class LoadMoreView(context: Context) : FrameLayout(context) { tv_text.visible() } -} \ No newline at end of file +} From d8a53629556adc38e1eb09375a7aa4a9cf694d33 Mon Sep 17 00:00:00 2001 From: 10bits Date: Tue, 20 Oct 2020 21:31:26 +0800 Subject: [PATCH 06/39] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E4=B8=8D=E5=8F=AF=E4=BB=A5=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/explore/ExploreShowActivity.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt index a447bb9e1..5a6248869 100644 --- a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt @@ -38,6 +38,13 @@ class ExploreShowActivity : VMBaseActivity(R.layout.activi loadMoreView = LoadMoreView(this) adapter.addFooterView(loadMoreView) loadMoreView.startLoad() + loadMoreView.setOnClickListener { + if (!isLoading) { + isLoading = true + loadMoreView.hasMore() + scrollToBottom() + } + } recycler_view.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { super.onScrolled(recyclerView, dx, dy) @@ -75,4 +82,4 @@ class ExploreShowActivity : VMBaseActivity(R.layout.activi Pair("author", book.author) ) } -} \ No newline at end of file +} From cfa8460e1d23206c61029732ac10877472a751dd Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 22:40:21 +0800 Subject: [PATCH 07/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/constant/PreferKey.kt | 4 +- .../app/ui/book/read/ReadBookActivity.kt | 4 +- .../app/ui/book/read/config/PageKeyDialog.kt | 38 +++++++++---------- .../app/ui/widget/seekbar/VerticalSeekBar.kt | 7 ++-- .../io/legado/app/utils/ContextExtensions.kt | 2 +- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/io/legado/app/constant/PreferKey.kt b/app/src/main/java/io/legado/app/constant/PreferKey.kt index 0dbd518af..b55f35d57 100644 --- a/app/src/main/java/io/legado/app/constant/PreferKey.kt +++ b/app/src/main/java/io/legado/app/constant/PreferKey.kt @@ -12,8 +12,8 @@ object PreferKey { const val speakEngine = "speakEngine" const val readAloudByPage = "readAloudByPage" const val ttsSpeechRate = "ttsSpeechRate" - const val prevKey = "prevKeyCode" - const val nextKey = "nextKeyCode" + const val prevKeys = "prevKeyCodes" + const val nextKeys = "nextKeyCodes" const val showRss = "showRss" const val bookshelfLayout = "bookshelfLayout" const val bookshelfSort = "bookshelfSort" 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 c7f860697..6b518f89a 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 @@ -314,13 +314,13 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo */ override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { when (keyCode) { - getPrefInt(PreferKey.prevKey) -> { + getPrefInt(PreferKey.prevKeys) -> { if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { page_view.pageDelegate?.keyTurnPage(PageDelegate.Direction.PREV) return true } } - getPrefInt(PreferKey.nextKey) -> { + getPrefInt(PreferKey.nextKeys) -> { if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { page_view.pageDelegate?.keyTurnPage(PageDelegate.Direction.NEXT) return true diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt index cfd632453..04c5dabfa 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt @@ -6,10 +6,9 @@ import android.view.KeyEvent import io.legado.app.R import io.legado.app.constant.PreferKey import io.legado.app.lib.theme.backgroundColor -import io.legado.app.utils.getPrefInt +import io.legado.app.utils.getPrefString import io.legado.app.utils.hideSoftInput -import io.legado.app.utils.putPrefInt -import io.legado.app.utils.removePref +import io.legado.app.utils.putPrefString import kotlinx.android.synthetic.main.dialog_page_key.* import org.jetbrains.anko.sdk27.listeners.onClick @@ -19,21 +18,11 @@ class PageKeyDialog(context: Context) : Dialog(context, R.style.AppTheme_AlertDi init { setContentView(R.layout.dialog_page_key) content_view.setBackgroundColor(context.backgroundColor) - et_prev.setText(context.getPrefInt(PreferKey.prevKey).toString()) - et_next.setText(context.getPrefInt(PreferKey.nextKey).toString()) + et_prev.setText(context.getPrefString(PreferKey.prevKeys)) + et_next.setText(context.getPrefString(PreferKey.nextKeys)) tv_ok.onClick { - val prevKey = et_prev.text?.toString() - if (prevKey.isNullOrEmpty()) { - context.removePref(PreferKey.prevKey) - } else { - context.putPrefInt(PreferKey.prevKey, prevKey.toInt()) - } - val nextKey = et_next.text?.toString() - if (nextKey.isNullOrEmpty()) { - context.removePref(PreferKey.nextKey) - } else { - context.putPrefInt(PreferKey.nextKey, nextKey.toInt()) - } + context.putPrefString(PreferKey.prevKeys, et_prev.text?.toString()) + context.putPrefString(PreferKey.nextKeys, et_next.text?.toString()) dismiss() } } @@ -41,11 +30,20 @@ class PageKeyDialog(context: Context) : Dialog(context, R.style.AppTheme_AlertDi override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { if (keyCode != KeyEvent.KEYCODE_BACK) { if (et_prev.hasFocus()) { - et_prev.setText(keyCode.toString()) + val editableText = et_prev.editableText + if (editableText.isEmpty() or editableText.endsWith(",")) { + editableText.append(keyCode.toString()) + } else { + editableText.append(",").append(keyCode.toString()) + } } else if (et_next.hasFocus()) { - et_next.setText(keyCode.toString()) + val editableText = et_next.editableText + if (editableText.isEmpty() or editableText.endsWith(",")) { + editableText.append(keyCode.toString()) + } else { + editableText.append(",").append(keyCode.toString()) + } } - return true } return super.onKeyDown(keyCode, event) } diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt index c700f4794..61f509e32 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt @@ -20,11 +20,11 @@ import java.lang.reflect.Method class VerticalSeekBar @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, - defStyle: Int = 0 + defStyleAttr: Int = androidx.appcompat.R.attr.seekBarStyle ) : AppCompatSeekBar( context, attrs, - defStyle + defStyleAttr ) { private var mIsDragging: Boolean = false @@ -67,7 +67,8 @@ class VerticalSeekBar @JvmOverloads constructor( ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR) if (attrs != null) { - val a = context.obtainStyledAttributes(attrs, R.styleable.VerticalSeekBar, defStyle, 0) + val a = + context.obtainStyledAttributes(attrs, R.styleable.VerticalSeekBar, defStyleAttr, 0) val rotationAngle = a.getInteger(R.styleable.VerticalSeekBar_seekBarRotation, 0) if (isValidRotationAngle(rotationAngle)) { mRotationAngle = rotationAngle diff --git a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt index b99f935eb..7366cb602 100644 --- a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt @@ -56,7 +56,7 @@ fun Context.getPrefString(key: String, defValue: String? = null) = fun Context.getPrefString(@StringRes keyId: Int, defValue: String? = null) = defaultSharedPreferences.getString(getString(keyId), defValue) -fun Context.putPrefString(key: String, value: String) = +fun Context.putPrefString(key: String, value: String?) = defaultSharedPreferences.edit { putString(key, value) } fun Context.getPrefStringSet( From 445a9e2f13442b16ee6042c86abe3d3a6a3b486f Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 22:53:14 +0800 Subject: [PATCH 08/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/ReadBookActivity.kt | 12 ++++++------ app/src/main/res/layout/dialog_page_key.xml | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) 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 6b518f89a..1fcab63cc 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 @@ -313,30 +313,30 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo * 按键事件 */ override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { - when (keyCode) { - getPrefInt(PreferKey.prevKeys) -> { + when { + getPrefString(PreferKey.prevKeys)?.contains(keyCode.toString()) == true -> { if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { page_view.pageDelegate?.keyTurnPage(PageDelegate.Direction.PREV) return true } } - getPrefInt(PreferKey.nextKeys) -> { + getPrefString(PreferKey.nextKeys)?.contains(keyCode.toString()) == true -> { if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { page_view.pageDelegate?.keyTurnPage(PageDelegate.Direction.NEXT) return true } } - KeyEvent.KEYCODE_VOLUME_UP -> { + keyCode == KeyEvent.KEYCODE_VOLUME_UP -> { if (volumeKeyPage(PageDelegate.Direction.PREV)) { return true } } - KeyEvent.KEYCODE_VOLUME_DOWN -> { + keyCode == KeyEvent.KEYCODE_VOLUME_DOWN -> { if (volumeKeyPage(PageDelegate.Direction.NEXT)) { return true } } - KeyEvent.KEYCODE_SPACE -> { + keyCode == KeyEvent.KEYCODE_SPACE -> { page_view.pageDelegate?.keyTurnPage(PageDelegate.Direction.NEXT) return true } diff --git a/app/src/main/res/layout/dialog_page_key.xml b/app/src/main/res/layout/dialog_page_key.xml index f2e1c8a3a..ebcc8af7f 100644 --- a/app/src/main/res/layout/dialog_page_key.xml +++ b/app/src/main/res/layout/dialog_page_key.xml @@ -26,7 +26,6 @@ android:id="@+id/et_prev" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="number" android:singleLine="true" /> @@ -41,7 +40,6 @@ android:id="@+id/et_next" android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="number" android:singleLine="true" /> From 5367891f7016a386e7b3e048b1fea9b68283c95e Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 22:55:17 +0800 Subject: [PATCH 09/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/config/PageKeyDialog.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt index 04c5dabfa..5e570a96f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt @@ -28,7 +28,7 @@ class PageKeyDialog(context: Context) : Dialog(context, R.style.AppTheme_AlertDi } override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { - if (keyCode != KeyEvent.KEYCODE_BACK) { + if (keyCode != KeyEvent.KEYCODE_BACK && keyCode != KeyEvent.KEYCODE_DEL) { if (et_prev.hasFocus()) { val editableText = et_prev.editableText if (editableText.isEmpty() or editableText.endsWith(",")) { From cda19051081e54237206d832c05320c899d9d201 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 07:37:32 +0800 Subject: [PATCH 10/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/config/PageKeyDialog.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt index 5e570a96f..ce479caba 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt @@ -36,6 +36,7 @@ class PageKeyDialog(context: Context) : Dialog(context, R.style.AppTheme_AlertDi } else { editableText.append(",").append(keyCode.toString()) } + return true } else if (et_next.hasFocus()) { val editableText = et_next.editableText if (editableText.isEmpty() or editableText.endsWith(",")) { @@ -43,6 +44,7 @@ class PageKeyDialog(context: Context) : Dialog(context, R.style.AppTheme_AlertDi } else { editableText.append(",").append(keyCode.toString()) } + return true } } return super.onKeyDown(keyCode, event) From 462f6b7d20ae804c4b0df05cb339861511dcc392 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 07:48:07 +0800 Subject: [PATCH 11/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/widget/seekbar/VerticalSeekBar.kt | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt index 61f509e32..700ad1c33 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt @@ -17,15 +17,7 @@ import java.lang.reflect.InvocationTargetException import java.lang.reflect.Method @Suppress("SameParameterValue") -class VerticalSeekBar @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = androidx.appcompat.R.attr.seekBarStyle -) : AppCompatSeekBar( - context, - attrs, - defStyleAttr -) { +class VerticalSeekBar : AppCompatSeekBar { private var mIsDragging: Boolean = false private var mThumb: Drawable? = null @@ -62,13 +54,38 @@ class VerticalSeekBar @JvmOverloads constructor( } } - init { + constructor(context: Context) : super(context) { + initialize(context, null, 0, 0) + } + + constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { + initialize(context, attrs, 0, 0) + } + + constructor( + context: Context, + attrs: AttributeSet, + defStyle: Int + ) : super(context, attrs, defStyle) { + initialize(context, attrs, defStyle, 0) + } + + private fun initialize( + context: Context, + attrs: AttributeSet?, + defStyleAttr: Int, + defStyleRes: Int + ) { ATH.setTint(this, ThemeStore.accentColor(context)) ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR) if (attrs != null) { - val a = - context.obtainStyledAttributes(attrs, R.styleable.VerticalSeekBar, defStyleAttr, 0) + val a = context.obtainStyledAttributes( + attrs, + R.styleable.VerticalSeekBar, + defStyleAttr, + defStyleRes + ) val rotationAngle = a.getInteger(R.styleable.VerticalSeekBar_seekBarRotation, 0) if (isValidRotationAngle(rotationAngle)) { mRotationAngle = rotationAngle From 2a19fe8e35c3971e793656c96146d69eafd28579 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 07:54:58 +0800 Subject: [PATCH 12/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/widget/seekbar/VerticalSeekBar.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt index 700ad1c33..8154efa70 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt @@ -55,11 +55,11 @@ class VerticalSeekBar : AppCompatSeekBar { } constructor(context: Context) : super(context) { - initialize(context, null, 0, 0) + initialize(context, null, 0) } constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - initialize(context, attrs, 0, 0) + initialize(context, attrs, 0) } constructor( @@ -67,14 +67,13 @@ class VerticalSeekBar : AppCompatSeekBar { attrs: AttributeSet, defStyle: Int ) : super(context, attrs, defStyle) { - initialize(context, attrs, defStyle, 0) + initialize(context, attrs, defStyle) } private fun initialize( context: Context, attrs: AttributeSet?, - defStyleAttr: Int, - defStyleRes: Int + defStyleAttr: Int ) { ATH.setTint(this, ThemeStore.accentColor(context)) ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR) @@ -84,7 +83,7 @@ class VerticalSeekBar : AppCompatSeekBar { attrs, R.styleable.VerticalSeekBar, defStyleAttr, - defStyleRes + 0 ) val rotationAngle = a.getInteger(R.styleable.VerticalSeekBar_seekBarRotation, 0) if (isValidRotationAngle(rotationAngle)) { From 86dabae7d39315e4c9b3f8ac2df3cfef1ba99316 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 11:44:31 +0800 Subject: [PATCH 13/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/widget/seekbar/VerticalSeekBar.kt | 32 +++---------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt index 8154efa70..736b9eb3a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt @@ -17,7 +17,8 @@ import java.lang.reflect.InvocationTargetException import java.lang.reflect.Method @Suppress("SameParameterValue") -class VerticalSeekBar : AppCompatSeekBar { +class VerticalSeekBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : + AppCompatSeekBar(context, attrs) { private var mIsDragging: Boolean = false private var mThumb: Drawable? = null @@ -54,37 +55,12 @@ class VerticalSeekBar : AppCompatSeekBar { } } - constructor(context: Context) : super(context) { - initialize(context, null, 0) - } - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - initialize(context, attrs, 0) - } - - constructor( - context: Context, - attrs: AttributeSet, - defStyle: Int - ) : super(context, attrs, defStyle) { - initialize(context, attrs, defStyle) - } - - private fun initialize( - context: Context, - attrs: AttributeSet?, - defStyleAttr: Int - ) { + init { ATH.setTint(this, ThemeStore.accentColor(context)) ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR) if (attrs != null) { - val a = context.obtainStyledAttributes( - attrs, - R.styleable.VerticalSeekBar, - defStyleAttr, - 0 - ) + val a = context.obtainStyledAttributes(attrs, R.styleable.VerticalSeekBar) val rotationAngle = a.getInteger(R.styleable.VerticalSeekBar_seekBarRotation, 0) if (isValidRotationAngle(rotationAngle)) { mRotationAngle = rotationAngle From 717c90a6d1b30ef96341199eba93c0f41a35092f Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 13:23:35 +0800 Subject: [PATCH 14/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/ReadBookActivity.kt | 4 ++-- .../legado/app/ui/book/read/ReadBookActivityHelp.kt | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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 1fcab63cc..fc73a041c 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 @@ -314,13 +314,13 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo */ override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { when { - getPrefString(PreferKey.prevKeys)?.contains(keyCode.toString()) == true -> { + ReadBookActivityHelp.isPrevKey(this, keyCode) -> { if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { page_view.pageDelegate?.keyTurnPage(PageDelegate.Direction.PREV) return true } } - getPrefString(PreferKey.nextKeys)?.contains(keyCode.toString()) == true -> { + ReadBookActivityHelp.isNextKey(this, keyCode) -> { if (keyCode != KeyEvent.KEYCODE_UNKNOWN) { page_view.pageDelegate?.keyTurnPage(PageDelegate.Direction.NEXT) return true diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivityHelp.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivityHelp.kt index adb8909e1..78195ad05 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivityHelp.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivityHelp.kt @@ -13,6 +13,7 @@ import android.view.WindowManager import android.widget.EditText import io.legado.app.App import io.legado.app.R +import io.legado.app.constant.PreferKey import io.legado.app.data.entities.Bookmark import io.legado.app.help.AppConfig import io.legado.app.help.ReadBookConfig @@ -24,6 +25,7 @@ import io.legado.app.service.help.CacheBook import io.legado.app.service.help.ReadBook import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.utils.applyTint +import io.legado.app.utils.getPrefString import io.legado.app.utils.requestInputMethod import kotlinx.android.synthetic.main.dialog_download_choice.view.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* @@ -186,4 +188,14 @@ object ReadBookActivityHelp { cancelButton() }.show().applyTint() } + + fun isPrevKey(context: Context, keyCode: Int): Boolean { + val prevKeysStr = context.getPrefString(PreferKey.prevKeys) + return prevKeysStr?.split(",")?.contains(keyCode.toString()) ?: false + } + + fun isNextKey(context: Context, keyCode: Int): Boolean { + val nextKeysStr = context.getPrefString(PreferKey.nextKeys) + return nextKeysStr?.split(",")?.contains(keyCode.toString()) ?: false + } } \ No newline at end of file From b4f5082c5eac618162b0acfd0529a8d77369c03a Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 15:41:11 +0800 Subject: [PATCH 15/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 5ad10ab4f..c0287ef2d 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -3,8 +3,9 @@ * 关注合作公众号 **[小说拾遗]()** 获取好看的小说。 * 旧版数据导入教程:先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】。 -**2020/10/20** +**2020/10/21** * 默认分组无书籍时自动隐藏 +* 自定义翻页按键支持多个按键 **2020/10/19** * 优化分组管理 From f3d7ada58185c5654941012dffafc9c8f9bdc0f8 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 17:38:40 +0800 Subject: [PATCH 16/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/widget/text/AutoCompleteTextView.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/text/AutoCompleteTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/AutoCompleteTextView.kt index c7eb18ee4..cff5714f4 100644 --- a/app/src/main/java/io/legado/app/ui/widget/text/AutoCompleteTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/AutoCompleteTextView.kt @@ -19,9 +19,8 @@ import org.jetbrains.anko.sdk27.listeners.onClick @Suppress("unused") class AutoCompleteTextView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : AppCompatAutoCompleteTextView(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : AppCompatAutoCompleteTextView(context, attrs) { var delCallBack: ((value: String) -> Unit)? = null From 4f9728e51d706caf7e40fb86591d6063f2d71e7b Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 19:12:27 +0800 Subject: [PATCH 17/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/widget/ArcView.kt | 5 ++--- .../java/io/legado/app/ui/widget/SearchView.kt | 5 ++--- .../app/ui/widget/anima/RefreshProgressBar.kt | 5 ++--- .../legado/app/ui/widget/anima/RotateLoading.kt | 5 ++--- .../legado/app/ui/widget/image/CoverImageView.kt | 6 ++---- .../legado/app/ui/widget/image/FilletImageView.kt | 5 ++--- .../io/legado/app/ui/widget/image/PhotoView.kt | 5 ++--- .../legado/app/ui/widget/recycler/LoadMoreView.kt | 3 ++- .../ui/widget/seekbar/VerticalSeekBarWrapper.kt | 5 ++--- .../io/legado/app/ui/widget/text/BadgeView.kt | 6 +++--- .../app/ui/widget/text/InertiaScrollTextView.kt | 15 ++++++--------- 11 files changed, 27 insertions(+), 38 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/ArcView.kt b/app/src/main/java/io/legado/app/ui/widget/ArcView.kt index 6338c6638..b92d552af 100644 --- a/app/src/main/java/io/legado/app/ui/widget/ArcView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/ArcView.kt @@ -8,9 +8,8 @@ import io.legado.app.R class ArcView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : View(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : View(context, attrs) { private var mWidth = 0 private var mHeight = 0 diff --git a/app/src/main/java/io/legado/app/ui/widget/SearchView.kt b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt index 82d24c671..975fe9d57 100644 --- a/app/src/main/java/io/legado/app/ui/widget/SearchView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt @@ -18,9 +18,8 @@ import io.legado.app.R class SearchView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : SearchView(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : SearchView(context, attrs) { private var mSearchHintIcon: Drawable? = null private var textView: TextView? = null diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt b/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt index 1791b3be7..3a0af5b03 100644 --- a/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/anima/RefreshProgressBar.kt @@ -14,9 +14,8 @@ import io.legado.app.R @Suppress("unused", "MemberVisibilityCanBePrivate") class RefreshProgressBar @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : View(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : View(context, attrs) { private var a = 1 private var durProgress = 0 private var secondDurProgress = 0 diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt index e587da788..634f9689e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt +++ b/app/src/main/java/io/legado/app/ui/widget/anima/RotateLoading.kt @@ -20,9 +20,8 @@ import io.legado.app.utils.dp @Suppress("MemberVisibilityCanBePrivate") class RotateLoading @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : View(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : View(context, attrs) { private var mPaint: Paint diff --git a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt index 5a85a0573..d09eae0dd 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt @@ -22,12 +22,10 @@ import io.legado.app.utils.getPrefString @Suppress("unused") class CoverImageView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 + attrs: AttributeSet? = null ) : androidx.appcompat.widget.AppCompatImageView( context, - attrs, - defStyleAttr + attrs ) { internal var width: Float = 0.toFloat() internal var height: Float = 0.toFloat() diff --git a/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt index 57428fe47..eefcdafc8 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/FilletImageView.kt @@ -12,9 +12,8 @@ import kotlin.math.max class FilletImageView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : AppCompatImageView(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : AppCompatImageView(context, attrs) { internal var width: Float = 0.toFloat() internal var height: Float = 0.toFloat() private var leftTopRadius: Int = 0 diff --git a/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt b/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt index 08cc63e3a..5d80f087e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/PhotoView.kt @@ -27,9 +27,8 @@ import kotlin.math.roundToInt @Suppress("UNUSED_PARAMETER", "unused", "MemberVisibilityCanBePrivate", "PropertyName") class PhotoView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : AppCompatImageView(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : AppCompatImageView(context, attrs) { val MIN_ROTATE = 35 val ANIMA_DURING = 340 val MAX_SCALE = 2.5f diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt index 57df4f6e0..ed62431e1 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.widget.recycler import android.content.Context +import android.util.AttributeSet import android.view.View import android.view.ViewGroup import android.widget.FrameLayout @@ -10,7 +11,7 @@ import io.legado.app.utils.visible import kotlinx.android.synthetic.main.view_load_more.view.* @Suppress("unused") -class LoadMoreView(context: Context) : FrameLayout(context) { +class LoadMoreView(context: Context, attrs: AttributeSet? = null) : FrameLayout(context, attrs) { var hasMore = true private set diff --git a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt index da69c33ab..683953f1a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt +++ b/app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBarWrapper.kt @@ -13,9 +13,8 @@ import kotlin.math.max class VerticalSeekBarWrapper @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : FrameLayout(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : FrameLayout(context, attrs) { private val childSeekBar: VerticalSeekBar? get() { diff --git a/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt b/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt index c24e13e87..353fa9de4 100644 --- a/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt @@ -24,11 +24,11 @@ import io.legado.app.utils.visible /** * Created by milad heydari on 5/6/2016. */ +@Suppress("MemberVisibilityCanBePrivate", "unused") class BadgeView @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyle: Int = android.R.attr.textViewStyle -) : AppCompatTextView(context, attrs, defStyle) { + attrs: AttributeSet? = null +) : AppCompatTextView(context, attrs) { var isHideOnNull = true set(hideOnNull) { diff --git a/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt index 051d5af4e..9644b8676 100644 --- a/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/InertiaScrollTextView.kt @@ -15,14 +15,11 @@ import kotlin.math.max import kotlin.math.min -open class InertiaScrollTextView : AppCompatTextView { - constructor(context: Context) : super(context) - - constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) - - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) - : super(context, attrs, defStyleAttr) - +@Suppress("unused") +open class InertiaScrollTextView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null +) : AppCompatTextView(context, attrs) { private val scrollStateIdle = 0 private val scrollStateDragging = 1 @@ -218,7 +215,7 @@ open class InertiaScrollTextView : AppCompatTextView { } } - internal fun postOnAnimation() { + fun postOnAnimation() { if (mEatRunOnAnimationRequest) { mReSchedulePostAnimationCallback = true } else { From 3e0d96f032535781bd00f3db906e44ad1492c336 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 19:46:24 +0800 Subject: [PATCH 18/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/dialog_page_key.xml | 7 +++++++ app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 5 files changed, 11 insertions(+) diff --git a/app/src/main/res/layout/dialog_page_key.xml b/app/src/main/res/layout/dialog_page_key.xml index ebcc8af7f..8c5b7a1fa 100644 --- a/app/src/main/res/layout/dialog_page_key.xml +++ b/app/src/main/res/layout/dialog_page_key.xml @@ -44,6 +44,13 @@ + + 全文搜索 关注公众号[开源阅读]获取订阅源! 当前没有发现源,关注公众号[开源阅读]添加带发现的书源! + 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index e30d9bddf..16a4e98a8 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -769,5 +769,6 @@ 全文搜尋 關注公眾號[开源阅读]獲取訂閱源! 目前沒有發現源,關注公眾號[开源阅读]添加包含發現的書源! + 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 270f502de..a8d2982f2 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -772,5 +772,6 @@ 全文搜索 关注公众号[开源阅读]获取订阅源! 当前没有发现源,关注公众号[开源阅读]添加带发现的书源! + 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7c257fcfc..e132ccf76 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -775,5 +775,6 @@ Search content 关注公众号[开源阅读]获取订阅源! 当前没有发现源,关注公众号[开源阅读]添加带发现的书源! + 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. From 5f0a55ea616b862e2ca2dc900f8a18d862629afd Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 19:54:56 +0800 Subject: [PATCH 19/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E5=AD=97?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BD=8D=E7=BD=AE=E4=B8=8D=E5=AF=B9=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/page/ContentView.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 166a9b731..2b9d034e8 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -33,9 +33,11 @@ class ContentView(context: Context) : FrameLayout(context) { private var tvBookName: BatteryView? = null val headerHeight: Int - get() = if (ReadBookConfig.hideStatusBar) { - if (ll_header.isGone) 0 else ll_header.height - } else context.statusBarHeight + get() { + val h1 = if (ReadBookConfig.hideStatusBar) 0 else context.statusBarHeight + val h2 = if (ll_header.isGone) 0 else ll_header.height + return h1 + h2 + } init { //设置背景防止切换背景时文字重叠 From 67270fc82447aa388352cd647dd0fa6b2e493c66 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 20:39:47 +0800 Subject: [PATCH 20/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=BB=9A=E5=8A=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/read/page/ContentTextView.kt | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 295ccb0ef..575279a1c 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -23,7 +23,9 @@ import io.legado.app.utils.getCompatColor import io.legado.app.utils.getPrefBoolean import kotlinx.coroutines.CoroutineScope - +/** + * 阅读内容界面 + */ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, attrs) { var selectAble = context.getPrefBoolean(PreferKey.textSelectAble) var upView: ((TextPage) -> Unit)? = null @@ -41,7 +43,6 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at //滚动参数 private val pageFactory: TextPageFactory get() = callBack.pageFactory - private val maxScrollOffset = 100f private var pageOffset = 0f init { @@ -173,17 +174,13 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at */ fun onScroll(mOffset: Float) { if (mOffset == 0f) return - var offset = mOffset - if (offset > maxScrollOffset) { - offset = maxScrollOffset - } else if (offset < -maxScrollOffset) { - offset = -maxScrollOffset - } - - pageOffset += offset + pageOffset += mOffset if (!pageFactory.hasPrev() && pageOffset > 0) { pageOffset = 0f - } else if (!pageFactory.hasNext() && pageOffset < 0) { + } else if (!pageFactory.hasNext() + && pageOffset < 0 + && pageOffset + textPage.height < ChapterProvider.visibleHeight + ) { pageOffset = 0f } else if (pageOffset > 0) { pageFactory.moveToPrev(false) @@ -263,7 +260,10 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at for ((charIndex, textChar) in textLine.textChars.withIndex()) { if (x > textChar.start && x < textChar.end) { if (selectStart[0] != relativePos || selectStart[1] != lineIndex || selectStart[2] != charIndex) { - if (selectToInt(relativePos, lineIndex, charIndex) > selectToInt(selectEnd)) { + if (selectToInt(relativePos, lineIndex, charIndex) > selectToInt( + selectEnd + ) + ) { return } selectStart[0] = relativePos @@ -306,7 +306,10 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at if (x > textChar.start && x < textChar.end) { Log.e("char", "$relativePos $lineIndex $charIndex") if (selectEnd[0] != relativePos || selectEnd[1] != lineIndex || selectEnd[2] != charIndex) { - if (selectToInt(relativePos, lineIndex, charIndex) < selectToInt(selectStart)) { + if (selectToInt(relativePos, lineIndex, charIndex) < selectToInt( + selectStart + ) + ) { return } selectEnd[0] = relativePos From ef7bc6ec31a6ddd0f91039aa8d8cddaa825a7a61 Mon Sep 17 00:00:00 2001 From: AndyBernie Date: Wed, 21 Oct 2020 20:56:12 +0800 Subject: [PATCH 21/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:java.ajax(url)?= =?UTF-8?q?=E5=9C=A8=E6=9F=90=E4=BA=9B=E6=83=85=E5=86=B5=E4=B8=8B=E6=9C=AA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4ua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 3680e5322..b4401bd39 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -188,9 +188,9 @@ class AnalyzeUrl( GSON.fromJsonObject>(headers) ?.let { headerMap.putAll(it) } } - headerMap[UA_NAME] ?: let { - headerMap[UA_NAME] = userAgent - } + } + headerMap[UA_NAME] ?: let { + headerMap[UA_NAME] = userAgent } option.charset?.let { charset = it } option.body?.let { From b00d857ec07cf9e14183bb2f544b26ef7a75fe08 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 21:36:14 +0800 Subject: [PATCH 22/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index c0287ef2d..18b66bd0f 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -3,6 +3,10 @@ * 关注合作公众号 **[小说拾遗]()** 获取好看的小说。 * 旧版数据导入教程:先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】。 +**2020/10/22** +* 修复选择错误的bug +* 修复长图最后一张不能滚动的bug + **2020/10/21** * 默认分组无书籍时自动隐藏 * 自定义翻页按键支持多个按键 From 646958ecd0a4dd0cee48049b5e7cfd5c056ec523 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Oct 2020 21:57:59 +0800 Subject: [PATCH 23/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/ReadMenu.kt | 5 ++--- .../anima/explosion_field/ExplosionView.kt | 22 +++---------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt index 40af2c32d..d1480ac81 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt @@ -26,9 +26,8 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick */ class ReadMenu @JvmOverloads constructor( context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : FrameLayout(context, attrs, defStyleAttr) { + attrs: AttributeSet? = null +) : FrameLayout(context, attrs) { var cnaShowMenu: Boolean = false private val callBack: CallBack? get() = activity as? CallBack private lateinit var menuTopIn: Animation diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/ExplosionView.kt b/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/ExplosionView.kt index 9eef530f2..7345e7ed9 100644 --- a/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/ExplosionView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/ExplosionView.kt @@ -30,7 +30,8 @@ import java.util.* @Suppress("unused") -class ExplosionView : View { +class ExplosionView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : + View(context, attrs) { private var customDuration = ExplosionAnimator.DEFAULT_DURATION private var idPlayAnimationEffect = 0 @@ -40,24 +41,7 @@ class ExplosionView : View { private val mExplosions = ArrayList() private val mExpandInset = IntArray(2) - constructor(context: Context) : super(context) { - init() - } - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - init() - } - - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super( - context, - attrs, - defStyleAttr - ) { - init() - } - - private fun init() { - + init { Arrays.fill(mExpandInset, Utils.dp2Px(32)) } From 8554aed5434fa5b74b58d8de6a5824b974cfdd8c Mon Sep 17 00:00:00 2001 From: 10bits Date: Wed, 21 Oct 2020 11:15:52 -0500 Subject: [PATCH 24/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=82=B9=E5=87=BB=E5=8A=A0=E8=BD=BD=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/explore/ExploreShowActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt index 5a6248869..270e7e703 100644 --- a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt @@ -40,9 +40,9 @@ class ExploreShowActivity : VMBaseActivity(R.layout.activi loadMoreView.startLoad() loadMoreView.setOnClickListener { if (!isLoading) { - isLoading = true loadMoreView.hasMore() scrollToBottom() + isLoading = true } } recycler_view.addOnScrollListener(object : RecyclerView.OnScrollListener() { From 3cb703d88be5a25affcc9002c3d8ab3554c39eff Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 22 Oct 2020 08:30:50 +0800 Subject: [PATCH 25/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/model/analyzeRule/AnalyzeRule.kt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index 8fb5e2c0f..11dcbab2c 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -649,16 +649,12 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { * 章节数转数字 */ fun toNumChapter(s: String?): String? { - if (s == null) { - return null - } - val pattern = Pattern.compile("(第)(.+?)(章)") - val matcher = pattern.matcher(s) - return if (matcher.find()) { - matcher.group(1)!! + StringUtils.stringToInt(matcher.group(2)) + matcher.group(3) - } else { - s + s ?: return null + val matcher = titleNumPattern.matcher(s) + if (matcher.find()) { + return "${matcher.group(1)}${StringUtils.stringToInt(matcher.group(2))}${matcher.group(3)}" } + return s } companion object { @@ -667,6 +663,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { private val evalPattern = Pattern.compile("@get:\\{[^}]+?\\}|\\{\\{[\\w\\W]*?\\}\\}", Pattern.CASE_INSENSITIVE) private val regexPattern = Pattern.compile("\\$\\d{1,2}") + private val titleNumPattern = Pattern.compile("(第)(.+?)(章)") } } From a9e2f98f8dd2589d0c6a349cf5ec3ba5435a7fe5 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 22 Oct 2020 09:27:43 +0800 Subject: [PATCH 26/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/App.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/App.kt b/app/src/main/java/io/legado/app/App.kt index 64f037fa4..d6bdb24f5 100644 --- a/app/src/main/java/io/legado/app/App.kt +++ b/app/src/main/java/io/legado/app/App.kt @@ -7,7 +7,6 @@ import android.content.res.Configuration import android.graphics.Color import android.os.Build import android.provider.Settings -import android.util.Log import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatDelegate import androidx.multidex.MultiDexApplication From 1c4c922e20f4f68f45bc1cb9ac2963aa57de634d Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 22 Oct 2020 09:43:01 +0800 Subject: [PATCH 27/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/App.kt | 72 ++----------------- .../java/io/legado/app/help/ThemeConfig.kt | 60 ++++++++++++++++ .../app/ui/config/ThemeConfigFragment.kt | 2 +- 3 files changed, 65 insertions(+), 69 deletions(-) diff --git a/app/src/main/java/io/legado/app/App.kt b/app/src/main/java/io/legado/app/App.kt index d6bdb24f5..02dd32dae 100644 --- a/app/src/main/java/io/legado/app/App.kt +++ b/app/src/main/java/io/legado/app/App.kt @@ -4,7 +4,6 @@ import android.app.NotificationChannel import android.app.NotificationManager import android.content.Context import android.content.res.Configuration -import android.graphics.Color import android.os.Build import android.provider.Settings import androidx.annotation.RequiresApi @@ -15,14 +14,10 @@ import io.legado.app.constant.AppConst.channelIdDownload import io.legado.app.constant.AppConst.channelIdReadAloud import io.legado.app.constant.AppConst.channelIdWeb import io.legado.app.constant.EventBus -import io.legado.app.constant.PreferKey import io.legado.app.data.AppDatabase -import io.legado.app.help.ActivityHelp -import io.legado.app.help.AppConfig -import io.legado.app.help.CrashHandler -import io.legado.app.help.ReadBookConfig -import io.legado.app.lib.theme.ThemeStore -import io.legado.app.utils.* +import io.legado.app.help.* +import io.legado.app.utils.LanguageUtils +import io.legado.app.utils.postEvent @Suppress("DEPRECATION") class App : MultiDexApplication() { @@ -71,68 +66,9 @@ class App : MultiDexApplication() { } } - /** - * 更新主题 - */ - fun applyTheme() { - when { - AppConfig.isEInkMode -> { - ThemeStore.editTheme(this) - .coloredNavigationBar(true) - .primaryColor(Color.WHITE) - .accentColor(Color.BLACK) - .backgroundColor(Color.WHITE) - .bottomBackground(Color.WHITE) - .apply() - } - AppConfig.isNightTheme -> { - val primary = - getPrefInt(PreferKey.cNPrimary, getCompatColor(R.color.md_blue_grey_600)) - val accent = - getPrefInt(PreferKey.cNAccent, getCompatColor(R.color.md_deep_orange_800)) - var background = - getPrefInt(PreferKey.cNBackground, getCompatColor(R.color.md_grey_900)) - if (ColorUtils.isColorLight(background)) { - background = getCompatColor(R.color.md_grey_900) - putPrefInt(PreferKey.cNBackground, background) - } - val bBackground = - getPrefInt(PreferKey.cNBBackground, getCompatColor(R.color.md_grey_850)) - ThemeStore.editTheme(this) - .coloredNavigationBar(true) - .primaryColor(ColorUtils.withAlpha(primary, 1f)) - .accentColor(ColorUtils.withAlpha(accent, 1f)) - .backgroundColor(ColorUtils.withAlpha(background, 1f)) - .bottomBackground(ColorUtils.withAlpha(bBackground, 1f)) - .apply() - } - else -> { - val primary = - getPrefInt(PreferKey.cPrimary, getCompatColor(R.color.md_brown_500)) - val accent = - getPrefInt(PreferKey.cAccent, getCompatColor(R.color.md_red_600)) - var background = - getPrefInt(PreferKey.cBackground, getCompatColor(R.color.md_grey_100)) - if (!ColorUtils.isColorLight(background)) { - background = getCompatColor(R.color.md_grey_100) - putPrefInt(PreferKey.cBackground, background) - } - val bBackground = - getPrefInt(PreferKey.cBBackground, getCompatColor(R.color.md_grey_200)) - ThemeStore.editTheme(this) - .coloredNavigationBar(true) - .primaryColor(ColorUtils.withAlpha(primary, 1f)) - .accentColor(ColorUtils.withAlpha(accent, 1f)) - .backgroundColor(ColorUtils.withAlpha(background, 1f)) - .bottomBackground(ColorUtils.withAlpha(bBackground, 1f)) - .apply() - } - } - } - fun applyDayNight() { ReadBookConfig.upBg() - applyTheme() + ThemeConfig.applyTheme(this) initNightMode() postEvent(EventBus.RECREATE, "") } diff --git a/app/src/main/java/io/legado/app/help/ThemeConfig.kt b/app/src/main/java/io/legado/app/help/ThemeConfig.kt index 44948e17c..74a42a2ed 100644 --- a/app/src/main/java/io/legado/app/help/ThemeConfig.kt +++ b/app/src/main/java/io/legado/app/help/ThemeConfig.kt @@ -7,6 +7,7 @@ import io.legado.app.App import io.legado.app.R import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey +import io.legado.app.lib.theme.ThemeStore import io.legado.app.utils.* import java.io.File @@ -137,6 +138,65 @@ object ThemeConfig { addConfig(config) } + /** + * 更新主题 + */ + fun applyTheme(context: Context) = with(context) { + when { + AppConfig.isEInkMode -> { + ThemeStore.editTheme(this) + .coloredNavigationBar(true) + .primaryColor(Color.WHITE) + .accentColor(Color.BLACK) + .backgroundColor(Color.WHITE) + .bottomBackground(Color.WHITE) + .apply() + } + AppConfig.isNightTheme -> { + val primary = + getPrefInt(PreferKey.cNPrimary, getCompatColor(R.color.md_blue_grey_600)) + val accent = + getPrefInt(PreferKey.cNAccent, getCompatColor(R.color.md_deep_orange_800)) + var background = + getPrefInt(PreferKey.cNBackground, getCompatColor(R.color.md_grey_900)) + if (ColorUtils.isColorLight(background)) { + background = getCompatColor(R.color.md_grey_900) + putPrefInt(PreferKey.cNBackground, background) + } + val bBackground = + getPrefInt(PreferKey.cNBBackground, getCompatColor(R.color.md_grey_850)) + ThemeStore.editTheme(this) + .coloredNavigationBar(true) + .primaryColor(ColorUtils.withAlpha(primary, 1f)) + .accentColor(ColorUtils.withAlpha(accent, 1f)) + .backgroundColor(ColorUtils.withAlpha(background, 1f)) + .bottomBackground(ColorUtils.withAlpha(bBackground, 1f)) + .apply() + } + else -> { + val primary = + getPrefInt(PreferKey.cPrimary, getCompatColor(R.color.md_brown_500)) + val accent = + getPrefInt(PreferKey.cAccent, getCompatColor(R.color.md_red_600)) + var background = + getPrefInt(PreferKey.cBackground, getCompatColor(R.color.md_grey_100)) + if (!ColorUtils.isColorLight(background)) { + background = getCompatColor(R.color.md_grey_100) + putPrefInt(PreferKey.cBackground, background) + } + val bBackground = + getPrefInt(PreferKey.cBBackground, getCompatColor(R.color.md_grey_200)) + ThemeStore.editTheme(this) + .coloredNavigationBar(true) + .primaryColor(ColorUtils.withAlpha(primary, 1f)) + .accentColor(ColorUtils.withAlpha(accent, 1f)) + .backgroundColor(ColorUtils.withAlpha(background, 1f)) + .bottomBackground(ColorUtils.withAlpha(bBackground, 1f)) + .apply() + } + } + } + @Keep class Config( var themeName: String, 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 4b76ebc3e..0912da631 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 @@ -203,7 +203,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), private fun upTheme(isNightTheme: Boolean) { if (AppConfig.isNightTheme == isNightTheme) { listView.post { - App.INSTANCE.applyTheme() + ThemeConfig.applyTheme(requireContext()) recreateActivities() } } From e5b7f3abe291b591b1a4f6ae024f0f324028a34b Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 22 Oct 2020 09:44:30 +0800 Subject: [PATCH 28/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/config/ThemeConfigFragment.kt | 2 +- app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) 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 0912da631..9b5d38e30 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 @@ -177,7 +177,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), @SuppressLint("InflateParams") private fun saveThemeAlert(key: String) { - alert("主题名称") { + alert(R.string.theme_name) { var editText: AutoCompleteTextView? = null customView { layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index d5d78e8a8..598a5577d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -770,5 +770,6 @@ 关注公众号[开源阅读]获取订阅源! 当前没有发现源,关注公众号[开源阅读]添加带发现的书源! 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. + 主题名称 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 16a4e98a8..17b939c02 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -770,5 +770,6 @@ 關注公眾號[开源阅读]獲取訂閱源! 目前沒有發現源,關注公眾號[开源阅读]添加包含發現的書源! 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. + 主题名称 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index a8d2982f2..18c518d9c 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -773,5 +773,6 @@ 关注公众号[开源阅读]获取订阅源! 当前没有发现源,关注公众号[开源阅读]添加带发现的书源! 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. + 主题名称 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e132ccf76..cdb9bc509 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -776,5 +776,6 @@ 关注公众号[开源阅读]获取订阅源! 当前没有发现源,关注公众号[开源阅读]添加带发现的书源! 将焦点放到输入框按下物理按键会自动录入键值,多个按键会自动用英文逗号隔开. + 主题名称 From 206994b84dbe93a2d1aa347d067cd4816675eff7 Mon Sep 17 00:00:00 2001 From: fisher Date: Thu, 22 Oct 2020 15:11:37 +0800 Subject: [PATCH 29/39] Update light novel type --- app/src/main/assets/txtTocRule.json | 128 ++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 app/src/main/assets/txtTocRule.json diff --git a/app/src/main/assets/txtTocRule.json b/app/src/main/assets/txtTocRule.json new file mode 100644 index 000000000..030e7ac26 --- /dev/null +++ b/app/src/main/assets/txtTocRule.json @@ -0,0 +1,128 @@ +[ + { + "id": -1, + "enable": true, + "name": "目录(去空白)", + "rule": "(?<=[ \\s])(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|篇(?!张))).{0,30}$", + "serialNumber": 0 + }, + { + "id": -2, + "enable": true, + "name": "目录", + "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|篇(?!张))).{0,30}$", + "serialNumber": 1 + }, + { + "id": -3, + "enable": false, + "name": "目录(匹配简介)", + "rule": "(?<=[ \\s])(?:(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|篇(?!张))).{0,30}$", + "serialNumber": 2 + }, + { + "id": -4, + "enable": false, + "name": "目录(古典、轻小说备用)", + "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|话|篇(?!张))).{0,30}$", + "serialNumber": 3 + }, + { + "id": -5, + "enable": false, + "name": "数字(纯数字标题)", + "rule": "(?<=[ \\s])\\d+\\.?[  \\t]{0,4}$", + "serialNumber": 4 + }, + { + "id": -6, + "enable": true, + "name": "数字 分隔符 标题名称", + "rule": "^[  \\t]{0,4}\\d{1,5}[::,., 、_—\\-].{1,30}$", + "serialNumber": 5 + }, + { + "id": -7, + "enable": true, + "name": "大写数字 分隔符 标题名称", + "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|[零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[ 、_—\\-].{1,30}$", + "serialNumber": 6 + }, + { + "id": -8, + "enable": true, + "name": "正文 标题/序号", + "rule": "^[  \\t]{0,4}正文[  ]{1,4}.{0,20}$", + "serialNumber": 7 + }, + { + "id": -9, + "enable": true, + "name": "Chapter/Section/Part/Episode 序号 标题", + "rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][oO]\\.|[Ee]pisode|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)\\s{0,4}\\d{1,4}.{0,30}$", + "serialNumber": 8 + }, + { + "id": -10, + "enable": false, + "name": "Chapter(去简介)", + "rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][Oo]\\.|[Ee]pisode)\\s{0,4}\\d{1,4}.{0,30}$", + "serialNumber": 9 + }, + { + "id": -11, + "enable": true, + "name": "特殊符号 序号 标题", + "rule": "(?<=[\\s ])[【〔〖「『〈[\\[](?:第|[Cc]hapter)[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,10}[章节].{0,20}$", + "serialNumber": 10 + }, + { + "id": -12, + "enable": false, + "name": "特殊符号 标题(成对)", + "rule": "(?<=[\\s ]{0,4})(?:[\\[〈「『〖〔《(【\\(].{1,30}[\\)】)》〕〗』」〉\\]]?|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$", + "serialNumber": 11 + }, + { + "id": -13, + "enable":true, + "name": "特殊符号 标题(单个)", + "rule": "(?<=[\\s ]{0,4})(?:[☆★✦✧].{1,30}|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$", + "serialNumber": 12 + }, + { + "id": -14, + "enable": true, + "name": "章/卷 序号 标题", + "rule": "^[ \\t ]{0,4}(?:(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|[卷章][\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[  ]{0,4}.{0,30}$", + "serialNumber": 13 + }, + { + "id": -15, + "enable":false, + "name": "顶格标题", + "rule": "^\\S.{1,20}$", + "serialNumber": 14 + }, + { + "id": -16, + "enable":false, + "name": "双标题(前向)", + "rule": "(?m)(?<=[ \\t ]{0,4})第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$(?=[\\s ]{0,8}第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章)", + "serialNumber": 15 + }, + { + "id": -17, + "enable":false, + "name": "双标题(后向)", + "rule": "(?m)(?<=[ \\t ]{0,4}第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$[\\s ]{0,8})第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$", + "serialNumber": 16 + }, + { + "id":-18, + "enable": true, + "name": "标题 特殊符号 序号", + "rule": "^.{1,20}[((][\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}[))][  \t]{0,4}$", + "serialNumber": 17 + } +] From e928efbddf4c6bd4f8bc3bfacc113c17845edaf4 Mon Sep 17 00:00:00 2001 From: fisher Date: Thu, 22 Oct 2020 15:16:32 +0800 Subject: [PATCH 30/39] update to latest --- .../main/assets/defaultData/txtTocRule.json | 4 +- app/src/main/assets/txtTocRule.json | 128 ------------------ 2 files changed, 2 insertions(+), 130 deletions(-) delete mode 100644 app/src/main/assets/txtTocRule.json diff --git a/app/src/main/assets/defaultData/txtTocRule.json b/app/src/main/assets/defaultData/txtTocRule.json index 58e9e8644..57cb4bfdb 100644 --- a/app/src/main/assets/defaultData/txtTocRule.json +++ b/app/src/main/assets/defaultData/txtTocRule.json @@ -24,7 +24,7 @@ "id": -4, "enable": false, "name": "目录(古典、轻小说备用)", - "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|篇(?!张))).{0,30}$", + "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|话|篇(?!张))).{0,30}$", "serialNumber": 3 }, { @@ -125,4 +125,4 @@ "rule": "^.{1,20}[((][\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}[))][  \t]{0,4}$", "serialNumber": 17 } -] +] \ No newline at end of file diff --git a/app/src/main/assets/txtTocRule.json b/app/src/main/assets/txtTocRule.json deleted file mode 100644 index 030e7ac26..000000000 --- a/app/src/main/assets/txtTocRule.json +++ /dev/null @@ -1,128 +0,0 @@ -[ - { - "id": -1, - "enable": true, - "name": "目录(去空白)", - "rule": "(?<=[ \\s])(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|篇(?!张))).{0,30}$", - "serialNumber": 0 - }, - { - "id": -2, - "enable": true, - "name": "目录", - "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|篇(?!张))).{0,30}$", - "serialNumber": 1 - }, - { - "id": -3, - "enable": false, - "name": "目录(匹配简介)", - "rule": "(?<=[ \\s])(?:(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|篇(?!张))).{0,30}$", - "serialNumber": 2 - }, - { - "id": -4, - "enable": false, - "name": "目录(古典、轻小说备用)", - "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|话|篇(?!张))).{0,30}$", - "serialNumber": 3 - }, - { - "id": -5, - "enable": false, - "name": "数字(纯数字标题)", - "rule": "(?<=[ \\s])\\d+\\.?[  \\t]{0,4}$", - "serialNumber": 4 - }, - { - "id": -6, - "enable": true, - "name": "数字 分隔符 标题名称", - "rule": "^[  \\t]{0,4}\\d{1,5}[::,., 、_—\\-].{1,30}$", - "serialNumber": 5 - }, - { - "id": -7, - "enable": true, - "name": "大写数字 分隔符 标题名称", - "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|[零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[ 、_—\\-].{1,30}$", - "serialNumber": 6 - }, - { - "id": -8, - "enable": true, - "name": "正文 标题/序号", - "rule": "^[  \\t]{0,4}正文[  ]{1,4}.{0,20}$", - "serialNumber": 7 - }, - { - "id": -9, - "enable": true, - "name": "Chapter/Section/Part/Episode 序号 标题", - "rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][oO]\\.|[Ee]pisode|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)\\s{0,4}\\d{1,4}.{0,30}$", - "serialNumber": 8 - }, - { - "id": -10, - "enable": false, - "name": "Chapter(去简介)", - "rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][Oo]\\.|[Ee]pisode)\\s{0,4}\\d{1,4}.{0,30}$", - "serialNumber": 9 - }, - { - "id": -11, - "enable": true, - "name": "特殊符号 序号 标题", - "rule": "(?<=[\\s ])[【〔〖「『〈[\\[](?:第|[Cc]hapter)[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,10}[章节].{0,20}$", - "serialNumber": 10 - }, - { - "id": -12, - "enable": false, - "name": "特殊符号 标题(成对)", - "rule": "(?<=[\\s ]{0,4})(?:[\\[〈「『〖〔《(【\\(].{1,30}[\\)】)》〕〗』」〉\\]]?|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$", - "serialNumber": 11 - }, - { - "id": -13, - "enable":true, - "name": "特殊符号 标题(单个)", - "rule": "(?<=[\\s ]{0,4})(?:[☆★✦✧].{1,30}|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$", - "serialNumber": 12 - }, - { - "id": -14, - "enable": true, - "name": "章/卷 序号 标题", - "rule": "^[ \\t ]{0,4}(?:(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|[卷章][\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[  ]{0,4}.{0,30}$", - "serialNumber": 13 - }, - { - "id": -15, - "enable":false, - "name": "顶格标题", - "rule": "^\\S.{1,20}$", - "serialNumber": 14 - }, - { - "id": -16, - "enable":false, - "name": "双标题(前向)", - "rule": "(?m)(?<=[ \\t ]{0,4})第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$(?=[\\s ]{0,8}第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章)", - "serialNumber": 15 - }, - { - "id": -17, - "enable":false, - "name": "双标题(后向)", - "rule": "(?m)(?<=[ \\t ]{0,4}第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$[\\s ]{0,8})第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$", - "serialNumber": 16 - }, - { - "id":-18, - "enable": true, - "name": "标题 特殊符号 序号", - "rule": "^.{1,20}[((][\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}[))][  \t]{0,4}$", - "serialNumber": 17 - } -] From 6e99db4add5175f13ec7b7192c469752eb179ecc Mon Sep 17 00:00:00 2001 From: AndyBernie Date: Thu, 22 Oct 2020 20:49:05 +0800 Subject: [PATCH 31/39] =?UTF-8?q?js:=E6=B7=BB=E5=8A=A0java.getCookie(baseU?= =?UTF-8?q?rl)=E8=AF=BB=E5=8F=96=E7=99=BB=E5=BD=95cookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/JsExtensions.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index 7ba245bcd..ff7357ad4 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -4,6 +4,7 @@ import android.util.Base64 import androidx.annotation.Keep import io.legado.app.constant.AppConst.dateFormat import io.legado.app.help.http.SSLHelper +import io.legado.app.help.http.CookieStore import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.utils.* import org.jsoup.Connection @@ -119,6 +120,13 @@ interface JsExtensions { .execute() } + /** + *js实现读取cookie + */ + fun getCookie(tag: String): String { + return CookieStore.getCookie(tag) + } + /** * js实现解码,不能删 */ From e27211ff8094b32eb6e04fad22583311dd4cb938 Mon Sep 17 00:00:00 2001 From: AndyBernie Date: Thu, 22 Oct 2020 22:12:03 +0800 Subject: [PATCH 32/39] =?UTF-8?q?=E6=AD=A3=E6=96=87=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=EF=BC=9A=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/BookHelp.kt | 2 +- .../java/io/legado/app/help/http/HttpHelper.kt | 15 --------------- .../io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 12 ------------ 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 537737c3f..59359fbc7 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -101,7 +101,7 @@ object BookHelp { downloadImages.add(src) val analyzeUrl = AnalyzeUrl(src) try { - analyzeUrl.getImageBytes(book.origin)?.let { + analyzeUrl.getResponseBytes(book.origin)?.let { FileUtils.createFileIfNotExist( downloadDir, cacheFolderName, diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 3728f4819..a226b46d6 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -48,21 +48,6 @@ object HttpHelper { return null } - fun getBytes( - url: String, - queryMap: Map, - headers: Map - ): ByteArray? { - NetworkUtils.getBaseUrl(url)?.let { baseUrl -> - return getByteRetrofit(baseUrl) - .create(HttpGetApi::class.java) - .getMapByte(url, queryMap, headers) - .execute() - .body() - } - return null - } - suspend fun simpleGetAsync(url: String, encode: String? = null): String? { NetworkUtils.getBaseUrl(url)?.let { baseUrl -> val response = getApiService(baseUrl, encode) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index b4401bd39..a4729341e 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -352,18 +352,6 @@ class AnalyzeUrl( return Res(NetworkUtils.getUrl(res), res.body()) } - fun getImageBytes(tag: String): ByteArray? { - val cookie = CookieStore.getCookie(tag) - if (cookie.isNotEmpty()) { - headerMap["Cookie"] += cookie - } - return if (fieldMap.isEmpty()) { - HttpHelper.getBytes(url, mapOf(), headerMap) - } else { - HttpHelper.getBytes(url, fieldMap, headerMap) - } - } - suspend fun getResponseBytes(tag: String? = null): ByteArray? { if (tag != null) { val cookie = CookieStore.getCookie(tag) From e2ba01806107fbe8523e34b760ad0dfad78ddcfa Mon Sep 17 00:00:00 2001 From: AndyBernie Date: Thu, 22 Oct 2020 23:47:26 +0800 Subject: [PATCH 33/39] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84cookie=E8=A2=AB=E4=B8=8D=E4=BC=9A=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=9A=84cookie=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index a4729341e..160c0debf 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -281,7 +281,7 @@ class AnalyzeUrl( fun getResponse(tag: String): Call { val cookie = CookieStore.getCookie(tag) if (cookie.isNotEmpty()) { - headerMap["Cookie"] = cookie + headerMap["Cookie"] += ";${cookie}" } return when { method == RequestMethod.POST -> { @@ -324,7 +324,7 @@ class AnalyzeUrl( } val cookie = CookieStore.getCookie(tag) if (cookie.isNotEmpty()) { - headerMap["Cookie"] = cookie + headerMap["Cookie"] += ";${cookie}" } val res = when { method == RequestMethod.POST -> { @@ -356,7 +356,7 @@ class AnalyzeUrl( if (tag != null) { val cookie = CookieStore.getCookie(tag) if (cookie.isNotEmpty()) { - headerMap["Cookie"] = cookie + headerMap["Cookie"] += ";${cookie}" } } val response = when { From 114aeec0adf23b38dbfdae1b9d6a2256c62262d4 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 23 Oct 2020 10:40:49 +0800 Subject: [PATCH 34/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 18b66bd0f..a0bbdf6c3 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -3,9 +3,10 @@ * 关注合作公众号 **[小说拾遗]()** 获取好看的小说。 * 旧版数据导入教程:先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】。 -**2020/10/22** +**2020/10/23** * 修复选择错误的bug * 修复长图最后一张不能滚动的bug +* js添加java.getCookie(sourceUrl)来获取登录后的cookie by [AndyBernie](https://github.com/AndyBernie) **2020/10/21** * 默认分组无书籍时自动隐藏 From 5368103d3a6f1c60d77a85f24c7119d8e5e1273a Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 23 Oct 2020 11:16:21 +0800 Subject: [PATCH 35/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/about/AboutFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt index eea2feba4..d6c7df52a 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt @@ -29,7 +29,8 @@ class AboutFragment : PreferenceFragmentCompat() { Pair("(QQ群3)981838750", "g_Sgmp2nQPKqcZQ5qPcKLHziwX_mpps9"), Pair("(QQ群4)256929088", "czEJPLDnT4Pd9SKQ6RoRVzKhDxLchZrO"), Pair("(QQ群5)811843556", "zKZ2UYGZ7o5CzcA6ylxzlqi21si_iqaX"), - Pair("(QQ群6)870270970", "FeCF8iSxfQbe90HPvGsvcqs5P5oSeY5n") + Pair("(QQ群6)870270970", "FeCF8iSxfQbe90HPvGsvcqs5P5oSeY5n"), + Pair("(QQ群7)15987187", "S2g2TMD0LGd3sefUADd1AbyPEW2o2XfC") ) override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { From 7b80ec9380c727abc670ec2dd00189d699bb9f18 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 23 Oct 2020 11:34:11 +0800 Subject: [PATCH 36/39] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/ThemeConfig.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ThemeConfig.kt b/app/src/main/java/io/legado/app/help/ThemeConfig.kt index 74a42a2ed..4f92a039a 100644 --- a/app/src/main/java/io/legado/app/help/ThemeConfig.kt +++ b/app/src/main/java/io/legado/app/help/ThemeConfig.kt @@ -15,16 +15,16 @@ object ThemeConfig { const val configFileName = "themeConfig.json" val configFilePath = FileUtils.getPath(App.INSTANCE.filesDir, configFileName) - val configList = arrayListOf() - - init { - upConfig() + val configList: ArrayList by lazy { + val cList = getConfigs() ?: DefaultData.defaultThemeConfigs + ArrayList(cList) } fun upConfig() { - (getConfigs() ?: DefaultData.defaultThemeConfigs).let { - configList.clear() - configList.addAll(it) + getConfigs()?.let { + it.forEach { config -> + addConfig(config) + } } } From f7c0f98214719ad9e531cf972c492579536c099d Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 23 Oct 2020 17:19:33 +0800 Subject: [PATCH 37/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AE=80=E7=B9=81?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E6=B2=A1=E6=9C=89=E8=BD=AC=E6=8D=A2=E6=A0=87?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/BookHelp.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 59359fbc7..6380d44ed 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -355,16 +355,6 @@ object BookHelp { } } } - try { - when (AppConfig.chineseConverterType) { - 1 -> c = HanLP.convertToSimplifiedChinese(c) - 2 -> c = HanLP.convertToTraditionalChinese(c) - } - } catch (e: Exception) { - withContext(Main) { - App.INSTANCE.toast("简繁转换出错") - } - } val contents = arrayListOf() c.split("\n").forEach { val str = it.replace("^[\\n\\s\\r]+".toRegex(), "") @@ -377,6 +367,16 @@ object BookHelp { contents.add("${ReadBookConfig.paragraphIndent}$str") } } + try { + when (AppConfig.chineseConverterType) { + 1 -> c = HanLP.convertToSimplifiedChinese(c) + 2 -> c = HanLP.convertToTraditionalChinese(c) + } + } catch (e: Exception) { + withContext(Main) { + App.INSTANCE.toast("简繁转换出错") + } + } return contents } } \ No newline at end of file From 4022ea68ba1f12d2440432450281d5a4ffb74929 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 23 Oct 2020 17:24:15 +0800 Subject: [PATCH 38/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AE=80=E7=B9=81?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E6=B2=A1=E6=9C=89=E8=BD=AC=E6=8D=A2=E6=A0=87?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/BookHelp.kt | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 6380d44ed..18222d870 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -324,7 +324,8 @@ object BookHelp { content: String, enableReplace: Boolean, ): List { - var c = content + var title1 = title + var content1 = content if (enableReplace) { synchronized(this) { if (bookName != name || bookOrigin != origin) { @@ -341,10 +342,10 @@ object BookHelp { item.pattern.let { if (it.isNotEmpty()) { try { - c = if (item.isRegex) { - c.replace(it.toRegex(), item.replacement) + content1 = if (item.isRegex) { + content1.replace(it.toRegex(), item.replacement) } else { - c.replace(it, item.replacement) + content1.replace(it, item.replacement) } } catch (e: Exception) { withContext(Main) { @@ -355,28 +356,34 @@ object BookHelp { } } } + try { + when (AppConfig.chineseConverterType) { + 1 -> { + title1 = HanLP.convertToSimplifiedChinese(title1) + content1 = HanLP.convertToSimplifiedChinese(content1) + } + 2 -> { + title1 = HanLP.convertToTraditionalChinese(title1) + content1 = HanLP.convertToTraditionalChinese(content1) + } + } + } catch (e: Exception) { + withContext(Main) { + App.INSTANCE.toast("简繁转换出错") + } + } val contents = arrayListOf() - c.split("\n").forEach { + content1.split("\n").forEach { val str = it.replace("^[\\n\\s\\r]+".toRegex(), "") if (contents.isEmpty()) { - contents.add(title) - if (str != title && str.isNotEmpty()) { + contents.add(title1) + if (str != title1 && str.isNotEmpty()) { contents.add("${ReadBookConfig.paragraphIndent}$str") } } else if (str.isNotEmpty()) { contents.add("${ReadBookConfig.paragraphIndent}$str") } } - try { - when (AppConfig.chineseConverterType) { - 1 -> c = HanLP.convertToSimplifiedChinese(c) - 2 -> c = HanLP.convertToTraditionalChinese(c) - } - } catch (e: Exception) { - withContext(Main) { - App.INSTANCE.toast("简繁转换出错") - } - } return contents } } \ No newline at end of file From 012d0c9d3e80a6f7bc890ebfe5f917d8f8244b0e Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 23 Oct 2020 17:25:14 +0800 Subject: [PATCH 39/39] update log --- app/src/main/assets/updateLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index a0bbdf6c3..011689a1b 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -7,6 +7,7 @@ * 修复选择错误的bug * 修复长图最后一张不能滚动的bug * js添加java.getCookie(sourceUrl)来获取登录后的cookie by [AndyBernie](https://github.com/AndyBernie) +* 修复简繁转换没有处理标题 **2020/10/21** * 默认分组无书籍时自动隐藏