Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8f6a6c1 authored by Garik Badalyan's avatar Garik Badalyan Committed by Linux Build Service Account
Browse files

IMS-VT: Fix UI stuck in full screen issue.

Sometimes InCallUi gets stuck in the full
screen mode which hides all call control
buttons. This happens since framework
doesn't call onPreDrawListener listener.
To fix the issue we explicitly call
onPreDrawListener callback.

Change-Id: I0fd40236a5af42774da8a453262869464fcb8e81
CRs-Fixed: 1025073
parent 5baddd16
Loading
Loading
Loading
Loading
+60 −54
Original line number Diff line number Diff line
@@ -422,6 +422,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
        // Determine how much space there is below or to the side of the call card.
        final float spaceBesideCallCard = getSpaceBesideCallCard();

        doActionOnPredraw(visible, isLayoutRtl, videoView, spaceBesideCallCard);

        // We need to translate the video surface, but we need to know its position after the layout
        // has occurred so use a {@code ViewTreeObserver}.
        final ViewTreeObserver observer = getView().getViewTreeObserver();
@@ -431,6 +433,14 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
                // We don't want to continue getting called.
                getView().getViewTreeObserver().removeOnPreDrawListener(this);

                doActionOnPredraw(visible, isLayoutRtl, videoView, spaceBesideCallCard);
                return true;
            }
        });
    }

    private void doActionOnPredraw(final boolean visible, final boolean isLayoutRtl,
         final View videoView, final float spaceBesideCallCard) {
        float videoViewTranslation = 0f;

        // Translate the call card to its pre-animation state.
@@ -488,10 +498,6 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
                    .translationY(visible ? 0 : -mPrimaryCallCardContainer.getHeight())
                    .start();
        }

                return true;
            }
        });
    }

    /**