diff options
| author | JosJuice <josjuice@gmail.com> | 2023-02-18 15:42:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-18 15:42:46 +0100 |
| commit | e65167f9cd946cfacd1d6bfc86582e84e811518a (patch) | |
| tree | 071b218c0ca2d00c7dd59ea01e2c0176d189fae5 /Source/Android/app/src/main/java | |
| parent | 8db35e6d04f7a95fccdd8cfafb654dd32a409474 (diff) | |
| parent | 12b8b44a081d610499702640db0332b2aaa94069 (diff) | |
Merge pull request #11521 from t895/adjust-grid-options
Android: Simplify the grid options dialog fragment
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 - } - } } } |
