pull/34/head
kunfei 5 years ago
parent 5505659dcf
commit 095d3126c6
  1. 16
      app/src/main/AndroidManifest.xml
  2. 2
      app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt
  3. 2
      app/src/main/java/io/legado/app/service/BaseReadAloudService.kt
  4. 8
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  5. 2
      app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt
  6. 2
      app/src/main/java/io/legado/app/ui/book/info/ChapterListAdapter.kt
  7. 2
      app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditActivity.kt
  8. 2
      app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditViewModel.kt
  9. 2
      app/src/main/java/io/legado/app/ui/book/read/Help.kt
  10. 9
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  11. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt
  12. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
  13. 4
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  14. 7
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  15. 4
      app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt
  16. 7
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt
  17. 4
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  18. 6
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt
  19. 2
      app/src/main/java/io/legado/app/ui/book/search/DiffCallBack.kt
  20. 4
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt
  21. 2
      app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt
  22. 2
      app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt
  23. 4
      app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugActivity.kt
  24. 2
      app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugAdapter.kt
  25. 2
      app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugModel.kt
  26. 320
      app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt
  27. 8
      app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditAdapter.kt
  28. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditViewModel.kt
  29. 11
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  30. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt
  31. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt
  32. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/DiffCallBack.kt
  33. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt
  34. 2
      app/src/main/java/io/legado/app/ui/explore/ExploreShowActivity.kt
  35. 6
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  36. 2
      app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt
  37. 2
      app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt
  38. 3
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt
  39. 2
      app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt
  40. 2
      app/src/main/java/io/legado/app/ui/rss/source/RssSourceActivity.kt
  41. 2
      app/src/main/res/layout/activity_explore_show.xml
  42. 2
      app/src/main/res/layout/activity_read_book.xml
  43. 2
      app/src/main/res/layout/activity_search.xml
  44. 2
      app/src/main/res/xml/shortcuts.xml

@ -39,7 +39,7 @@
</activity>
<activity android:name=".ui.main.MainActivity" />
<activity
android:name=".ui.readbook.ReadBookActivity"
android:name=".ui.book.read.ReadBookActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:launchMode="singleTask" />
<activity
@ -47,22 +47,22 @@
android:theme="@style/Activity.Permission" />
<activity android:name=".ui.config.ConfigActivity" />
<activity
android:name=".ui.sourceedit.SourceEditActivity"
android:name=".ui.book.source.edit.SourceEditActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity android:name=".ui.replacerule.ReplaceRuleActivity" />
<activity android:name=".ui.search.SearchActivity" />
<activity android:name="io.legado.app.ui.book.search.SearchActivity" />
<activity android:name=".ui.about.AboutActivity" />
<activity android:name=".ui.bookshelf.BookshelfActivity" />
<activity android:name=".ui.qrcode.QrCodeActivity" />
<activity android:name=".ui.about.DonateActivity" />
<activity android:name=".ui.bookinfo.BookInfoActivity" />
<activity android:name=".ui.bookinfo.edit.BookInfoEditActivity" />
<activity android:name=".ui.sourcedebug.SourceDebugActivity" />
<activity android:name=".ui.booksource.BookSourceActivity" />
<activity android:name=".ui.book.info.BookInfoActivity" />
<activity android:name="io.legado.app.ui.book.info.edit.BookInfoEditActivity" />
<activity android:name=".ui.book.source.debug.SourceDebugActivity" />
<activity android:name=".ui.book.source.manage.BookSourceActivity" />
<activity android:name=".ui.chapterlist.ChapterListActivity" />
<activity android:name=".ui.readrss.ReadRssActivity" />
<activity android:name=".ui.rss.read.ReadRssActivity" />
<activity android:name=".ui.audio.AudioPlayActivity" />
<activity android:name=".ui.explore.ExploreShowActivity" />

@ -6,7 +6,7 @@ import android.content.Intent
import android.view.KeyEvent
import io.legado.app.constant.Bus
import io.legado.app.help.ActivityHelp
import io.legado.app.ui.readbook.ReadBookActivity
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.utils.postEvent

@ -20,7 +20,7 @@ import io.legado.app.constant.Status
import io.legado.app.help.IntentDataHelp
import io.legado.app.help.MediaHelp
import io.legado.app.receiver.MediaButtonReceiver
import io.legado.app.ui.readbook.ReadBookActivity
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.widget.page.TextChapter
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.postEvent

@ -1,4 +1,4 @@
package io.legado.app.ui.bookinfo
package io.legado.app.ui.book.info
import android.os.Bundle
import android.view.Menu
@ -12,10 +12,10 @@ import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookChapter
import io.legado.app.help.ImageLoader
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.bookinfo.edit.BookInfoEditActivity
import io.legado.app.ui.book.info.edit.BookInfoEditActivity
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.book.source.edit.SourceEditActivity
import io.legado.app.ui.changesource.ChangeSourceDialog
import io.legado.app.ui.readbook.ReadBookActivity
import io.legado.app.ui.sourceedit.SourceEditActivity
import io.legado.app.utils.getCompatDrawable
import io.legado.app.utils.getViewModel
import io.legado.app.utils.gone

@ -1,4 +1,4 @@
package io.legado.app.ui.bookinfo
package io.legado.app.ui.book.info
import android.app.Application
import android.content.Intent

@ -1,4 +1,4 @@
package io.legado.app.ui.bookinfo
package io.legado.app.ui.book.info
import android.content.Context
import io.legado.app.R

@ -1,4 +1,4 @@
package io.legado.app.ui.bookinfo.edit
package io.legado.app.ui.book.info.edit
import android.os.Bundle
import android.view.Menu

