This commit is contained in:
JosJuice 2025-08-10 00:33:49 +08:00 committed by GitHub
commit 0c4b4044db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 13 deletions

View file

@ -46,10 +46,8 @@ class ProfileDialog : BottomSheetDialogFragment() {
binding.profileList.addItemDecoration(divider)
// You can't expand a bottom sheet with a controller/remote/other non-touch devices
val behavior: BottomSheetBehavior<View> = BottomSheetBehavior.from(view.parent as View)
if (!resources.getBoolean(R.bool.hasTouch)) {
behavior.state = BottomSheetBehavior.STATE_EXPANDED
}
BottomSheetBehavior.from<View>(view.parent as View).state =
BottomSheetBehavior.STATE_EXPANDED
}
override fun onDestroyView() {

View file

@ -38,10 +38,8 @@ class AboutDialogFragment : BottomSheetDialogFragment() {
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
if (!resources.getBoolean(R.bool.hasTouch)) {
BottomSheetBehavior.from<View>(view.parent as View).state =
BottomSheetBehavior.STATE_EXPANDED
}
BottomSheetBehavior.from<View>(view.parent as View).state =
BottomSheetBehavior.STATE_EXPANDED
val wark = resources.getString(R.string.wark)
val branch = String.format(

View file

@ -44,11 +44,9 @@ class GridOptionDialogFragment : BottomSheetDialogFragment() {
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// Pins fragment to the top of the dialog ensures the dialog is expanded in landscape by default
if (!resources.getBoolean(R.bool.hasTouch)) {
BottomSheetBehavior.from<View>(view.parent as View).state =
BottomSheetBehavior.STATE_EXPANDED
}
// Ensure the dialog is expanded in landscape by default
BottomSheetBehavior.from<View>(view.parent as View).state =
BottomSheetBehavior.STATE_EXPANDED
if (activity is AppCompatActivity) {
setUpCoverButtons()