|
|
@ -110,19 +110,11 @@ object ChapterProvider { |
|
|
|
isTitle, textPaint, srcList |
|
|
|
isTitle, textPaint, srcList |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (book.getImageStyle() != Book.imgStyleText) { |
|
|
|
} else { |
|
|
|
content.replace(AppPattern.imgPattern.toRegex(), "\n\$0\n") |
|
|
|
content.replace(AppPattern.imgPattern.toRegex(), "\n\b\$0\n") |
|
|
|
.split("\n").forEach { text -> |
|
|
|
.split("\n").forEach { text -> |
|
|
|
if (text.isNotBlank()) { |
|
|
|
if (text.isNotBlank()) { |
|
|
|
val matcher = AppPattern.imgPattern.matcher(text) |
|
|
|
if(text[0] != '\b'){ //非图片 |
|
|
|
if (matcher.find()) { |
|
|
|
|
|
|
|
matcher.group(1)?.let { src -> |
|
|
|
|
|
|
|
durY = setTypeImage( |
|
|
|
|
|
|
|
book, bookChapter, src, |
|
|
|
|
|
|
|
durY, textPages, book.getImageStyle() |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
val isTitle = index == 0 |
|
|
|
val isTitle = index == 0 |
|
|
|
val textPaint = if (isTitle) titlePaint else contentPaint |
|
|
|
val textPaint = if (isTitle) titlePaint else contentPaint |
|
|
|
if (!(isTitle && ReadBookConfig.titleMode == 2)) { |
|
|
|
if (!(isTitle && ReadBookConfig.titleMode == 2)) { |
|
|
@ -131,6 +123,11 @@ object ChapterProvider { |
|
|
|
stringBuilder, isTitle, textPaint |
|
|
|
stringBuilder, isTitle, textPaint |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { //图片 |
|
|
|
|
|
|
|
durY = setTypeImage( |
|
|
|
|
|
|
|
book, bookChapter, text.substring(1), |
|
|
|
|
|
|
|
durY, textPages, book.getImageStyle() |
|
|
|
|
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -149,7 +146,10 @@ object ChapterProvider { |
|
|
|
|
|
|
|
|
|
|
|
return TextChapter( |
|
|
|
return TextChapter( |
|
|
|
bookChapter.index, bookChapter.title, |
|
|
|
bookChapter.index, bookChapter.title, |
|
|
|
bookChapter.getAbsoluteURL().split(',',limit = 1)[0], //bookChapter.getAbsoluteURL已经处理过,直接按','就行 |
|
|
|
bookChapter.getAbsoluteURL().run{ |
|
|
|
|
|
|
|
val pos = indexOf(',') |
|
|
|
|
|
|
|
if(pos == -1) this else substring(0,pos) |
|
|
|
|
|
|
|
}, |
|
|
|
textPages, chapterSize |
|
|
|
textPages, chapterSize |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|