@ -1,4 +1,4 @@
package io.legado.app.ui.bookinfo.edit
package io.legado.app.ui.book.info.edit
import android.app.Application
import androidx.lifecycle.MutableLiveData

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook
package io.legado.app.ui.book.read
import android.app.Activity
import android.view.View

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook
package io.legado.app.ui.book.read
import android.app.Activity
import android.content.Intent
@ -27,13 +27,14 @@ import io.legado.app.lib.dialogs.noButton
import io.legado.app.lib.dialogs.okButton
import io.legado.app.receiver.TimeElectricityReceiver
import io.legado.app.service.BaseReadAloudService
import io.legado.app.ui.book.read.config.*
import io.legado.app.ui.book.read.config.BgTextConfigDialog.Companion.BG_COLOR
import io.legado.app.ui.book.read.config.BgTextConfigDialog.Companion.TEXT_COLOR
import io.legado.app.ui.book.source.edit.SourceEditActivity
import io.legado.app.ui.changesource.ChangeSourceDialog
import io.legado.app.ui.chapterlist.ChapterListActivity
import io.legado.app.ui.readbook.config.*
import io.legado.app.ui.readbook.config.BgTextConfigDialog.Companion.BG_COLOR
import io.legado.app.ui.readbook.config.BgTextConfigDialog.Companion.TEXT_COLOR
import io.legado.app.ui.replacerule.ReplaceRuleActivity
import io.legado.app.ui.sourceedit.SourceEditActivity
import io.legado.app.ui.widget.page.ChapterProvider
import io.legado.app.ui.widget.page.PageView
import io.legado.app.ui.widget.page.TextChapter

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook
package io.legado.app.ui.book.read
import android.app.Application
import android.content.Intent

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook
package io.legado.app.ui.book.read
import android.content.Context
import android.util.AttributeSet

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook.config
package io.legado.app.ui.book.read.config
import android.annotation.SuppressLint
import android.app.Activity.RESULT_OK
@ -24,7 +24,7 @@ import io.legado.app.help.ImageLoader
import io.legado.app.help.ReadBookConfig
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.ui.readbook.Help
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.FileUtils
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.postEvent

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook.config
package io.legado.app.ui.book.read.config
import android.content.SharedPreferences
import android.os.Bundle
@ -13,7 +13,7 @@ import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R
import io.legado.app.constant.Bus
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.readbook.Help
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.postEvent
class MoreConfigDialog : DialogFragment() {
@ -53,7 +53,8 @@ class MoreConfigDialog : DialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
var preferenceFragment = childFragmentManager.findFragmentByTag(readPreferTag)
if (preferenceFragment == null) preferenceFragment = ReadPreferenceFragment()
if (preferenceFragment == null) preferenceFragment =
ReadPreferenceFragment()
childFragmentManager.beginTransaction()
.replace(view.id, preferenceFragment, readPreferTag)
.commit()

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook.config
package io.legado.app.ui.book.read.config
import android.os.Bundle
import android.util.DisplayMetrics
@ -10,7 +10,7 @@ import androidx.fragment.app.DialogFragment
import io.legado.app.R
import io.legado.app.constant.Bus
import io.legado.app.help.ReadBookConfig
import io.legado.app.ui.readbook.Help
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.postEvent
import kotlinx.android.synthetic.main.dialog_read_padding.*
import org.jetbrains.anko.sdk27.listeners.onClick

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook.config
package io.legado.app.ui.book.read.config
import android.content.SharedPreferences
import android.os.Bundle
@ -16,7 +16,7 @@ import io.legado.app.constant.Bus
import io.legado.app.help.ReadAloud
import io.legado.app.lib.theme.ATH
import io.legado.app.service.BaseReadAloudService
import io.legado.app.ui.readbook.Help
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.getPrefString
import io.legado.app.utils.postEvent
@ -51,7 +51,8 @@ class ReadAloudConfigDialog : DialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
var preferenceFragment = childFragmentManager.findFragmentByTag(readAloudPreferTag)
if (preferenceFragment == null) preferenceFragment = ReadAloudPreferenceFragment()
if (preferenceFragment == null) preferenceFragment =
ReadAloudPreferenceFragment()
childFragmentManager.beginTransaction()
.replace(view.id, preferenceFragment, readAloudPreferTag)
.commit()

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook.config
package io.legado.app.ui.book.read.config
import android.os.Bundle
import android.util.DisplayMetrics
@ -13,7 +13,7 @@ import io.legado.app.constant.Bus
import io.legado.app.constant.Status
import io.legado.app.help.ReadAloud
import io.legado.app.service.BaseReadAloudService
import io.legado.app.ui.readbook.Help
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.*
import kotlinx.android.synthetic.main.dialog_read_aloud.*
import org.jetbrains.anko.sdk27.listeners.onClick

@ -1,4 +1,4 @@
package io.legado.app.ui.readbook.config
package io.legado.app.ui.book.read.config
import android.os.Bundle
import android.util.DisplayMetrics
@ -16,8 +16,8 @@ import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.theme.accentColor
import io.legado.app.lib.theme.primaryColor
import io.legado.app.ui.readbook.Help
import io.legado.app.ui.readbook.ReadBookActivity
import io.legado.app.ui.book.read.Help
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.widget.font.FontSelectDialog
import io.legado.app.utils.*
import kotlinx.android.synthetic.main.activity_read_book.*

@ -1,4 +1,4 @@
package io.legado.app.ui.search
package io.legado.app.ui.book.search
import androidx.recyclerview.widget.DiffUtil
import io.legado.app.data.entities.SearchShow

@ -1,4 +1,4 @@
package io.legado.app.ui.search
package io.legado.app.ui.book.search
import android.os.Bundle
import androidx.appcompat.widget.SearchView
@ -13,7 +13,7 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.SearchShow
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.primaryTextColor
import io.legado.app.ui.bookinfo.BookInfoActivity
import io.legado.app.ui.book.info.BookInfoActivity
import io.legado.app.utils.getViewModel
import io.legado.app.utils.invisible
import io.legado.app.utils.visible

@ -1,4 +1,4 @@
package io.legado.app.ui.search
package io.legado.app.ui.book.search
import android.view.LayoutInflater
import android.view.View

@ -1,4 +1,4 @@
package io.legado.app.ui.search
package io.legado.app.ui.book.search
import android.app.Application
import io.legado.app.App

@ -1,10 +1,9 @@
package io.legado.app.ui.sourcedebug
package io.legado.app.ui.book.source.debug
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.SearchView
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
@ -15,7 +14,6 @@ import io.legado.app.ui.qrcode.QrCodeActivity
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_source_debug.*
import kotlinx.android.synthetic.main.view_search.*
import kotlinx.android.synthetic.main.view_title_bar.*
import kotlinx.coroutines.launch
import org.jetbrains.anko.startActivityForResult
import org.jetbrains.anko.toast

@ -1,4 +1,4 @@
package io.legado.app.ui.sourcedebug
package io.legado.app.ui.book.source.debug
import android.content.Context
import io.legado.app.R

@ -1,4 +1,4 @@
package io.legado.app.ui.sourcedebug
package io.legado.app.ui.book.source.debug
import android.app.Application
import io.legado.app.App

@ -1,4 +1,4 @@
package io.legado.app.ui.sourceedit
package io.legado.app.ui.book.source.edit
import android.app.Activity
import android.content.ClipData
@ -20,7 +20,7 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.BookSource
import io.legado.app.data.entities.rule.*
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.sourcedebug.SourceDebugActivity
import io.legado.app.ui.book.source.debug.SourceDebugActivity
import io.legado.app.ui.widget.KeyboardToolPop
import io.legado.app.utils.GSON
import io.legado.app.utils.getViewModel
@ -147,67 +147,243 @@ class SourceEditActivity :
with(bookSource) {
sourceEntities.clear()
sourceEntities
.add(EditEntity("bookSourceUrl", this?.bookSourceUrl, R.string.book_source_url))
.add(
EditEntity(
"bookSourceUrl",
this?.bookSourceUrl,
R.string.book_source_url
)
)
sourceEntities
.add(EditEntity("bookSourceName", this?.bookSourceName, R.string.book_source_name))
.add(
EditEntity(
"bookSourceName",
this?.bookSourceName,
R.string.book_source_name
)
)
sourceEntities.add(
EditEntity("bookSourceGroup", this?.bookSourceGroup, R.string.book_source_group)
EditEntity(
"bookSourceGroup",
this?.bookSourceGroup,
R.string.book_source_group
)
)
sourceEntities
.add(EditEntity("loginUrl", this?.loginUrl, R.string.book_source_login_url))
.add(
EditEntity(
"loginUrl",
this?.loginUrl,
R.string.book_source_login_url
)
)
sourceEntities
.add(EditEntity("bookUrlPattern", this?.bookUrlPattern, R.string.book_url_pattern))
sourceEntities.add(EditEntity("header", this?.header, R.string.source_http_header))
.add(
EditEntity(
"bookUrlPattern",
this?.bookUrlPattern,
R.string.book_url_pattern
)
)
sourceEntities.add(
EditEntity(
"header",
this?.header,
R.string.source_http_header
)
)
}
//搜索
with(bookSource?.getSearchRule()) {
searchEntities.clear()
searchEntities
.add(EditEntity("searchUrl", bookSource?.searchUrl, R.string.rule_search_url))
searchEntities.add(EditEntity("bookList", this?.bookList, R.string.rule_book_list))
searchEntities.add(EditEntity("name", this?.name, R.string.rule_book_name))
searchEntities.add(EditEntity("author", this?.author, R.string.rule_book_author))
searchEntities.add(EditEntity("kind", this?.kind, R.string.rule_book_kind))
searchEntities.add(EditEntity("wordCount", this?.wordCount, R.string.rule_word_count))
.add(
EditEntity(
"searchUrl",
bookSource?.searchUrl,
R.string.rule_search_url
)
)
searchEntities.add(
EditEntity(
"bookList",
this?.bookList,
R.string.rule_book_list
)
)
searchEntities.add(
EditEntity(
"name",
this?.name,
R.string.rule_book_name
)
)
searchEntities.add(
EditEntity(
"author",
this?.author,
R.string.rule_book_author
)
)
searchEntities.add(
EditEntity(
"kind",
this?.kind,
R.string.rule_book_kind
)
)
searchEntities.add(
EditEntity(
"wordCount",
this?.wordCount,
R.string.rule_word_count
)
)
searchEntities
.add(EditEntity("lastChapter", this?.lastChapter, R.string.rule_last_chapter))
searchEntities.add(EditEntity("intro", this?.intro, R.string.rule_book_intro))
searchEntities.add(EditEntity("coverUrl", this?.coverUrl, R.string.rule_cover_url))
searchEntities.add(EditEntity("bookUrl", this?.bookUrl, R.string.rule_book_url))
.add(
EditEntity(
"lastChapter",
this?.lastChapter,
R.string.rule_last_chapter
)
)
searchEntities.add(
EditEntity(
"intro",
this?.intro,
R.string.rule_book_intro
)
)
searchEntities.add(
EditEntity(
"coverUrl",
this?.coverUrl,
R.string.rule_cover_url
)
)
searchEntities.add(
EditEntity(
"bookUrl",
this?.bookUrl,
R.string.rule_book_url
)
)
}
//详情页
with(bookSource?.getBookInfoRule()) {
infoEntities.clear()
infoEntities.add(EditEntity("init", this?.init, R.string.rule_book_info_init))
infoEntities.add(EditEntity("name", this?.name, R.string.rule_book_name))
infoEntities.add(EditEntity("author", this?.author, R.string.rule_book_author))
infoEntities.add(EditEntity("coverUrl", this?.coverUrl, R.string.rule_cover_url))
infoEntities.add(EditEntity("intro", this?.intro, R.string.rule_book_intro))
infoEntities.add(EditEntity("kind", this?.kind, R.string.rule_book_kind))
infoEntities.add(EditEntity("wordCount", this?.wordCount, R.string.rule_word_count))
infoEntities.add(
EditEntity("lastChapter", this?.lastChapter, R.string.rule_last_chapter)
EditEntity(
"init",
this?.init,
R.string.rule_book_info_init
)
)
infoEntities.add(
EditEntity(
"name",
this?.name,
R.string.rule_book_name
)
)
infoEntities.add(
EditEntity(
"author",
this?.author,
R.string.rule_book_author
)
)
infoEntities.add(
EditEntity(
"coverUrl",
this?.coverUrl,
R.string.rule_cover_url
)
)
infoEntities.add(
EditEntity(
"intro",
this?.intro,
R.string.rule_book_intro
)
)
infoEntities.add(
EditEntity(
"kind",
this?.kind,
R.string.rule_book_kind
)
)
infoEntities.add(
EditEntity(
"wordCount",
this?.wordCount,
R.string.rule_word_count
)
)
infoEntities.add(
EditEntity(
"lastChapter",
this?.lastChapter,
R.string.rule_last_chapter
)
)
infoEntities.add(
EditEntity(
"tocUrl",
this?.tocUrl,
R.string.rule_toc_url
)
)
infoEntities.add(EditEntity("tocUrl", this?.tocUrl, R.string.rule_toc_url))
}
//目录页
with(bookSource?.getTocRule()) {
tocEntities.clear()
tocEntities.add(
EditEntity("chapterList", this?.chapterList, R.string.rule_chapter_list)
EditEntity(
"chapterList",
this?.chapterList,
R.string.rule_chapter_list
)
)
tocEntities.add(
EditEntity(
"chapterName",
this?.chapterName,
R.string.rule_chapter_name
)
)
tocEntities.add(
EditEntity("chapterName", this?.chapterName, R.string.rule_chapter_name)
EditEntity(
"chapterUrl",
this?.chapterUrl,
R.string.rule_chapter_url
)
)
tocEntities.add(
EditEntity(
"nextTocUrl",
this?.nextTocUrl,
R.string.rule_next_toc_url
)
)
tocEntities.add(EditEntity("chapterUrl", this?.chapterUrl, R.string.rule_chapter_url))
tocEntities.add(EditEntity("nextTocUrl", this?.nextTocUrl, R.string.rule_next_toc_url))
}
//正文页
with(bookSource?.getContentRule()) {
contentEntities.clear()
contentEntities.add(EditEntity("content", this?.content, R.string.rule_book_content))
contentEntities.add(
EditEntity("nextContentUrl", this?.nextContentUrl, R.string.rule_content_url_next)
EditEntity(
"content",
this?.content,
R.string.rule_book_content
)
)
contentEntities.add(
EditEntity(
"nextContentUrl",
this?.nextContentUrl,
R.string.rule_content_url_next
)
)
}
@ -215,19 +391,75 @@ class SourceEditActivity :
with(bookSource?.getExploreRule()) {
findEntities.clear()
findEntities.add(
EditEntity("exploreUrl", bookSource?.exploreUrl, R.string.rule_find_url)
)
findEntities.add(EditEntity("bookList", this?.bookList, R.string.rule_book_list))
findEntities.add(EditEntity("name", this?.name, R.string.rule_book_name))
findEntities.add(EditEntity("author", this?.author, R.string.rule_book_author))
findEntities.add(EditEntity("kind", this?.kind, R.string.rule_book_kind))
findEntities.add(EditEntity("wordCount", this?.wordCount, R.string.rule_word_count))
findEntities.add(EditEntity("intro", this?.intro, R.string.rule_book_intro))
EditEntity(
"exploreUrl",
bookSource?.exploreUrl,
R.string.rule_find_url
)
)
findEntities.add(
EditEntity(
"bookList",
this?.bookList,
R.string.rule_book_list
)
)
findEntities.add(
EditEntity(
"name",
this?.name,
R.string.rule_book_name
)
)
findEntities.add(
EditEntity(
"author",
this?.author,
R.string.rule_book_author
)
)
findEntities.add(
EditEntity(
"kind",
this?.kind,
R.string.rule_book_kind
)
)
findEntities.add(
EditEntity(
"wordCount",
this?.wordCount,
R.string.rule_word_count
)
)
findEntities.add(
EditEntity(
"intro",
this?.intro,
R.string.rule_book_intro
)
)
findEntities.add(
EditEntity(
"lastChapter",
this?.lastChapter,
R.string.rule_last_chapter
)
)
findEntities.add(
EditEntity(
"coverUrl",
this?.coverUrl,
R.string.rule_cover_url
)
)
findEntities.add(
EditEntity("lastChapter", this?.lastChapter, R.string.rule_last_chapter)
EditEntity(
"bookUrl",
this?.bookUrl,
R.string.rule_book_url
)
)
findEntities.add(EditEntity("coverUrl", this?.coverUrl, R.string.rule_cover_url))
findEntities.add(EditEntity("bookUrl", this?.bookUrl, R.string.rule_book_url))
}
setEditEntities(0)
}

