pull/48/head
kunfei 5 years ago
parent 95f6077089
commit 6b621a8a49
  1. 32
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  2. 38
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt
  3. 52
      app/src/main/res/values/strings.xml

@ -151,10 +151,10 @@ class BookSourceEditActivity :
//基本信息
sourceEntities.clear()
sourceEntities.apply {
add(EditEntity("bookSourceUrl", source?.bookSourceUrl, R.string.book_source_url))
add(EditEntity("bookSourceName", source?.bookSourceName, R.string.book_source_name))
add(EditEntity("bookSourceGroup", source?.bookSourceGroup, R.string.book_source_group))
add(EditEntity("loginUrl", source?.loginUrl, R.string.book_source_login_url))
add(EditEntity("bookSourceUrl", source?.bookSourceUrl, R.string.source_url))
add(EditEntity("bookSourceName", source?.bookSourceName, R.string.source_name))
add(EditEntity("bookSourceGroup", source?.bookSourceGroup, R.string.source_group))
add(EditEntity("loginUrl", source?.loginUrl, R.string.login_url))
add(EditEntity("bookUrlPattern", source?.bookUrlPattern, R.string.book_url_pattern))
add(EditEntity("header", source?.header, R.string.source_http_header))
}
@ -162,24 +162,24 @@ class BookSourceEditActivity :
val sr = source?.getSearchRule()
searchEntities.clear()
searchEntities.apply {
add(EditEntity("searchUrl", source?.searchUrl, R.string.rule_search_url))
add(EditEntity("bookList", sr?.bookList, R.string.rule_book_list))
add(EditEntity("name", sr?.name, R.string.rule_book_name))
add(EditEntity("author", sr?.author, R.string.rule_book_author))
add(EditEntity("searchUrl", source?.searchUrl, R.string.r_search_url))
add(EditEntity("bookList", sr?.bookList, R.string.r_book_list))
add(EditEntity("name", sr?.name, R.string.r_book_name))
add(EditEntity("author", sr?.author, R.string.r_author))
add(EditEntity("kind", sr?.kind, R.string.rule_book_kind))
add(EditEntity("wordCount", sr?.wordCount, R.string.rule_word_count))
add(EditEntity("lastChapter", sr?.lastChapter, R.string.rule_last_chapter))
add(EditEntity("intro", sr?.intro, R.string.rule_book_intro))
add(EditEntity("coverUrl", sr?.coverUrl, R.string.rule_cover_url))
add(EditEntity("bookUrl", sr?.bookUrl, R.string.rule_book_url))
add(EditEntity("bookUrl", sr?.bookUrl, R.string.r_book_url))
}
//详情页
val ir = source?.getBookInfoRule()
infoEntities.clear()
infoEntities.apply {
add(EditEntity("init", ir?.init, R.string.rule_book_info_init))
add(EditEntity("name", ir?.name, R.string.rule_book_name))
add(EditEntity("author", ir?.author, R.string.rule_book_author))
add(EditEntity("name", ir?.name, R.string.r_book_name))
add(EditEntity("author", ir?.author, R.string.r_author))
add(EditEntity("kind", ir?.kind, R.string.rule_book_kind))
add(EditEntity("wordCount", ir?.wordCount, R.string.rule_word_count))
add(EditEntity("lastChapter", ir?.lastChapter, R.string.rule_last_chapter))
@ -211,16 +211,16 @@ class BookSourceEditActivity :
val er = source?.getExploreRule()
findEntities.clear()
findEntities.apply {
add(EditEntity("exploreUrl", source?.exploreUrl, R.string.rule_find_url))
add(EditEntity("bookList", er?.bookList, R.string.rule_book_list))
add(EditEntity("name", er?.name, R.string.rule_book_name))
add(EditEntity("author", er?.author, R.string.rule_book_author))
add(EditEntity("exploreUrl", source?.exploreUrl, R.string.r_find_url))
add(EditEntity("bookList", er?.bookList, R.string.r_book_list))
add(EditEntity("name", er?.name, R.string.r_book_name))
add(EditEntity("author", er?.author, R.string.r_author))
add(EditEntity("kind", er?.kind, R.string.rule_book_kind))
add(EditEntity("wordCount", er?.wordCount, R.string.rule_word_count))
add(EditEntity("lastChapter", er?.lastChapter, R.string.rule_last_chapter))
add(EditEntity("intro", er?.intro, R.string.rule_book_intro))
add(EditEntity("coverUrl", er?.coverUrl, R.string.rule_cover_url))
add(EditEntity("bookUrl", er?.bookUrl, R.string.rule_book_url))
add(EditEntity("bookUrl", er?.bookUrl, R.string.r_book_url))
}
setEditEntities(0)
}

