mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 13:37:29 +01:00
Remove TextDrawable
This commit is contained in:
@@ -23,13 +23,6 @@ class CategoryAdapter(controller: CategoryController) :
|
||||
(0 until itemCount).forEach { getItem(it)?.isSelected = false }
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the active selections from the model.
|
||||
*/
|
||||
fun clearModelSelection() {
|
||||
selectedPositions.forEach { getItem(it)?.isSelected = false }
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the selection of the given position.
|
||||
*
|
||||
|
||||
@@ -3,8 +3,6 @@ package eu.kanade.tachiyomi.ui.category
|
||||
import android.view.View
|
||||
import eu.kanade.tachiyomi.data.database.models.Category
|
||||
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
||||
import eu.kanade.tachiyomi.util.view.roundTextIcon
|
||||
import kotlinx.android.synthetic.main.categories_item.image
|
||||
import kotlinx.android.synthetic.main.categories_item.reorder
|
||||
import kotlinx.android.synthetic.main.categories_item.title
|
||||
|
||||
@@ -17,12 +15,6 @@ import kotlinx.android.synthetic.main.categories_item.title
|
||||
class CategoryHolder(view: View, val adapter: CategoryAdapter) : BaseFlexibleViewHolder(view, adapter) {
|
||||
|
||||
init {
|
||||
// Create round letter image onclick to simulate long click
|
||||
image.setOnClickListener {
|
||||
// Simulate long click on this view to enter selection mode
|
||||
onLongClick(view)
|
||||
}
|
||||
|
||||
setDragHandleView(reorder)
|
||||
}
|
||||
|
||||
@@ -34,11 +26,6 @@ class CategoryHolder(view: View, val adapter: CategoryAdapter) : BaseFlexibleVie
|
||||
fun bind(category: Category) {
|
||||
// Set capitalized title.
|
||||
title.text = category.name.capitalize()
|
||||
|
||||
// Update circle letter image.
|
||||
itemView.post {
|
||||
image.roundTextIcon(category.name)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -100,7 +100,7 @@ class CategoryPresenter(
|
||||
/**
|
||||
* Returns true if a category with the given name already exists.
|
||||
*/
|
||||
fun categoryExists(name: String): Boolean {
|
||||
private fun categoryExists(name: String): Boolean {
|
||||
return categories.any { it.name.equals(name, true) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import eu.kanade.tachiyomi.source.icon
|
||||
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
||||
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.roundTextIcon
|
||||
import io.github.mthli.slice.Slice
|
||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.card
|
||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.image
|
||||
@@ -43,8 +42,9 @@ class SourceHolder(view: View, override val adapter: SourceAdapter) :
|
||||
// Set circle letter image.
|
||||
itemView.post {
|
||||
val icon = source.icon()
|
||||
if (icon != null) image.setImageDrawable(icon)
|
||||
else image.roundTextIcon(source.name)
|
||||
if (icon != null) {
|
||||
image.setImageDrawable(icon)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import eu.kanade.tachiyomi.source.icon
|
||||
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
||||
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.roundTextIcon
|
||||
import eu.kanade.tachiyomi.util.view.visible
|
||||
import io.github.mthli.slice.Slice
|
||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.card
|
||||
@@ -50,7 +49,6 @@ class SourceHolder(view: View, override val adapter: SourceAdapter) :
|
||||
when {
|
||||
icon != null -> image.setImageDrawable(icon)
|
||||
item.source.id == LocalSource.ID -> image.setImageResource(R.mipmap.ic_local_source)
|
||||
else -> image.roundTextIcon(source.name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user