diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/GridOptionDialogFragment.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/GridOptionDialogFragment.kt index 94dda3f579..5743f6ebc9 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/GridOptionDialogFragment.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/GridOptionDialogFragment.kt @@ -9,7 +9,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting import android.widget.CompoundButton import androidx.appcompat.app.AppCompatActivity -import com.google.android.material.bottomsheet.BottomSheetDialog +import org.dolphinemu.dolphinemu.R import org.dolphinemu.dolphinemu.databinding.FragmentGridOptionsBinding import org.dolphinemu.dolphinemu.databinding.FragmentGridOptionsTvBinding import org.dolphinemu.dolphinemu.features.settings.model.NativeConfig @@ -43,31 +43,17 @@ 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.parent as View).state = + BottomSheetBehavior.STATE_EXPANDED + } + if (activity is AppCompatActivity) { setUpCoverButtons() setUpTitleButtons() - - // Pins fragment to the top of the dialog ensures the dialog is expanded in landscape by default - BottomSheetBehavior.from(mBindingMobile.gridSheet).state = - BottomSheetBehavior.STATE_EXPANDED - dialog?.setOnShowListener { - val dialog = it as BottomSheetDialog - mBindingMobile.gridSheet.let { sheet -> - dialog.behavior.peekHeight = sheet.height - } - } } else { setUpCoverButtonsTv() - - // Pins fragment to the top of the dialog ensures the dialog is expanded in landscape by default - BottomSheetBehavior.from(mBindingTv.gridSheet).state = - BottomSheetBehavior.STATE_EXPANDED - dialog?.setOnShowListener { - val dialog = it as BottomSheetDialog - mBindingTv.gridSheet.let { sheet -> - dialog.behavior.peekHeight = sheet.height - } - } } } diff --git a/Source/Android/app/src/main/res/layout/fragment_grid_options.xml b/Source/Android/app/src/main/res/layout/fragment_grid_options.xml index cbdeb453b3..8c9878298f 100644 --- a/Source/Android/app/src/main/res/layout/fragment_grid_options.xml +++ b/Source/Android/app/src/main/res/layout/fragment_grid_options.xml @@ -10,8 +10,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingBottom="@dimen/spacing_xtralarge" - app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> + android:paddingBottom="@dimen/spacing_xtralarge"> + android:layout_height="wrap_content" + android:background="@color/dolphin_surface"> + android:orientation="vertical">