diff options
Diffstat (limited to 'Source/Android/app/src/main/java')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/GridOptionDialogFragment.kt | 28 |
1 files changed, 7 insertions, 21 deletions
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>(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<View>(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<View>(mBindingTv.gridSheet).state = - BottomSheetBehavior.STATE_EXPANDED - dialog?.setOnShowListener { - val dialog = it as BottomSheetDialog - mBindingTv.gridSheet.let { sheet -> - dialog.behavior.peekHeight = sheet.height - } - } } } |
