diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index cec81f7b86..f88f25c207 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -26,6 +26,7 @@ import androidx.appcompat.view.ActionMode import androidx.appcompat.widget.SearchView import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.view.GestureDetectorCompat +import androidx.core.view.isInvisible import androidx.core.view.isVisible import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.GridLayoutManager @@ -88,7 +89,6 @@ import eu.kanade.tachiyomi.util.view.expand import eu.kanade.tachiyomi.util.view.getItemView import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.hide -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.isExpanded import eu.kanade.tachiyomi.util.view.isHidden import eu.kanade.tachiyomi.util.view.scrollViewWith @@ -857,7 +857,7 @@ class LibraryController( updateFilterSheetY() closeTip() if (binding.filterBottomSheet.filterBottomSheet.sheetBehavior.isHidden()) { - binding.filterBottomSheet.filterBottomSheet.invisible() + binding.filterBottomSheet.filterBottomSheet.isInvisible = true } activityBinding?.toolbar?.hideDropdown() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt index cc83db55ec..09396d8385 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt @@ -6,6 +6,7 @@ import android.util.TypedValue import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat +import androidx.core.view.isInvisible import androidx.core.view.isVisible import com.github.florent37.viewtooltip.ViewTooltip import eu.davidea.flexibleadapter.SelectableAdapter @@ -20,7 +21,6 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.view.gone -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.visible import uy.kohesive.injekt.Injekt @@ -121,8 +121,8 @@ class LibraryHeaderHolder(val view: View, private val adapter: LibraryCategoryAd LibraryUpdateService.categoryInQueue(category.id) -> { binding.collapseArrow.isVisible = !adapter.isSingleCategory binding.checkbox.gone() - binding.catProgress.visible() - binding.updateButton.invisible() + binding.catProgress.isVisible = true + binding.updateButton.isInvisible = true } else -> { binding.collapseArrow.isVisible = !adapter.isSingleCategory @@ -136,7 +136,7 @@ class LibraryHeaderHolder(val view: View, private val adapter: LibraryCategoryAd private fun addCategoryToUpdate() { if (adapter.libraryListener.updateCategory(flexibleAdapterPosition)) { binding.catProgress.visible() - binding.updateButton.invisible() + binding.updateButton.isInvisible = true } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt index 0d6748f9e3..6928a66467 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt @@ -8,6 +8,7 @@ import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.core.graphics.ColorUtils +import androidx.core.view.isInvisible import androidx.core.view.isVisible import coil.api.loadAny import coil.request.CachePolicy @@ -21,7 +22,6 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.isLTR import eu.kanade.tachiyomi.util.view.gone -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.resetStrokeColor import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.visible @@ -313,8 +313,8 @@ class MangaHeaderHolder( fun collapse() { binding.subItemGroup.gone() binding.startReadingButton.gone() - if (binding.moreButton.visibility == View.VISIBLE || binding.moreButton.visibility == View.INVISIBLE) { - binding.moreButtonGroup.invisible() + if (binding.moreButton.isVisible || binding.moreButton.isInvisible) { + binding.moreButtonGroup.isInvisible = true } else { binding.lessButton.gone() binding.mangaGenresTags.gone() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSortBottomSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSortBottomSheet.kt index 870f325741..27a87ccb7d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSortBottomSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSortBottomSheet.kt @@ -12,7 +12,6 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.databinding.ChapterSortBottomSheetBinding import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.util.system.dpToPx -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.setBottomEdge import eu.kanade.tachiyomi.util.view.setEdgeToEdge import kotlin.math.max @@ -118,7 +117,7 @@ class ChaptersSortBottomSheet(controller: MangaDetailsController) : BottomSheetD val desc = binding.sortGroup.checkedRadioButtonId == R.id.sort_newest presenter.setGlobalChapterSort(desc) defPref = desc - binding.setAsDefaultSort.invisible() + binding.setAsDefaultSort.isInvisible = true } binding.sortMethodGroup.setOnCheckedChangeListener { _, checkedId -> diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt index f3ca1610db..5a28b61df5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.migration.manga.process import android.view.View import androidx.appcompat.widget.PopupMenu import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.view.isInvisible import coil.Coil import coil.request.LoadRequest import eu.kanade.tachiyomi.R @@ -15,7 +16,6 @@ import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.view.gone -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.setVectorCompat import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.util.view.withFadeTransaction @@ -61,7 +61,7 @@ class MigrationProcessHolder( android.R.attr.textColorPrimary ) ) - binding.migrationMenu.invisible() + binding.migrationMenu.isInvisible = true binding.skipManga.visible() binding.migrationMangaCardTo.resetManga() if (manga != null) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index ff18c48793..99bff04c03 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -87,7 +87,6 @@ import eu.kanade.tachiyomi.util.view.compatToolTipText import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.hide -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.isCollapsed import eu.kanade.tachiyomi.util.view.isExpanded import eu.kanade.tachiyomi.util.view.popupMenu @@ -259,7 +258,7 @@ class ReaderActivity : indexChapterToShift = savedInstanceState.get(SHIFTED_CHAP_INDEX) as? Long binding.readerNav.root.isInvisible = !menuVisible } else { - binding.readerNav.root.invisible() + binding.readerNav.root.isInvisible = true } binding.chaptersSheet.chaptersBottomSheet.setup(this) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt index 24ee7ed747..d313672081 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt @@ -7,6 +7,7 @@ import android.util.AttributeSet import android.view.View import android.widget.LinearLayout import androidx.core.graphics.ColorUtils +import androidx.core.view.isInvisible import androidx.core.view.isVisible import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -24,7 +25,6 @@ import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.view.collapse import eu.kanade.tachiyomi.util.view.expand import eu.kanade.tachiyomi.util.view.gone -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.isCollapsed import eu.kanade.tachiyomi.util.view.isExpanded import eu.kanade.tachiyomi.util.view.visible @@ -101,14 +101,14 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr activity.binding.readerNav.root.visible() } if (state == BottomSheetBehavior.STATE_EXPANDED) { - activity.binding.readerNav.root.invisible() + activity.binding.readerNav.root.isInvisible = true activity.binding.readerNav.root.alpha = 0f binding.chapterRecycler.alpha = 1f if (activity.sheetManageNavColor) activity.window.navigationBarColor = primary } if (state == BottomSheetBehavior.STATE_HIDDEN) { activity.binding.readerNav.root.alpha = 0f - activity.binding.readerNav.root.invisible() + activity.binding.readerNav.root.isInvisible = true } binding.chapterRecycler.isClickable = state == BottomSheetBehavior.STATE_EXPANDED binding.chapterRecycler.isFocusable = state == BottomSheetBehavior.STATE_EXPANDED @@ -123,8 +123,8 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr false } else { if (item.chapter.id != presenter.getCurrentChapter()?.chapter?.id) { - activity.binding.readerNav.leftChapter.invisible() - activity.binding.readerNav.rightChapter.invisible() + activity.binding.readerNav.leftChapter.isInvisible = true + activity.binding.readerNav.rightChapter.isInvisible = true presenter.loadChapter(item.chapter) loadingPos = position diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt index 7fa302d408..5f335d8523 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt @@ -11,6 +11,7 @@ import android.webkit.WebChromeClient import android.webkit.WebView import android.widget.LinearLayout import androidx.core.graphics.ColorUtils +import androidx.core.view.isInvisible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.databinding.WebviewActivityBinding import eu.kanade.tachiyomi.ui.base.activity.BaseActivity @@ -18,7 +19,6 @@ import eu.kanade.tachiyomi.util.system.getPrefTheme import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.isInNightMode import eu.kanade.tachiyomi.util.system.setDefaultSettings -import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.marginBottom import eu.kanade.tachiyomi.util.view.setStyle import eu.kanade.tachiyomi.util.view.updateLayoutParams @@ -114,7 +114,7 @@ open class BaseWebViewActivity : BaseActivity() { binding.progressBar.visible() binding.progressBar.progress = newProgress if (newProgress == 100) { - binding.progressBar.invisible() + binding.progressBar.isInvisible = true } super.onProgressChanged(view, newProgress) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt index 8cb5ff1649..e99c440190 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt @@ -106,10 +106,6 @@ inline fun View.visible() { visibility = View.VISIBLE } -inline fun View.invisible() { - visibility = View.INVISIBLE -} - inline fun View.gone() { visibility = View.GONE }