|
|
@ -146,322 +146,92 @@ class SourceEditActivity : |
|
|
|
cb_is_enable_find.isChecked = it.enabledExplore |
|
|
|
cb_is_enable_find.isChecked = it.enabledExplore |
|
|
|
} |
|
|
|
} |
|
|
|
//基本信息 |
|
|
|
//基本信息 |
|
|
|
with(bookSource) { |
|
|
|
sourceEntities.clear() |
|
|
|
sourceEntities.clear() |
|
|
|
searchEntities.apply { |
|
|
|
sourceEntities |
|
|
|
add(EditEntity("bookSourceUrl", bookSource?.bookSourceUrl, R.string.book_source_url)) |
|
|
|
.add( |
|
|
|
add(EditEntity("bookSourceName", bookSource?.bookSourceName, R.string.book_source_name)) |
|
|
|
EditEntity( |
|
|
|
add( |
|
|
|
"bookSourceUrl", |
|
|
|
|
|
|
|
this?.bookSourceUrl, |
|
|
|
|
|
|
|
R.string.book_source_url |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
sourceEntities |
|
|
|
|
|
|
|
.add( |
|
|
|
|
|
|
|
EditEntity( |
|
|
|
|
|
|
|
"bookSourceName", |
|
|
|
|
|
|
|
this?.bookSourceName, |
|
|
|
|
|
|
|
R.string.book_source_name |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
sourceEntities.add( |
|
|
|
|
|
|
|
EditEntity( |
|
|
|
EditEntity( |
|
|
|
"bookSourceGroup", |
|
|
|
"bookSourceGroup", |
|
|
|
this?.bookSourceGroup, |
|
|
|
bookSource?.bookSourceGroup, |
|
|
|
R.string.book_source_group |
|
|
|
R.string.book_source_group |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
sourceEntities |
|
|
|
add(EditEntity("loginUrl", bookSource?.loginUrl, R.string.book_source_login_url)) |
|
|
|
.add( |
|
|
|
add(EditEntity("bookUrlPattern", bookSource?.bookUrlPattern, R.string.book_url_pattern)) |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("header", bookSource?.header, R.string.source_http_header)) |
|
|
|
"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 |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//搜索 |
|
|
|
//搜索 |
|
|
|
with(bookSource?.getSearchRule()) { |
|
|
|
(bookSource?.getSearchRule()).let { searchRule -> |
|
|
|
searchEntities.clear() |
|
|
|
searchEntities.clear() |
|
|
|
searchEntities |
|
|
|
searchEntities.apply { |
|
|
|
.add( |
|
|
|
add(EditEntity("searchUrl", bookSource?.searchUrl, R.string.rule_search_url)) |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("bookList", searchRule?.bookList, R.string.rule_book_list)) |
|
|
|
"searchUrl", |
|
|
|
add(EditEntity("name", searchRule?.name, R.string.rule_book_name)) |
|
|
|
bookSource?.searchUrl, |
|
|
|
add(EditEntity("author", searchRule?.author, R.string.rule_book_author)) |
|
|
|
R.string.rule_search_url |
|
|
|
add(EditEntity("kind", searchRule?.kind, R.string.rule_book_kind)) |
|
|
|
) |
|
|
|
add(EditEntity("wordCount", searchRule?.wordCount, R.string.rule_word_count)) |
|
|
|
) |
|
|
|
add(EditEntity("lastChapter", searchRule?.lastChapter, R.string.rule_last_chapter)) |
|
|
|
searchEntities.add( |
|
|
|
add(EditEntity("intro", searchRule?.intro, R.string.rule_book_intro)) |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("coverUrl", searchRule?.coverUrl, R.string.rule_cover_url)) |
|
|
|
"bookList", |
|
|
|
add(EditEntity("bookUrl", searchRule?.bookUrl, R.string.rule_book_url)) |
|
|
|
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 |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//详情页 |
|
|
|
//详情页 |
|
|
|
with(bookSource?.getBookInfoRule()) { |
|
|
|
(bookSource?.getBookInfoRule()).let { infoRule -> |
|
|
|
infoEntities.clear() |
|
|
|
infoEntities.clear() |
|
|
|
infoEntities.add( |
|
|
|
infoEntities.apply { |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("init", infoRule?.init, R.string.rule_book_info_init)) |
|
|
|
"init", |
|
|
|
add(EditEntity("name", infoRule?.name, R.string.rule_book_name)) |
|
|
|
this?.init, |
|
|
|
add(EditEntity("author", infoRule?.author, R.string.rule_book_author)) |
|
|
|
R.string.rule_book_info_init |
|
|
|
add(EditEntity("coverUrl", infoRule?.coverUrl, R.string.rule_cover_url)) |
|
|
|
) |
|
|
|
add(EditEntity("intro", infoRule?.intro, R.string.rule_book_intro)) |
|
|
|
) |
|
|
|
add(EditEntity("kind", infoRule?.kind, R.string.rule_book_kind)) |
|
|
|
infoEntities.add( |
|
|
|
add(EditEntity("wordCount", infoRule?.wordCount, R.string.rule_word_count)) |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("lastChapter", infoRule?.lastChapter, R.string.rule_last_chapter)) |
|
|
|
"name", |
|
|
|
add(EditEntity("tocUrl", infoRule?.tocUrl, R.string.rule_toc_url)) |
|
|
|
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 |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//目录页 |
|
|
|
//目录页 |
|
|
|
with(bookSource?.getTocRule()) { |
|
|
|
(bookSource?.getTocRule()).let { tocRule -> |
|
|
|
tocEntities.clear() |
|
|
|
tocEntities.clear() |
|
|
|
tocEntities.add( |
|
|
|
tocEntities.apply { |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("chapterList", tocRule?.chapterList, R.string.rule_chapter_list)) |
|
|
|
"chapterList", |
|
|
|
add(EditEntity("chapterName", tocRule?.chapterName, R.string.rule_chapter_name)) |
|
|
|
this?.chapterList, |
|
|
|
add(EditEntity("chapterUrl", tocRule?.chapterUrl, R.string.rule_chapter_url)) |
|
|
|
R.string.rule_chapter_list |
|
|
|
add(EditEntity("nextTocUrl", tocRule?.nextTocUrl, R.string.rule_next_toc_url)) |
|
|
|
) |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
tocEntities.add( |
|
|
|
|
|
|
|
EditEntity( |
|
|
|
|
|
|
|
"chapterName", |
|
|
|
|
|
|
|
this?.chapterName, |
|
|
|
|
|
|
|
R.string.rule_chapter_name |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
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()) { |
|
|
|
(bookSource?.getContentRule()).let { contentRule -> |
|
|
|
contentEntities.clear() |
|
|
|
contentEntities.clear() |
|
|
|
contentEntities.add( |
|
|
|
contentEntities.apply { |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("content", contentRule?.content, R.string.rule_book_content)) |
|
|
|
"content", |
|
|
|
add( |
|
|
|
this?.content, |
|
|
|
EditEntity( |
|
|
|
R.string.rule_book_content |
|
|
|
"nextContentUrl", |
|
|
|
) |
|
|
|
contentRule?.nextContentUrl, |
|
|
|
) |
|
|
|
R.string.rule_content_url_next |
|
|
|
contentEntities.add( |
|
|
|
) |
|
|
|
EditEntity( |
|
|
|
|
|
|
|
"nextContentUrl", |
|
|
|
|
|
|
|
this?.nextContentUrl, |
|
|
|
|
|
|
|
R.string.rule_content_url_next |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//发现 |
|
|
|
//发现 |
|
|
|
with(bookSource?.getExploreRule()) { |
|
|
|
(bookSource?.getExploreRule()).let { exploreRule -> |
|
|
|
findEntities.clear() |
|
|
|
findEntities.clear() |
|
|
|
findEntities.add( |
|
|
|
findEntities.apply { |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("exploreUrl", bookSource?.exploreUrl, R.string.rule_find_url)) |
|
|
|
"exploreUrl", |
|
|
|
add(EditEntity("bookList", exploreRule?.bookList, R.string.rule_book_list)) |
|
|
|
bookSource?.exploreUrl, |
|
|
|
add(EditEntity("name", exploreRule?.name, R.string.rule_book_name)) |
|
|
|
R.string.rule_find_url |
|
|
|
add(EditEntity("author", exploreRule?.author, R.string.rule_book_author)) |
|
|
|
) |
|
|
|
add(EditEntity("kind", exploreRule?.kind, R.string.rule_book_kind)) |
|
|
|
) |
|
|
|
add(EditEntity("wordCount", exploreRule?.wordCount, R.string.rule_word_count)) |
|
|
|
findEntities.add( |
|
|
|
add(EditEntity("intro", exploreRule?.intro, R.string.rule_book_intro)) |
|
|
|
EditEntity( |
|
|
|
add(EditEntity("lastChapter", exploreRule?.lastChapter, R.string.rule_last_chapter)) |
|
|
|
"bookList", |
|
|
|
add(EditEntity("coverUrl", exploreRule?.coverUrl, R.string.rule_cover_url)) |
|
|
|
this?.bookList, |
|
|
|
add(EditEntity("bookUrl", exploreRule?.bookUrl, R.string.rule_book_url)) |
|
|
|
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( |
|
|
|
|
|
|
|
"bookUrl", |
|
|
|
|
|
|
|
this?.bookUrl, |
|
|
|
|
|
|
|
R.string.rule_book_url |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
setEditEntities(0) |
|
|
|
setEditEntities(0) |
|
|
|
} |
|
|
|
} |
|
|
|