#1574 render tags - persist tags in db - read tags from kiwixlib

This commit is contained in:
Sean Mac Gillicuddy 2019-12-10 13:13:08 +00:00
parent 3d21b17a4b
commit e26b9219dc
20 changed files with 162 additions and 84 deletions

View File

@ -19,6 +19,7 @@
package org.kiwix.kiwixmobile.zim_manager.library_view.adapter package org.kiwix.kiwixmobile.zim_manager.library_view.adapter
import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book
import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag
import org.kiwix.kiwixmobile.zim_manager.Fat32Checker import org.kiwix.kiwixmobile.zim_manager.Fat32Checker
import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState
import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile import org.kiwix.kiwixmobile.zim_manager.Fat32Checker.FileSystemState.CanWrite4GbFile

View File

@ -31,6 +31,7 @@ import kotlinx.android.synthetic.main.item_library.fileName
import kotlinx.android.synthetic.main.item_library.language import kotlinx.android.synthetic.main.item_library.language
import kotlinx.android.synthetic.main.item_library.publisher import kotlinx.android.synthetic.main.item_library.publisher
import kotlinx.android.synthetic.main.item_library.size import kotlinx.android.synthetic.main.item_library.size
import kotlinx.android.synthetic.main.item_library.tags
import kotlinx.android.synthetic.main.item_library.title import kotlinx.android.synthetic.main.item_library.title
import kotlinx.android.synthetic.main.item_library.unableToDownload import kotlinx.android.synthetic.main.item_library.unableToDownload
import kotlinx.android.synthetic.main.library_divider.divider_text import kotlinx.android.synthetic.main.library_divider.divider_text
@ -70,6 +71,8 @@ sealed class LibraryViewHolder<in T : LibraryListItem>(containerView: View) :
containerView.setOnClickListener { clickAction.invoke(item) } containerView.setOnClickListener { clickAction.invoke(item) }
containerView.isClickable = item.canBeDownloaded containerView.isClickable = item.canBeDownloaded
tags.render(item.tags)
unableToDownload.visibility = if (item.canBeDownloaded) View.GONE else View.VISIBLE unableToDownload.visibility = if (item.canBeDownloaded) View.GONE else View.VISIBLE
unableToDownload.setOnLongClickListener { unableToDownload.setOnLongClickListener {
it.centreToast( it.centreToast(

View File

@ -102,6 +102,16 @@
app:layout_constraintTop_toBottomOf="@+id/language" app:layout_constraintTop_toBottomOf="@+id/language"
tools:text="File Name" /> tools:text="File Name" />
<org.kiwix.kiwixmobile.core.zim_manager.TagsView
android:id="@+id/tags"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/title"
app:layout_constraintTop_toBottomOf="@id/fileName"
app:singleLine="true" />
<View <View
android:id="@+id/unableToDownload" android:id="@+id/unableToDownload"
android:layout_width="0dp" android:layout_width="0dp"

View File

@ -5,7 +5,7 @@
"entities": [ "entities": [
{ {
"id": "3:5536749840871435068", "id": "3:5536749840871435068",
"lastPropertyId": "16:6142333908132117423", "lastPropertyId": "17:2701677664876214591",
"name": "BookOnDiskEntity", "name": "BookOnDiskEntity",
"properties": [ "properties": [
{ {
@ -67,6 +67,10 @@
{ {
"id": "16:6142333908132117423", "id": "16:6142333908132117423",
"name": "favIcon" "name": "favIcon"
},
{
"id": "17:2701677664876214591",
"name": "tags"
} }
], ],
"relations": [] "relations": []
@ -197,7 +201,7 @@
}, },
{ {
"id": "8:8093454424037540087", "id": "8:8093454424037540087",
"lastPropertyId": "23:5485468735259326535", "lastPropertyId": "24:4272820830206771469",
"name": "FetchDownloadEntity", "name": "FetchDownloadEntity",
"properties": [ "properties": [
{ {
@ -287,6 +291,10 @@
{ {
"id": "23:5485468735259326535", "id": "23:5485468735259326535",
"name": "progress" "name": "progress"
},
{
"id": "24:4272820830206771469",
"name": "tags"
} }
], ],
"relations": [] "relations": []

View File

@ -23,12 +23,12 @@ import io.objectbox.Box
import io.objectbox.kotlin.equal import io.objectbox.kotlin.equal
import io.objectbox.kotlin.query import io.objectbox.kotlin.query
import io.reactivex.Flowable import io.reactivex.Flowable
import org.kiwix.kiwixmobile.core.dao.entities.FetchDownloadEntity
import org.kiwix.kiwixmobile.core.dao.entities.FetchDownloadEntity_
import org.kiwix.kiwixmobile.core.downloader.DownloadRequester import org.kiwix.kiwixmobile.core.downloader.DownloadRequester
import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel
import org.kiwix.kiwixmobile.core.downloader.model.DownloadRequest import org.kiwix.kiwixmobile.core.downloader.model.DownloadRequest
import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book
import org.kiwix.kiwixmobile.core.dao.entities.FetchDownloadEntity
import org.kiwix.kiwixmobile.core.dao.entities.FetchDownloadEntity_
import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk
import javax.inject.Inject import javax.inject.Inject
@ -85,12 +85,7 @@ class FetchDownloadDao @Inject constructor(
box.store.callInTx { box.store.callInTx {
if (doesNotAlreadyExist(book)) { if (doesNotAlreadyExist(book)) {
insert( insert(
downloadRequester.enqueue( downloadRequester.enqueue(DownloadRequest(url, book)),
DownloadRequest(
url,
book
)
),
book = book book = book
) )
} }

View File

@ -43,7 +43,8 @@ data class BookOnDiskEntity(
val mediaCount: String?, val mediaCount: String?,
val size: String, val size: String,
val name: String?, val name: String?,
val favIcon: String val favIcon: String,
val tags: String? = null
) { ) {
constructor(bookOnDisk: BookOnDisk) : this( constructor(bookOnDisk: BookOnDisk) : this(
0, 0,
@ -60,7 +61,8 @@ data class BookOnDiskEntity(
bookOnDisk.book.getMediaCount(), bookOnDisk.book.getMediaCount(),
bookOnDisk.book.getSize(), bookOnDisk.book.getSize(),
bookOnDisk.book.name, bookOnDisk.book.name,
bookOnDisk.book.getFavicon() bookOnDisk.book.getFavicon(),
bookOnDisk.book.tags
) )
fun toBook() = Book().apply { fun toBook() = Book().apply {
@ -77,6 +79,7 @@ data class BookOnDiskEntity(
size = this@BookOnDiskEntity.size size = this@BookOnDiskEntity.size
bookName = name bookName = name
favicon = favIcon favicon = favIcon
tags = this@BookOnDiskEntity.tags
} }
} }

View File

@ -51,7 +51,8 @@ data class FetchDownloadEntity(
val mediaCount: String?, val mediaCount: String?,
val size: String, val size: String,
val name: String?, val name: String?,
val favIcon: String val favIcon: String,
val tags: String? = null
) { ) {
constructor(downloadId: Long, book: Book) : this( constructor(downloadId: Long, book: Book) : this(
downloadId = downloadId, downloadId = downloadId,
@ -67,7 +68,8 @@ data class FetchDownloadEntity(
mediaCount = book.getMediaCount(), mediaCount = book.getMediaCount(),
size = book.getSize(), size = book.getSize(),
name = book.name, name = book.name,
favIcon = book.getFavicon() favIcon = book.getFavicon(),
tags = book.tags
) )
fun toBook() = Book().apply { fun toBook() = Book().apply {
@ -84,6 +86,7 @@ data class FetchDownloadEntity(
size = this@FetchDownloadEntity.size size = this@FetchDownloadEntity.size
bookName = name bookName = name
favicon = favIcon favicon = favIcon
tags = this@FetchDownloadEntity.tags
} }
fun updateWith(download: Download) = copy( fun updateWith(download: Download) = copy(

View File

@ -80,6 +80,7 @@ class ZimFileReader constructor(
val description: String get() = jniKiwixReader.description val description: String get() = jniKiwixReader.description
val favicon: String get() = jniKiwixReader.favicon val favicon: String get() = jniKiwixReader.favicon
val language: String get() = jniKiwixReader.language val language: String get() = jniKiwixReader.language
val tags: String get() = "${getContent(Uri.parse("M/Tags"))}"
private val mediaCount: Int? private val mediaCount: Int?
get() = try { get() = try {
jniKiwixReader.mediaCount jniKiwixReader.mediaCount
@ -222,6 +223,7 @@ class ZimFileReader constructor(
articleCount = this@ZimFileReader.articleCount.toString() articleCount = this@ZimFileReader.articleCount.toString()
mediaCount = this@ZimFileReader.mediaCount.toString() mediaCount = this@ZimFileReader.mediaCount.toString()
bookName = name bookName = name
tags = this@ZimFileReader.tags
} }
companion object { companion object {

View File

@ -16,14 +16,14 @@
* *
*/ */
package org.kiwix.kiwixmobile.zim_manager.library_view.adapter package org.kiwix.kiwixmobile.core.zim_manager
import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.KiwixTag.Companion.YesNoValueTag.DetailsTag import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag.DetailsTag
import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.KiwixTag.Companion.YesNoValueTag.FtIndexTag import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag.FtIndexTag
import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.KiwixTag.Companion.YesNoValueTag.PicturesTag import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag.PicturesTag
import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.KiwixTag.Companion.YesNoValueTag.VideoTag import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag.VideoTag
import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.KiwixTag.TagValue.NO import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.TagValue.NO
import org.kiwix.kiwixmobile.zim_manager.library_view.adapter.KiwixTag.TagValue.YES import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.TagValue.YES
sealed class KiwixTag { sealed class KiwixTag {
companion object { companion object {
@ -34,7 +34,7 @@ sealed class KiwixTag {
when (val tag = split[0]) { when (val tag = split[0]) {
"_ftindex" -> FtIndexTag(value!!) "_ftindex" -> FtIndexTag(value!!)
"_pictures" -> PicturesTag(value!!) "_pictures" -> PicturesTag(value!!)
"_video" -> VideoTag(value!!) "_videos" -> VideoTag(value!!)
"_details" -> DetailsTag(value!!) "_details" -> DetailsTag(value!!)
"_category" -> CategoryTag(value!!) "_category" -> CategoryTag(value!!)
else -> value?.let { ArbitraryTag(tag, it) } ?: TagOnly(tag) else -> value?.let { ArbitraryTag(tag, it) } ?: TagOnly(tag)

View File

@ -0,0 +1,60 @@
/*
* Kiwix Android
* Copyright (c) 2019 Kiwix <android.kiwix.org>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.kiwix.kiwixmobile.core.zim_manager
import android.content.Context
import android.util.AttributeSet
import com.google.android.material.chip.Chip
import com.google.android.material.chip.ChipGroup
import kotlinx.android.synthetic.main.tag_content.view.tag_picture
import kotlinx.android.synthetic.main.tag_content.view.tag_short_text_only
import kotlinx.android.synthetic.main.tag_content.view.tag_text_only
import kotlinx.android.synthetic.main.tag_content.view.tag_video
import org.kiwix.kiwixmobile.core.R
import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate
import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag
import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag.DetailsTag
import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag.PicturesTag
import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.Companion.YesNoValueTag.VideoTag
import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag.TagValue.YES
class TagsView(context: Context, attrs: AttributeSet) : ChipGroup(context, attrs) {
init {
inflate(R.layout.tag_content, true)
}
fun render(tags: List<KiwixTag>) {
val pictureTagIsSet = tags.isSet<PicturesTag>()
val videoTagIsSet = tags.isSet<VideoTag>()
val detailsTagIsSet = tags.isSet<DetailsTag>()
tag_picture.selectBy(pictureTagIsSet)
tag_video.selectBy(videoTagIsSet)
tag_text_only.selectBy(!pictureTagIsSet && !videoTagIsSet && detailsTagIsSet)
tag_short_text_only.selectBy(!pictureTagIsSet && !videoTagIsSet && !detailsTagIsSet)
}
private inline fun <reified T : YesNoValueTag> List<KiwixTag>.isSet() =
filterIsInstance<T>().getOrNull(0)?.value == YES
private fun Chip.selectBy(isTagSet: Boolean) {
isChecked = isTagSet
isEnabled = isTagSet
}
}

View File

@ -20,6 +20,7 @@ package org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView.ViewHolder import androidx.recyclerview.widget.RecyclerView.ViewHolder
import org.kiwix.kiwixmobile.core.R import org.kiwix.kiwixmobile.core.R
import org.kiwix.kiwixmobile.core.base.adapter.AbsDelegateAdapter
import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate import org.kiwix.kiwixmobile.core.extensions.ViewGroupExtensions.inflate
import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil
import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode
@ -27,7 +28,6 @@ import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.NORM
import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BookOnDiskViewHolder.BookViewHolder import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BookOnDiskViewHolder.BookViewHolder
import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.BookOnDisk
import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem.LanguageItem
import org.kiwix.kiwixmobile.core.base.adapter.AbsDelegateAdapter
sealed class BookOnDiskDelegate<I : BooksOnDiskListItem, out VH : BookOnDiskViewHolder<I>> : sealed class BookOnDiskDelegate<I : BooksOnDiskListItem, out VH : BookOnDiskViewHolder<I>> :
AbsDelegateAdapter<I, BooksOnDiskListItem, VH> { AbsDelegateAdapter<I, BooksOnDiskListItem, VH> {
@ -53,7 +53,6 @@ sealed class BookOnDiskDelegate<I : BooksOnDiskListItem, out VH : BookOnDiskView
override fun createViewHolder(parent: ViewGroup) = override fun createViewHolder(parent: ViewGroup) =
BookViewHolder( BookViewHolder(
parent.inflate(R.layout.item_book, false), parent.inflate(R.layout.item_book, false),
sharedPreferenceUtil,
clickAction, clickAction,
longClickAction, longClickAction,
multiSelectAction multiSelectAction

View File

@ -22,6 +22,7 @@ import org.kiwix.kiwixmobile.core.dao.entities.BookOnDiskEntity
import org.kiwix.kiwixmobile.core.dao.entities.FetchDownloadEntity import org.kiwix.kiwixmobile.core.dao.entities.FetchDownloadEntity
import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book
import org.kiwix.kiwixmobile.core.reader.ZimFileReader import org.kiwix.kiwixmobile.core.reader.ZimFileReader
import org.kiwix.kiwixmobile.core.zim_manager.KiwixTag
import java.io.File import java.io.File
import java.util.Locale import java.util.Locale
@ -39,10 +40,11 @@ sealed class BooksOnDiskListItem {
) )
} }
data class BookOnDisk( data class BookOnDisk constructor(
val databaseId: Long = 0L, val databaseId: Long = 0L,
val book: Book, val book: Book,
val file: File, val file: File,
val tags: List<KiwixTag> = KiwixTag.from(book.tags),
override val id: Long = databaseId override val id: Long = databaseId
) : BooksOnDiskListItem() { ) : BooksOnDiskListItem() {

View File

@ -26,14 +26,12 @@ import kotlinx.android.synthetic.main.item_book.item_book_clickable_area
import kotlinx.android.synthetic.main.item_book.item_book_date import kotlinx.android.synthetic.main.item_book.item_book_date
import kotlinx.android.synthetic.main.item_book.item_book_description import kotlinx.android.synthetic.main.item_book.item_book_description
import kotlinx.android.synthetic.main.item_book.item_book_icon import kotlinx.android.synthetic.main.item_book.item_book_icon
import kotlinx.android.synthetic.main.item_book.item_book_label_picture
import kotlinx.android.synthetic.main.item_book.item_book_label_video
import kotlinx.android.synthetic.main.item_book.item_book_size import kotlinx.android.synthetic.main.item_book.item_book_size
import kotlinx.android.synthetic.main.item_book.item_book_title import kotlinx.android.synthetic.main.item_book.item_book_title
import kotlinx.android.synthetic.main.item_book.tags
import org.kiwix.kiwixmobile.core.base.adapter.BaseViewHolder import org.kiwix.kiwixmobile.core.base.adapter.BaseViewHolder
import org.kiwix.kiwixmobile.core.downloader.model.Base64String import org.kiwix.kiwixmobile.core.downloader.model.Base64String
import org.kiwix.kiwixmobile.core.extensions.setBitmap import org.kiwix.kiwixmobile.core.extensions.setBitmap
import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil
import org.kiwix.kiwixmobile.core.zim_manager.KiloByte import org.kiwix.kiwixmobile.core.zim_manager.KiloByte
import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.ArticleCount import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.ArticleCount
import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode
@ -47,7 +45,6 @@ sealed class BookOnDiskViewHolder<in T : BooksOnDiskListItem>(containerView: Vie
class BookViewHolder( class BookViewHolder(
containerView: View, containerView: View,
private val sharedPreferenceUtil: SharedPreferenceUtil,
private val clickAction: ((BookOnDisk) -> Unit)?, private val clickAction: ((BookOnDisk) -> Unit)?,
private val longClickAction: ((BookOnDisk) -> Unit)?, private val longClickAction: ((BookOnDisk) -> Unit)?,
private val multiSelectAction: ((BookOnDisk) -> Unit)? private val multiSelectAction: ((BookOnDisk) -> Unit)?
@ -72,14 +69,7 @@ sealed class BookOnDiskViewHolder<in T : BooksOnDiskListItem>(containerView: Vie
item_book_icon.setBitmap(Base64String(book.favicon)) item_book_icon.setBitmap(Base64String(book.favicon))
val path = item.file.path tags.render(item.tags)
if (path.contains("nopic")) {
item_book_label_picture.visibility = View.GONE
item_book_label_video.visibility = View.GONE
}
if (path.contains("novid")) {
item_book_label_video.visibility = View.GONE
}
itemBookCheckbox.isChecked = item.isSelected itemBookCheckbox.isChecked = item.isSelected
when (selectionMode) { when (selectionMode) {

View File

@ -1,8 +0,0 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="20dp" />
<stroke android:color="@color/picture_label" android:width="1dp" />
</shape>
</item>
</selector>

View File

@ -1,8 +0,0 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="20dp" />
<stroke android:color="@color/video_label" android:width="1dp" />
</shape>
</item>
</selector>

View File

@ -98,35 +98,14 @@
app:layout_constraintTop_toBottomOf="@id/item_book_date" app:layout_constraintTop_toBottomOf="@id/item_book_date"
tools:text="All wikipedia articles" /> tools:text="All wikipedia articles" />
<TextView <org.kiwix.kiwixmobile.core.zim_manager.TagsView
android:id="@+id/item_book_label_picture" android:id="@+id/tags"
style="@style/list_item_body" android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/border_label_picture" app:layout_constraintEnd_toEndOf="parent"
android:paddingStart="6dp" app:layout_constraintStart_toStartOf="@+id/item_book_description"
android:paddingEnd="6dp" app:layout_constraintTop_toBottomOf="@id/item_book_description"
android:text="@string/pic" app:singleLine="true" />
android:textAlignment="center"
android:textColor="@color/picture_label"
app:layout_constraintStart_toStartOf="@id/item_book_title"
app:layout_constraintTop_toBottomOf="@id/item_book_description" />
<TextView
android:id="@+id/item_book_label_video"
style="@style/list_item_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/border_label_video"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:text="@string/vid"
android:textAlignment="center"
android:textColor="@color/video_label"
app:layout_constraintStart_toEndOf="@id/item_book_label_picture"
app:layout_constraintTop_toTopOf="@id/item_book_label_picture" />
<View <View
android:layout_width="0dp" android:layout_width="0dp"
@ -134,7 +113,7 @@
android:layout_marginTop="@dimen/activity_vertical_margin" android:layout_marginTop="@dimen/activity_vertical_margin"
android:background="?android:attr/dividerVertical" android:background="?android:attr/dividerVertical"
app:layout_constraintStart_toStartOf="@id/item_book_title" app:layout_constraintStart_toStartOf="@id/item_book_title"
app:layout_constraintTop_toBottomOf="@id/item_book_label_picture" /> app:layout_constraintTop_toBottomOf="@id/tags" />
<View <View
android:id="@+id/item_book_clickable_area" android:id="@+id/item_book_clickable_area"

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:parentTag="com.google.android.material.chip.ChipGroup">
<com.google.android.material.chip.Chip
android:id="@+id/tag_picture"
style="@style/Widget.KiwixTheme.Chip.Choice.Static"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tag_pic" />
<com.google.android.material.chip.Chip
android:id="@+id/tag_video"
style="@style/Widget.KiwixTheme.Chip.Choice.Static"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tag_vid" />
<com.google.android.material.chip.Chip
android:id="@+id/tag_text_only"
style="@style/Widget.KiwixTheme.Chip.Choice.Static"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tag_text_only" />
<com.google.android.material.chip.Chip
android:id="@+id/tag_short_text_only"
style="@style/Widget.KiwixTheme.Chip.Choice.Static"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tag_short_text_only" />
</merge>

View File

@ -9,8 +9,6 @@
<color name="grey">#5a5a5a</color> <color name="grey">#5a5a5a</color>
<color name="pure_grey">#808080</color> <color name="pure_grey">#808080</color>
<color name="blue_grey">#ECEFF1</color> <color name="blue_grey">#ECEFF1</color>
<color name="picture_label">#fb8c00</color>
<color name="video_label">#651FFF</color>
<color name="blue800">#1565c0</color> <color name="blue800">#1565c0</color>
<color name="blueTransparent">#962e7ac4</color> <color name="blueTransparent">#962e7ac4</color>
<color name="actionModeBackground">#4285F4</color> <color name="actionModeBackground">#4285F4</color>

View File

@ -285,6 +285,10 @@
<string name="status">Status</string> <string name="status">Status</string>
<string name="pref_clear_all_notes_summary">Clears all notes on all articles</string> <string name="pref_clear_all_notes_summary">Clears all notes on all articles</string>
<string name="pref_clear_all_notes_title">Clear all notes</string> <string name="pref_clear_all_notes_title">Clear all notes</string>
<string name="tag_pic">Pic</string>
<string name="tag_vid">Vid</string>
<string name="tag_text_only">Text Only</string>
<string name="tag_short_text_only">Short Text Only</string>
<string-array name="pref_night_modes_entries"> <string-array name="pref_night_modes_entries">
<item>On</item> <item>On</item>
<item>Off</item> <item>Off</item>

View File

@ -33,6 +33,10 @@
<item name="tabTextColor">@color/white</item> <item name="tabTextColor">@color/white</item>
</style> </style>
<style name="Widget.KiwixTheme.Chip.Choice.Static" parent="Widget.MaterialComponents.Chip.Choice">
<item name="android:clickable">false</item>
</style>
<style name="no_list_content_text" parent="TextAppearance.KiwixTheme.Headline6"> <style name="no_list_content_text" parent="TextAppearance.KiwixTheme.Headline6">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>