mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
hide commit dialog when drag player
This commit is contained in:
parent
bf2c927961
commit
b7a3f56743
@ -7,6 +7,7 @@ import android.widget.FrameLayout
|
|||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import com.google.android.material.R
|
import com.google.android.material.R
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetBehavior.PEEK_HEIGHT_AUTO
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||||
|
|
||||||
@ -30,13 +31,15 @@ open class ExpandedBottomSheet : BottomSheetDialogFragment() {
|
|||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun expand(half: Boolean = false) {
|
fun expand(collapse: Boolean = false) {
|
||||||
bottomSheet?.let { fl ->
|
bottomSheet?.let { fl ->
|
||||||
val bottomSheetInfoBehavior = BottomSheetBehavior.from(fl)
|
val bottomSheetInfoBehavior = BottomSheetBehavior.from(fl)
|
||||||
bottomSheetInfoBehavior.state = if (half) {
|
if (collapse) {
|
||||||
BottomSheetBehavior.STATE_HALF_EXPANDED
|
bottomSheetInfoBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
|
bottomSheetInfoBehavior.setPeekHeight(0, true)
|
||||||
} else {
|
} else {
|
||||||
BottomSheetBehavior.STATE_EXPANDED
|
bottomSheetInfoBehavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||||
|
bottomSheetInfoBehavior.setPeekHeight(PEEK_HEIGHT_AUTO, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user