Fix tag margins
This commit is contained in:
parent
ce39d6ec25
commit
b571ccccaa
@ -1,9 +1,13 @@
|
|||||||
package eu.kanade.tachiyomi.ui.manga.info
|
package eu.kanade.tachiyomi.ui.manga.info
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.core.view.isVisible
|
||||||
|
import androidx.core.view.updateLayoutParams
|
||||||
import com.google.android.material.chip.Chip
|
import com.google.android.material.chip.Chip
|
||||||
import eu.davidea.viewholders.FlexibleViewHolder
|
import eu.davidea.viewholders.FlexibleViewHolder
|
||||||
import eu.kanade.tachiyomi.databinding.MangaInfoGenreGroupingBinding
|
import eu.kanade.tachiyomi.databinding.MangaInfoGenreGroupingBinding
|
||||||
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
import exh.util.makeSearchChip
|
import exh.util.makeSearchChip
|
||||||
|
|
||||||
class NamespaceTagsHolder(
|
class NamespaceTagsHolder(
|
||||||
@ -15,12 +19,21 @@ class NamespaceTagsHolder(
|
|||||||
fun bind(item: NamespaceTagsItem) {
|
fun bind(item: NamespaceTagsItem) {
|
||||||
binding.namespace.removeAllViews()
|
binding.namespace.removeAllViews()
|
||||||
val namespace = item.namespace
|
val namespace = item.namespace
|
||||||
if (namespace != null) {
|
binding.namespace.isVisible = if (namespace != null) {
|
||||||
binding.namespace.addView(
|
binding.namespace.addView(
|
||||||
Chip(binding.root.context).apply {
|
Chip(binding.root.context).apply {
|
||||||
text = namespace
|
text = namespace
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
binding.tags.updateLayoutParams<LinearLayout.LayoutParams> {
|
||||||
|
marginStart = 8.dpToPx
|
||||||
|
}
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
binding.tags.updateLayoutParams<LinearLayout.LayoutParams> {
|
||||||
|
marginStart = 16.dpToPx
|
||||||
|
}
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.tags.removeAllViews()
|
binding.tags.removeAllViews()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user