Revert history Compose/SQLDelight changes
This commit is contained in:
@@ -35,7 +35,6 @@ import com.google.android.material.snackbar.Snackbar
|
||||
import dev.chrisbanes.insetter.applyInsetter
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.SelectableAdapter
|
||||
import eu.kanade.domain.history.model.HistoryWithRelations
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.cache.CoverCache
|
||||
import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
||||
@@ -119,8 +118,6 @@ class MangaController :
|
||||
DownloadCustomChaptersDialog.Listener,
|
||||
DeleteChaptersDialog.Listener {
|
||||
|
||||
constructor(history: HistoryWithRelations) : this(history.mangaId)
|
||||
|
||||
constructor(manga: Manga?, fromSource: Boolean = false) : super(
|
||||
bundleOf(
|
||||
MANGA_EXTRA to (manga?.id ?: 0),
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package eu.kanade.tachiyomi.ui.manga.info
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* A custom ImageView for holding a manga cover with:
|
||||
* - width: min(maxWidth attr, 33% of parent width)
|
||||
* - height: 2:3 width:height ratio
|
||||
*
|
||||
* Should be defined with a width of match_parent.
|
||||
*/
|
||||
class MangaCoverImageView(context: Context, attrs: AttributeSet?) : AppCompatImageView(context, attrs) {
|
||||
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
|
||||
|
||||
val width = min(maxWidth, measuredWidth / 3)
|
||||
val height = width / 2 * 3
|
||||
setMeasuredDimension(width, height)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user