@ -1,4 +1,4 @@
package io.legado.app.ui.sourceedit
package io.legado.app.ui.book.source.edit
import android.text.Editable
import android.text.TextWatcher
@ -18,7 +18,11 @@ class SourceEditAdapter : RecyclerView.Adapter<SourceEditAdapter.MyViewHolder>()
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
return MyViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_source_edit, parent, false))
return MyViewHolder(
LayoutInflater.from(
parent.context
).inflate(R.layout.item_source_edit, parent, false)
)
}
override fun onBindViewHolder(holder: MyViewHolder, position: Int) {

@ -1,4 +1,4 @@
package io.legado.app.ui.sourceedit
package io.legado.app.ui.book.source.edit
import android.app.Application
import android.content.ClipboardManager

@ -1,4 +1,4 @@
package io.legado.app.ui.booksource
package io.legado.app.ui.book.source.manage
import android.content.Intent
import android.os.Bundle
@ -21,8 +21,8 @@ import io.legado.app.help.ItemTouchCallback
import io.legado.app.help.storage.Restore
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.primaryTextColor
import io.legado.app.ui.book.source.edit.SourceEditActivity
import io.legado.app.ui.qrcode.QrCodeActivity
import io.legado.app.ui.sourceedit.SourceEditActivity
import io.legado.app.utils.getViewModel
import io.legado.app.utils.splitNotBlank
import kotlinx.android.synthetic.main.activity_book_source.*
@ -121,7 +121,12 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
}
bookSourceLiveDate?.observe(this, Observer {
search_view.queryHint = getString(R.string.search_book_source_num, it.size)
val diffResult = DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), it))
val diffResult = DiffUtil.calculateDiff(
DiffCallBack(
adapter.getItems(),
it
)
)
adapter.setItemsNoNotify(it)
diffResult.dispatchUpdatesTo(adapter)
})

