mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 12:38:33 +00:00
Fix Video call screen bottom sheet weird animation and height.
This commit is contained in:
@@ -27,6 +27,7 @@ import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.constraintlayout.widget.Guideline
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.transition.AutoTransition
|
||||
import androidx.transition.TransitionManager
|
||||
import androidx.transition.TransitionSet
|
||||
@@ -108,6 +109,7 @@ class ControlsAndInfoController private constructor(
|
||||
private val raiseHandComposeView: ComposeView = webRtcCallView.findViewById(R.id.call_screen_raise_hand_view)
|
||||
private val aboveControlsGuideline: Guideline = webRtcCallView.findViewById(R.id.call_screen_above_controls_guideline)
|
||||
private val toggleCameraDirectionView: View = webRtcCallView.findViewById(R.id.call_screen_camera_direction_toggle)
|
||||
private val startCallControls: View = webRtcCallView.findViewById(R.id.call_screen_start_call_controls)
|
||||
private val callControls: ConstraintLayout = webRtcCallView.findViewById(R.id.call_controls_constraint_layout)
|
||||
private val isLandscape = activity.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
|
||||
private val waitingToBeLetInProgressDrawable = IndeterminateDrawable.createCircularDrawable(
|
||||
@@ -160,7 +162,11 @@ class ControlsAndInfoController private constructor(
|
||||
previousCallControlHeightData = HeightData(callControls.height, coordinator.height)
|
||||
|
||||
val controlPeakHeight = callControls.height + callControls.y.toInt() + 16.dp
|
||||
if (startCallControls.isVisible) {
|
||||
behavior.peekHeight = max(behavior.peekHeight, controlPeakHeight)
|
||||
} else {
|
||||
behavior.peekHeight = controlPeakHeight
|
||||
}
|
||||
frame.minimumHeight = coordinator.height / minFrameHeightDenominator
|
||||
behavior.maxHeight = (coordinator.height.toFloat() * maxBehaviorHeightPercentage).toInt()
|
||||
|
||||
@@ -199,7 +205,6 @@ class ControlsAndInfoController private constructor(
|
||||
|
||||
behavior.isHideable = true
|
||||
behavior.peekHeight = 0
|
||||
behavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
BottomSheetBehaviorHack.setNestedScrollingChild(behavior, callInfoComposeView)
|
||||
|
||||
behavior.addBottomSheetCallback(object : BottomSheetCallback() {
|
||||
|
||||
@@ -148,8 +148,7 @@
|
||||
android:id="@+id/call_controls_constraint_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="38dp"
|
||||
android:paddingBottom="48dp">
|
||||
android:layout_marginTop="38dp">
|
||||
|
||||
<org.thoughtcrime.securesms.components.webrtc.WebRtcAudioOutputToggleButton
|
||||
android:id="@+id/call_screen_speaker_toggle"
|
||||
|
||||
Reference in New Issue
Block a user