From 44ce6fa9fc036026e6d22e6283f1c0540d90613a Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 12 Feb 2020 12:22:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 2 +- .../java/io/legado/app/ui/book/search/SearchActivity.kt | 6 +++--- .../java/io/legado/app/ui/explore/ExploreShowActivity.kt | 2 +- .../io/legado/app/ui/rss/article/RssArticlesActivity.kt | 2 +- .../io/legado/app/ui/widget/{ => recycler}/LoadMoreView.kt | 6 +++--- app/src/main/res/layout/view_load_more.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) rename app/src/main/java/io/legado/app/ui/widget/{ => recycler}/LoadMoreView.kt (86%) diff --git a/app/build.gradle b/app/build.gradle index a1d82937c..8c5adfcaa 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -149,7 +149,7 @@ dependencies { implementation 'com.jayway.jsonpath:json-path:2.4.0' //JS rhino - implementation 'io.apisense:rhino-android:1.1.1' + implementation 'com.github.gedoor:rhino-android:1.4' //Retrofit implementation 'com.squareup.okhttp3:logging-interceptor:4.1.0' 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 de916fd23..d97bee198 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 @@ -22,7 +22,7 @@ import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.primaryTextColor import io.legado.app.ui.book.info.BookInfoActivity import io.legado.app.ui.book.source.manage.BookSourceActivity -import io.legado.app.ui.widget.LoadMoreView +import io.legado.app.ui.widget.recycler.LoadMoreView import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_book_search.* import kotlinx.android.synthetic.main.view_search.* @@ -268,12 +268,12 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se diffResult.dispatchUpdatesTo(adapter) } - fun startSearch() { + private fun startSearch() { refresh_progress_bar.isAutoLoading = true fb_stop.visible() } - fun searchFinally() { + private fun searchFinally() { refresh_progress_bar.isAutoLoading = false loadMoreView.startLoad() fb_stop.invisible() diff --git a/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt b/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt index 267aafd89..8cc5d7c7e 100644 --- a/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt +++ b/app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt @@ -9,7 +9,7 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.data.entities.Book import io.legado.app.data.entities.SearchBook import io.legado.app.ui.book.info.BookInfoActivity -import io.legado.app.ui.widget.LoadMoreView +import io.legado.app.ui.widget.recycler.LoadMoreView import io.legado.app.utils.getVerticalDivider import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_explore_show.* diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt index 1b87581c6..5476657a4 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt @@ -14,7 +14,7 @@ import io.legado.app.data.entities.RssArticle import io.legado.app.lib.theme.ATH import io.legado.app.ui.rss.read.ReadRssActivity import io.legado.app.ui.rss.source.edit.RssSourceEditActivity -import io.legado.app.ui.widget.LoadMoreView +import io.legado.app.ui.widget.recycler.LoadMoreView import io.legado.app.utils.getVerticalDivider import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_rss_artivles.* diff --git a/app/src/main/java/io/legado/app/ui/widget/LoadMoreView.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt similarity index 86% rename from app/src/main/java/io/legado/app/ui/widget/LoadMoreView.kt rename to app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt index ee17ee735..a2437c0b4 100644 --- a/app/src/main/java/io/legado/app/ui/widget/LoadMoreView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt @@ -1,7 +1,7 @@ -package io.legado.app.ui.widget +package io.legado.app.ui.widget.recycler import android.content.Context -import android.view.LayoutInflater +import android.view.View import android.view.ViewGroup import android.widget.FrameLayout import io.legado.app.R @@ -15,7 +15,7 @@ class LoadMoreView(context: Context) : FrameLayout(context) { private set init { - LayoutInflater.from(context).inflate(R.layout.view_load_more, this, true) + View.inflate(context, R.layout.view_load_more, this) } override fun onAttachedToWindow() { diff --git a/app/src/main/res/layout/view_load_more.xml b/app/src/main/res/layout/view_load_more.xml index 21b0491c9..c4a7ea04f 100644 --- a/app/src/main/res/layout/view_load_more.xml +++ b/app/src/main/res/layout/view_load_more.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file