|
|
@ -9,7 +9,9 @@ import io.legado.app.data.entities.BookChapter |
|
|
|
import io.legado.app.help.BookHelp |
|
|
|
import io.legado.app.help.BookHelp |
|
|
|
import io.legado.app.lib.theme.accentColor |
|
|
|
import io.legado.app.lib.theme.accentColor |
|
|
|
import io.legado.app.utils.getCompatColor |
|
|
|
import io.legado.app.utils.getCompatColor |
|
|
|
import kotlinx.android.synthetic.main.item_bookmark.view.* |
|
|
|
import io.legado.app.utils.visible |
|
|
|
|
|
|
|
import kotlinx.android.synthetic.main.item_bookmark.view.tv_chapter_name |
|
|
|
|
|
|
|
import kotlinx.android.synthetic.main.item_chapter_list.view.* |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
|
|
|
|
|
|
|
|
class ChapterListAdapter(context: Context, val callback: Callback) : |
|
|
|
class ChapterListAdapter(context: Context, val callback: Callback) : |
|
|
@ -23,6 +25,10 @@ class ChapterListAdapter(context: Context, val callback: Callback) : |
|
|
|
tv_chapter_name.setTextColor(context.getCompatColor(R.color.tv_text_default)) |
|
|
|
tv_chapter_name.setTextColor(context.getCompatColor(R.color.tv_text_default)) |
|
|
|
} |
|
|
|
} |
|
|
|
tv_chapter_name.text = item.title |
|
|
|
tv_chapter_name.text = item.title |
|
|
|
|
|
|
|
if (!item.tag.isNullOrEmpty()) { |
|
|
|
|
|
|
|
tv_tag.text = item.tag |
|
|
|
|
|
|
|
tv_tag.visible() |
|
|
|
|
|
|
|
} |
|
|
|
this.onClick { |
|
|
|
this.onClick { |
|
|
|
callback.openChapter(item) |
|
|
|
callback.openChapter(item) |
|
|
|
} |
|
|
|
} |
|
|
|