Don't use full-width page sheet on big landscape screens

This commit is contained in:
inorichi 2018-10-09 13:46:27 +02:00
parent f61a8ce51d
commit 7a45cd5b56
3 changed files with 13 additions and 0 deletions

View file

@ -1,6 +1,8 @@
package eu.kanade.tachiyomi.ui.reader package eu.kanade.tachiyomi.ui.reader
import android.os.Bundle
import android.support.design.widget.BottomSheetDialog import android.support.design.widget.BottomSheetDialog
import android.view.ViewGroup
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -28,6 +30,14 @@ class ReaderPageSheet(
save_layout.setOnClickListener { save() } save_layout.setOnClickListener { save() }
} }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val width = context.resources.getDimensionPixelSize(R.dimen.bottom_sheet_width)
if (width > 0) {
window?.setLayout(width, ViewGroup.LayoutParams.MATCH_PARENT)
}
}
/** /**
* Sets the image of this page as the cover of the manga. * Sets the image of this page as the cover of the manga.
*/ */

View file

@ -3,4 +3,6 @@
(such as screen margins) for screens with more than 820dp of available width. This (such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen> <dimen name="activity_horizontal_margin">64dp</dimen>
<dimen name="bottom_sheet_width">480dp</dimen>
</resources> </resources>

View file

@ -25,4 +25,5 @@
<dimen name="navigation_drawer_header_height">158dp</dimen> <dimen name="navigation_drawer_header_height">158dp</dimen>
<dimen name="navigation_drawer_header_margin">16dp</dimen> <dimen name="navigation_drawer_header_margin">16dp</dimen>
<dimen name="bottom_sheet_width">0dp</dimen>
</resources> </resources>