@ -1,4 +1,4 @@
package io.legado.app.ui.booksource
package io.legado.app.ui.book.source.manage
import android.content.Context
import android.view.Menu

@ -1,4 +1,4 @@
package io.legado.app.ui.booksource
package io.legado.app.ui.book.source.manage
import android.app.Application
import android.text.TextUtils

@ -1,4 +1,4 @@
package io.legado.app.ui.booksource
package io.legado.app.ui.book.source.manage
import androidx.recyclerview.widget.DiffUtil
import io.legado.app.data.entities.BookSource

@ -1,4 +1,4 @@
package io.legado.app.ui.booksource
package io.legado.app.ui.book.source.manage
import android.annotation.SuppressLint
import android.content.Context

@ -8,7 +8,7 @@ import androidx.recyclerview.widget.RecyclerView
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.SearchBook
import io.legado.app.ui.bookinfo.BookInfoActivity
import io.legado.app.ui.book.info.BookInfoActivity
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_explore_show.*
import org.jetbrains.anko.startActivity

@ -22,10 +22,10 @@ import io.legado.app.data.entities.BookGroup
import io.legado.app.lib.dialogs.*
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.bookinfo.BookInfoActivity
import io.legado.app.ui.book.info.BookInfoActivity
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.book.search.SearchActivity
import io.legado.app.ui.bookshelf.BookshelfActivity
import io.legado.app.ui.readbook.ReadBookActivity
import io.legado.app.ui.search.SearchActivity
import io.legado.app.utils.*
import kotlinx.android.synthetic.main.dialog_edittext.view.*
import kotlinx.android.synthetic.main.fragment_bookshelf.*

