fix epub reader playback and trial navigation
This commit is contained in:
@@ -49,14 +49,24 @@ final class RDEPUBReaderChapterListController: UITableViewController {
|
||||
cell.backgroundColor = theme.contentBackgroundColor
|
||||
cell.textLabel?.numberOfLines = 2
|
||||
cell.textLabel?.text = item.title
|
||||
cell.textLabel?.textColor = isCurrentItem(item) ? .systemBlue : theme.contentTextColor
|
||||
if isCurrentItem(item) {
|
||||
cell.textLabel?.textColor = .systemBlue
|
||||
} else if item.isReadable {
|
||||
cell.textLabel?.textColor = theme.contentTextColor
|
||||
} else {
|
||||
cell.textLabel?.textColor = .systemGray
|
||||
}
|
||||
cell.selectionStyle = item.isReadable ? .default : .none
|
||||
cell.isUserInteractionEnabled = item.isReadable
|
||||
cell.indentationLevel = item.depth
|
||||
cell.indentationWidth = 18
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
onSelectItem?(items[indexPath.row])
|
||||
let item = items[indexPath.row]
|
||||
guard item.isReadable else { return }
|
||||
onSelectItem?(item)
|
||||
}
|
||||
|
||||
private func isCurrentItem(_ item: RDEPUBReaderTableOfContentsItem) -> Bool {
|
||||
|
||||
Reference in New Issue
Block a user