Skip to content
Snippets Groups Projects
Commit b5777a39 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Disable dragging on bottom sheets on ChromeOS

parent d7f9e28e
No related branches found
No related tags found
1 merge request!1991Multiple ChromeOS improvements
package org.videolan.vlc.gui.dialogs
import android.app.Dialog
import android.content.DialogInterface
import android.content.res.Configuration
import android.os.Bundle
......@@ -14,6 +15,7 @@ import androidx.annotation.LayoutRes
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.lifecycleScope
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
......@@ -93,6 +95,17 @@ abstract class VLCBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val bottomSheetDialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
if (AndroidDevices.isChromeBook) bottomSheetDialog.setOnShowListener {
bottomSheetDialog.findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)
?.let { bottomSheet ->
BottomSheetBehavior.from(bottomSheet).isDraggable = false
}
}
return bottomSheetDialog
}
private fun simulateKeyPress(key: Int) {
view?.let {
val inputConnection = BaseInputConnection(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment