pull/49/head
kunfei 5 years ago
parent ebea905aa4
commit 53e1e028a0
  1. 8
      app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt
  2. 7
      app/src/main/res/layout/item_chapter_list.xml

@ -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)
} }

@ -12,5 +12,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" /> android:singleLine="true" />
<TextView
android:id="@+id/tv_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:visibility="gone"
android:singleLine="true" />
</LinearLayout> </LinearLayout>
Loading…
Cancel
Save