@ -123,31 +123,19 @@ class RssSourceEditActivity :
}
sourceEntities.clear()
sourceEntities.apply {
add(EditEntity("sourceName", rssSource?.sourceName, R.string.rss_source_name))
add(EditEntity("sourceUrl", rssSource?.sourceUrl, R.string.rss_source_url))
add(EditEntity("sourceIcon", rssSource?.sourceIcon, R.string.rss_source_icon))
add(EditEntity("sourceGroup", rssSource?.sourceGroup, R.string.rss_source_group))
add(EditEntity("ruleArticles", rssSource?.ruleArticles, R.string.rss_rule_articles))
add(EditEntity("ruleNextPage", rssSource?.ruleNextPage, R.string.rss_rule_next))
add(EditEntity("ruleTitle", rssSource?.ruleTitle, R.string.rss_rule_title))
add(EditEntity("rulePubDate", rssSource?.rulePubDate, R.string.rss_rule_date))
add(
EditEntity(
"ruleCategories",
rssSource?.ruleCategories,
R.string.rss_rule_categories
)
)
add(
EditEntity(
"ruleDescription",
rssSource?.ruleDescription,
R.string.rss_rule_description
)
)
add(EditEntity("ruleImage", rssSource?.ruleImage, R.string.rss_rule_image))
add(EditEntity("ruleLink", rssSource?.ruleLink, R.string.rss_rule_link))
add(EditEntity("ruleContent", rssSource?.ruleContent, R.string.rss_rule_content))
add(EditEntity("sourceName", rssSource?.sourceName, R.string.source_name))
add(EditEntity("sourceUrl", rssSource?.sourceUrl, R.string.source_url))
add(EditEntity("sourceIcon", rssSource?.sourceIcon, R.string.source_icon))
add(EditEntity("sourceGroup", rssSource?.sourceGroup, R.string.source_group))
add(EditEntity("ruleArticles", rssSource?.ruleArticles, R.string.r_articles))
add(EditEntity("ruleNextPage", rssSource?.ruleNextPage, R.string.r_next))
add(EditEntity("ruleTitle", rssSource?.ruleTitle, R.string.r_title))
add(EditEntity("rulePubDate", rssSource?.rulePubDate, R.string.r_date))
add(EditEntity("ruleCategories", rssSource?.ruleCategories, R.string.r_categories))
add(EditEntity("ruleDescription", rssSource?.ruleDescription, R.string.r_description))
add(EditEntity("ruleImage", rssSource?.ruleImage, R.string.r_image))
add(EditEntity("ruleLink", rssSource?.ruleLink, R.string.r_link))
add(EditEntity("ruleContent", rssSource?.ruleContent, R.string.r_content))
}
adapter.editEntities = sourceEntities
}

@ -359,17 +359,17 @@
<string name="success">成功</string>
<string name="source_no_login">当前源没有配置登陆地址</string>
<!-- book source start-->
<string name="book_source_name">书源名称(bookSourceName)</string>
<string name="book_source_url">书源URL(bookSourceUrl)</string>
<string name="book_source_group">书源分组(bookSourceGroup)</string>
<string name="book_source_login_url">登录URL(loginUrl)</string>
<string name="rule_search_url">搜索地址(url)</string>
<string name="rule_find_url">发现地址规则(url)</string>
<string name="rule_book_list">书籍列表规则(bookList)</string>
<string name="rule_book_name">书名规则(name)</string>
<string name="rule_book_url">详情页url规则(bookUrl)</string>
<string name="rule_book_author">作者规则(author)</string>
<!-- source start-->
<string name="source_name">书源名称(bookSourceName)</string>
<string name="source_url">书源URL(bookSourceUrl)</string>
<string name="source_group">书源分组(bookSourceGroup)</string>
<string name="login_url">登录URL(loginUrl)</string>
<string name="r_search_url">搜索地址(url)</string>
<string name="r_find_url">发现地址规则(url)</string>
<string name="r_book_list">书籍列表规则(bookList)</string>
<string name="r_book_name">书名规则(name)</string>
<string name="r_book_url">详情页url规则(bookUrl)</string>
<string name="r_author">作者规则(author)</string>
<string name="rule_book_kind">分类规则(kind)</string>
<string name="rule_book_intro">简介规则(intro)</string>
<string name="rule_cover_url">封面规则(coverUrl)</string>
@ -388,25 +388,19 @@
<string name="rule_next_content">正文下一页URL规则(nextContentUrl)</string>
<string name="rule_web_js">webJs</string>
<string name="rule_source_regex">资源正则(sourceRegex)</string>
<!--book source end-->
<!-- rss source start-->
<string name="rss_source_name">名称(sourceName)</string>
<string name="rss_source_url">url(sourceUrl)</string>
<string name="rss_source_icon">图标(sourceIcon)</string>
<string name="rss_source_group">分组(sourceGroup)</string>
<string name="rss_rule_articles">列表规则(ruleArticles)</string>
<string name="rss_rule_next">列表下一页规则(ruleArticles)</string>
<string name="rss_rule_title">标题规则(ruleTitle)</string>
<string name="rss_rule_author">作者规则(ruleAuthor)</string>
<string name="rss_rule_guid">guid规则(ruleGuid)</string>
<string name="rss_rule_date">时间规则(rulePubDate)</string>
<string name="rss_rule_categories">类别规则(ruleCategories)</string>
<string name="rss_rule_description">描述规则(ruleDescription)</string>
<string name="rss_rule_image">图片url规则(ruleImage)</string>
<string name="rss_rule_content">内容规则(ruleContent)</string>
<string name="rss_rule_link">链接规则(ruleLink)</string>
<!-- rss source end-->
<string name="source_icon">图标(sourceIcon)</string>
<string name="r_articles">列表规则(ruleArticles)</string>
<string name="r_next">列表下一页规则(ruleArticles)</string>
<string name="r_title">标题规则(ruleTitle)</string>
<string name="r_guid">guid规则(ruleGuid)</string>
<string name="r_date">时间规则(rulePubDate)</string>
<string name="r_categories">类别规则(ruleCategories)</string>
<string name="r_description">描述规则(ruleDescription)</string>
<string name="r_image">图片url规则(ruleImage)</string>
<string name="r_content">内容规则(ruleContent)</string>
<string name="r_link">链接规则(ruleLink)</string>
<!-- source end-->
<!--error string start-->
<string name="error_no_source">没有书源</string>

Loading…
Cancel
Save