diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8b943cc65..b30b4bf58 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -93,6 +93,34 @@ android:resource="@xml/shortcuts" android:launchMode="singleTask" /> + + + + + + + + + + + + + + + + 【备份与恢复】,选择【导入旧版本数据】。 * 请关注[开源阅读]()支持我,同时关注合作公众号[小说拾遗](),阅读公众号小编。 +* 弄了个企业公众号[开源阅读](),后面弄好后会把原来的开源阅读软件迁移过来 + +**2020/03/18** +* 尝试修复搜索时崩溃 +* 解决看过书籍的移到顶部需要向上滚动才能看到的bug +* 只有再书源被删除找不到书源时才会自动换源 **2020/03/16** -* 弄了个企业公众号[开源阅读](),后面弄好后会把原来的开源阅读软件迁移过来 * 修复滚动模式切换章节位置不归0的bug * 修复文字选择更多菜单在部分手机上报错的bug * 修复文字选择菜单问题 diff --git a/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt b/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt index 70f72f55a..90c63e4b7 100644 --- a/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt +++ b/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt @@ -18,7 +18,8 @@ object LauncherIconHelp { ComponentName(App.INSTANCE, Launcher1::class.java.name), ComponentName(App.INSTANCE, Launcher2::class.java.name), ComponentName(App.INSTANCE, Launcher3::class.java.name), - ComponentName(App.INSTANCE, Launcher4::class.java.name) + ComponentName(App.INSTANCE, Launcher4::class.java.name), + ComponentName(App.INSTANCE, Launcher5::class.java.name) ) fun changeIcon(icon: String?) { diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index 2d1054859..8de6a489c 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -283,10 +283,12 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se */ @Synchronized private fun upSearchItems(items: List, isMandatoryUpdate: Boolean) { + val searchItems = ArrayList(items) if (isMandatoryUpdate || System.currentTimeMillis() - refreshTime > 500) { refreshTime = System.currentTimeMillis() - val diffResult = DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), items)) - adapter.setItems(items, diffResult) + val diffResult = + DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), searchItems)) + adapter.setItems(searchItems, diffResult) } } diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index 4a91379ae..d82480ca2 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -27,6 +27,7 @@ import io.legado.app.utils.getViewModelOfActivity import io.legado.app.utils.observeEvent import kotlinx.android.synthetic.main.fragment_books.* import org.jetbrains.anko.startActivity +import kotlin.math.max class BooksFragment : BaseFragment(R.layout.fragment_books), @@ -72,19 +73,23 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), booksAdapter = BooksAdapterList(requireContext(), this) } else { rv_bookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout + 2) - booksAdapter = BooksAdapterGrid(requireContext(),this) + booksAdapter = BooksAdapterGrid(requireContext(), this) } rv_bookshelf.adapter = booksAdapter booksAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { - if (positionStart == 0) { - + val layoutManager = rv_bookshelf.layoutManager + if (positionStart == 0 && layoutManager is LinearLayoutManager) { + val scrollTo = layoutManager.findFirstVisibleItemPosition() - itemCount + rv_bookshelf.scrollToPosition(max(0, scrollTo)) } } override fun onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int) { - if (toPosition == 0) { - + val layoutManager = rv_bookshelf.layoutManager + if (toPosition == 0 && layoutManager is LinearLayoutManager) { + val scrollTo = layoutManager.findFirstVisibleItemPosition() - itemCount + rv_bookshelf.scrollToPosition(max(0, scrollTo)) } } }) diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt index 0f9f3d729..faf9cef8a 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt @@ -12,6 +12,7 @@ import io.legado.app.data.entities.BookSource import io.legado.app.help.coroutine.Coroutine import io.legado.app.lib.theme.accentColor import io.legado.app.utils.ACache +import io.legado.app.utils.dp import io.legado.app.utils.gone import io.legado.app.utils.visible import kotlinx.android.synthetic.main.item_fillet_text.view.* @@ -28,6 +29,11 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList) { with(holder.itemView) { + if (holder.layoutPosition == getActualItemCount() - 1) { + setPadding(16.dp, 12.dp, 16.dp, 12.dp) + } else { + setPadding(16.dp, 12.dp, 16.dp, 0) + } if (payloads.isEmpty()) { tv_name.text = item.bookSourceName } diff --git a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt index 08eb06a70..fdf77bc85 100644 --- a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt +++ b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt @@ -59,4 +59,6 @@ open class WelcomeActivity : BaseActivity(R.layout.activity_welcome) { class Launcher1 : WelcomeActivity() class Launcher2 : WelcomeActivity() class Launcher3 : WelcomeActivity() -class Launcher4 : WelcomeActivity() \ No newline at end of file +class Launcher4 : WelcomeActivity() +class Launcher5 : WelcomeActivity() +class Launcher6 : WelcomeActivity() \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_2.xml b/app/src/main/res/drawable-v24/ic_launcher_2.xml deleted file mode 100644 index b4343492c..000000000 --- a/app/src/main/res/drawable-v24/ic_launcher_2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/drawable-v24/ic_launcher_2b.xml b/app/src/main/res/drawable-v24/ic_launcher_2b.xml deleted file mode 100644 index be66fb2a7..000000000 --- a/app/src/main/res/drawable-v24/ic_launcher_2b.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_bottom_books_e.xml b/app/src/main/res/drawable/ic_bottom_books_e.xml index 16efedae5..04d36c375 100644 --- a/app/src/main/res/drawable/ic_bottom_books_e.xml +++ b/app/src/main/res/drawable/ic_bottom_books_e.xml @@ -4,9 +4,9 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_bottom_books_s.xml b/app/src/main/res/drawable/ic_bottom_books_s.xml index 0c6d1144b..8f5f72542 100644 --- a/app/src/main/res/drawable/ic_bottom_books_s.xml +++ b/app/src/main/res/drawable/ic_bottom_books_s.xml @@ -1,41 +1,12 @@ - - - - - - - - - - - - - - - - + + diff --git a/app/src/main/res/drawable/ic_bottom_explore_e.xml b/app/src/main/res/drawable/ic_bottom_explore_e.xml index 37f7a5929..47e4bde9d 100644 --- a/app/src/main/res/drawable/ic_bottom_explore_e.xml +++ b/app/src/main/res/drawable/ic_bottom_explore_e.xml @@ -4,9 +4,9 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_bottom_explore_s.xml b/app/src/main/res/drawable/ic_bottom_explore_s.xml index be7cba1eb..6dc6e4322 100644 --- a/app/src/main/res/drawable/ic_bottom_explore_s.xml +++ b/app/src/main/res/drawable/ic_bottom_explore_s.xml @@ -1,24 +1,9 @@ - - - - - - - - + diff --git a/app/src/main/res/drawable/ic_bottom_person_e.xml b/app/src/main/res/drawable/ic_bottom_person_e.xml index e14f45566..d01128391 100644 --- a/app/src/main/res/drawable/ic_bottom_person_e.xml +++ b/app/src/main/res/drawable/ic_bottom_person_e.xml @@ -4,9 +4,9 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_bottom_person_s.xml b/app/src/main/res/drawable/ic_bottom_person_s.xml index be5213686..3ff7fc8c4 100644 --- a/app/src/main/res/drawable/ic_bottom_person_s.xml +++ b/app/src/main/res/drawable/ic_bottom_person_s.xml @@ -1,41 +1,12 @@ - - - - - - - - - - - - - - - - + + diff --git a/app/src/main/res/drawable/ic_bottom_rss_feed_e.xml b/app/src/main/res/drawable/ic_bottom_rss_feed_e.xml index 08f219fcb..c1c4ba0e3 100644 --- a/app/src/main/res/drawable/ic_bottom_rss_feed_e.xml +++ b/app/src/main/res/drawable/ic_bottom_rss_feed_e.xml @@ -4,9 +4,9 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_bottom_rss_feed_s.xml b/app/src/main/res/drawable/ic_bottom_rss_feed_s.xml index 60374f709..a73c01430 100644 --- a/app/src/main/res/drawable/ic_bottom_rss_feed_s.xml +++ b/app/src/main/res/drawable/ic_bottom_rss_feed_s.xml @@ -1,24 +1,9 @@ - - - - - - - - + diff --git a/app/src/main/res/drawable/ic_help.xml b/app/src/main/res/drawable/ic_help.xml new file mode 100644 index 000000000..931a86bf6 --- /dev/null +++ b/app/src/main/res/drawable/ic_help.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_launcher1.xml b/app/src/main/res/drawable/ic_launcher1.xml new file mode 100644 index 000000000..18c829634 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher1.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher1_b.xml b/app/src/main/res/drawable/ic_launcher1_b.xml new file mode 100644 index 000000000..559d07c34 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher1_b.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v24/ic_launcher_1.xml b/app/src/main/res/drawable/ic_launcher2.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_launcher_1.xml rename to app/src/main/res/drawable/ic_launcher2.xml diff --git a/app/src/main/res/drawable-v24/ic_launcher_3.xml b/app/src/main/res/drawable/ic_launcher3.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_launcher_3.xml rename to app/src/main/res/drawable/ic_launcher3.xml diff --git a/app/src/main/res/drawable-v24/ic_launcher_4.xml b/app/src/main/res/drawable/ic_launcher4.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_launcher_4.xml rename to app/src/main/res/drawable/ic_launcher4.xml diff --git a/app/src/main/res/drawable/ic_launcher_5.xml b/app/src/main/res/drawable/ic_launcher5.xml similarity index 82% rename from app/src/main/res/drawable/ic_launcher_5.xml rename to app/src/main/res/drawable/ic_launcher5.xml index caa666949..29435836b 100644 --- a/app/src/main/res/drawable/ic_launcher_5.xml +++ b/app/src/main/res/drawable/ic_launcher5.xml @@ -5,50 +5,50 @@ android:viewportHeight="108"> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> + android:fillColor="#EDEDED" /> diff --git a/app/src/main/res/drawable/ic_launcher5_b.xml b/app/src/main/res/drawable/ic_launcher5_b.xml new file mode 100644 index 000000000..9a5153369 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher5_b.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_launcher6.xml b/app/src/main/res/drawable/ic_launcher6.xml new file mode 100644 index 000000000..1bb711f8f --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher6.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher7.xml b/app/src/main/res/drawable/ic_launcher7.xml new file mode 100644 index 000000000..983784aef --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher7.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher7_b.xml b/app/src/main/res/drawable/ic_launcher7_b.xml new file mode 100644 index 000000000..76214f1e4 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher7_b.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_launcher_5b.xml b/app/src/main/res/drawable/ic_launcher_5b.xml deleted file mode 100644 index 6abd9cbac..000000000 --- a/app/src/main/res/drawable/ic_launcher_5b.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_live_help_black_24dp.xml b/app/src/main/res/drawable/ic_live_help_black_24dp.xml deleted file mode 100644 index 8b9c1ac46..000000000 --- a/app/src/main/res/drawable/ic_live_help_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/layout/item_find_book.xml b/app/src/main/res/layout/item_find_book.xml index 900aa9eed..d689630d2 100644 --- a/app/src/main/res/layout/item_find_book.xml +++ b/app/src/main/res/layout/item_find_book.xml @@ -4,9 +4,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="15dp" - android:paddingLeft="16dp" - android:paddingRight="16dp" android:gravity="center" android:orientation="vertical"> @@ -36,7 +33,8 @@ android:layout_gravity="center" android:layout_marginRight="4dp" app:hide_mode="gone" - app:loading_width="1dp" /> + app:loading_width="1dp" + tools:ignore="RtlHardcoded" /> - + android:orientation="vertical"> - + android:gravity="center_vertical"> - + + + + + + android:orientation="vertical" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> - + diff --git a/app/src/main/res/menu/main_my.xml b/app/src/main/res/menu/main_my.xml index 74e555dff..02b6acbd0 100644 --- a/app/src/main/res/menu/main_my.xml +++ b/app/src/main/res/menu/main_my.xml @@ -6,7 +6,7 @@ diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 40ee239b2..7a68d4392 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher1.xml b/app/src/main/res/mipmap-anydpi-v26/launcher1.xml index 57e845ad3..b3aa68018 100644 --- a/app/src/main/res/mipmap-anydpi-v26/launcher1.xml +++ b/app/src/main/res/mipmap-anydpi-v26/launcher1.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher2.xml b/app/src/main/res/mipmap-anydpi-v26/launcher2.xml index 409e0d965..5de236bd2 100644 --- a/app/src/main/res/mipmap-anydpi-v26/launcher2.xml +++ b/app/src/main/res/mipmap-anydpi-v26/launcher2.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher3.xml b/app/src/main/res/mipmap-anydpi-v26/launcher3.xml index 24428243f..9e7ef6711 100644 --- a/app/src/main/res/mipmap-anydpi-v26/launcher3.xml +++ b/app/src/main/res/mipmap-anydpi-v26/launcher3.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher4.xml b/app/src/main/res/mipmap-anydpi-v26/launcher4.xml index 22463230c..63e51b918 100644 --- a/app/src/main/res/mipmap-anydpi-v26/launcher4.xml +++ b/app/src/main/res/mipmap-anydpi-v26/launcher4.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher5.xml b/app/src/main/res/mipmap-anydpi-v26/launcher5.xml new file mode 100644 index 000000000..7a23c7c66 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/launcher5.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher6.xml b/app/src/main/res/mipmap-anydpi-v26/launcher6.xml new file mode 100644 index 000000000..4ba689a93 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/launcher6.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index 66ab5d53d..0fe58e361 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index 24f2180fb..59526eefd 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index e7b02cc36..58b1e389a 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index b41e4253d..ea95882bd 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 5ec228901..fe1be3fde 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values/array_values.xml b/app/src/main/res/values/array_values.xml index dd0842163..40bc6684e 100644 --- a/app/src/main/res/values/array_values.xml +++ b/app/src/main/res/values/array_values.xml @@ -7,6 +7,8 @@ launcher2 launcher3 launcher4 + launcher5 + launcher6 diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index cb61d6daa..39c85cae3 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -80,6 +80,8 @@ icon2 icon3 icon4 + icon5 + icon6