@ -10,8 +10,8 @@ import io.legado.app.R
import io.legado.app.base.VMBaseFragment
import io.legado.app.data.entities.BookSource
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.book.source.edit.SourceEditActivity
import io.legado.app.ui.explore.ExploreShowActivity
import io.legado.app.ui.sourceedit.SourceEditActivity
import io.legado.app.utils.getViewModel
import io.legado.app.utils.startActivity
import kotlinx.android.synthetic.main.fragment_find_book.*

@ -13,7 +13,7 @@ import io.legado.app.base.BaseFragment
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.about.AboutActivity
import io.legado.app.ui.about.DonateActivity
import io.legado.app.ui.booksource.BookSourceActivity
import io.legado.app.ui.book.source.manage.BookSourceActivity
import io.legado.app.ui.config.ConfigActivity
import io.legado.app.ui.config.ConfigViewModel
import io.legado.app.ui.replacerule.ReplaceRuleActivity

@ -0,0 +1,3 @@
package io.legado.app.ui.rss.article
class RssArticlesActivity

@ -1,4 +1,4 @@
package io.legado.app.ui.readrss
package io.legado.app.ui.rss.read
import android.os.Bundle
import io.legado.app.R

@ -4,7 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.legado.app.ui.search.SearchActivity">
tools:context=".ui.book.search.SearchActivity">
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"

@ -16,7 +16,7 @@
android:layout_height="match_parent" />
<io.legado.app.ui.readbook.ReadMenu
<io.legado.app.ui.book.read.ReadMenu
android:id="@+id/read_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -5,7 +5,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.legado.app.ui.search.SearchActivity">
tools:context=".ui.book.search.SearchActivity">
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"

@ -13,7 +13,7 @@
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="${applicationId}"
android:targetClass="io.legado.app.ui.readbook.ReadBookActivity" />
android:targetClass="io.legado.app.ui.book.read.ReadBookActivity" />
<categories android:name="android.shortcut.conversation" />
</shortcut>

Loading…
Cancel
Save