mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-24 17:01:51 +01:00
Fixed filter sheet not hidden in landscape
This commit is contained in:
parent
d781a71425
commit
d2dae05ab2
@ -215,6 +215,13 @@ class LibraryController(
|
|||||||
fab.setOnClickListener {
|
fab.setOnClickListener {
|
||||||
router.pushController(DownloadController().withFadeTransaction())
|
router.pushController(DownloadController().withFadeTransaction())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (presenter.isDownloading()) {
|
||||||
|
fab.scaleY = 1f
|
||||||
|
fab.scaleX = 1f
|
||||||
|
fab.isClickable = true
|
||||||
|
fab.isFocusable = true
|
||||||
|
}
|
||||||
presenter.onRestore()
|
presenter.onRestore()
|
||||||
val library = presenter.getAllManga()
|
val library = presenter.getAllManga()
|
||||||
if (library != null) onNextLibraryUpdate(presenter.categories, library)
|
if (library != null) onNextLibraryUpdate(presenter.categories, library)
|
||||||
|
@ -84,6 +84,8 @@ class LibraryPresenter(
|
|||||||
var currentLibrary:Library? = null
|
var currentLibrary:Library? = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun isDownloading() = downloadManager.hasQueue()
|
||||||
|
|
||||||
fun onDestroy() {
|
fun onDestroy() {
|
||||||
if (currentMangaMap != null)
|
if (currentMangaMap != null)
|
||||||
currentLibrary = Library(categories, currentMangaMap!!)
|
currentLibrary = Library(categories, currentMangaMap!!)
|
||||||
|
@ -152,7 +152,8 @@ class SortFilterBottomSheet @JvmOverloads constructor(context: Context, attrs: A
|
|||||||
if (phoneLandscape && shadow2.visibility != View.GONE) {
|
if (phoneLandscape && shadow2.visibility != View.GONE) {
|
||||||
shadow2.gone()
|
shadow2.gone()
|
||||||
}
|
}
|
||||||
sheetBehavior?.peekHeight = peekHeight
|
if (phoneLandscape)
|
||||||
|
sheetBehavior?.peekHeight = 0
|
||||||
top_bar.viewTreeObserver.addOnGlobalLayoutListener {
|
top_bar.viewTreeObserver.addOnGlobalLayoutListener {
|
||||||
val peekingHeight = if (phoneLandscape) 0
|
val peekingHeight = if (phoneLandscape) 0
|
||||||
else if (!title.text.isNullOrBlank()) top_bar.height
|
else if (!title.text.isNullOrBlank()) top_bar.height
|
||||||
@ -204,6 +205,9 @@ class SortFilterBottomSheet @JvmOverloads constructor(context: Context, attrs: A
|
|||||||
this.peekHeight = state.getInt("peek")
|
this.peekHeight = state.getInt("peek")
|
||||||
this.startingTitle = state.getString("title") ?: ""
|
this.startingTitle = state.getString("title") ?: ""
|
||||||
val sheet = BottomSheetBehavior.from(this)
|
val sheet = BottomSheetBehavior.from(this)
|
||||||
|
if (isLandscape() && !isTablet())
|
||||||
|
sheet.peekHeight = 0
|
||||||
|
else
|
||||||
sheet.peekHeight = peekHeight
|
sheet.peekHeight = peekHeight
|
||||||
title.text = startingTitle
|
title.text = startingTitle
|
||||||
super.onRestoreInstanceState( state.getParcelable("superState"))
|
super.onRestoreInstanceState( state.getParcelable("superState"))
|
||||||
|
@ -212,6 +212,17 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/pill"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:src="@drawable/draggable_pill"
|
||||||
|
android:alpha="0.15"
|
||||||
|
android:contentDescription="@string/drag_handle"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/title_icon"
|
android:id="@+id/title_icon"
|
||||||
@ -219,6 +230,7 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
android:src="@drawable/ic_sort_white_24dp"
|
android:src="@drawable/ic_sort_white_24dp"
|
||||||
|
android:contentDescription="@string/sorting_mode"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/title"
|
app:layout_constraintBottom_toBottomOf="@+id/title"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/title" />
|
app:layout_constraintTop_toTopOf="@+id/title" />
|
||||||
|
Loading…
Reference in New Issue
Block a user