mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Creating BooleanExtentions
Starting off with toInt()
This commit is contained in:
parent
07cc4eefb3
commit
650c3bc4f8
3 changed files with 4 additions and 3 deletions
|
@ -18,6 +18,7 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault
|
|||
import eu.kanade.tachiyomi.databinding.MigrationBottomSheetBinding
|
||||
import eu.kanade.tachiyomi.ui.migration.MigrationFlags
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
import eu.kanade.tachiyomi.util.system.toInt
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.setBottomEdge
|
||||
|
@ -147,8 +148,6 @@ class MigrationBottomSheetDialog(
|
|||
pref.set(index == 1)
|
||||
}
|
||||
}
|
||||
|
||||
private fun Boolean.toInt() = if (this) 1 else 0
|
||||
}
|
||||
|
||||
interface StartMigrationListener {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
package eu.kanade.tachiyomi.util.system
|
||||
|
||||
fun Boolean.toInt() = if (this) 1 else 0
|
|
@ -291,7 +291,6 @@ object ImageUtil {
|
|||
private val Bitmap.rect: Rect
|
||||
get() = Rect(0, 0, width, height)
|
||||
|
||||
fun Boolean.toInt() = if (this) 1 else 0
|
||||
private fun isDark(color: Int): Boolean {
|
||||
return Color.red(color) < 40 && Color.blue(color) < 40 && Color.green(color) < 40 &&
|
||||
Color.alpha(color) > 200
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue