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

Commit 7dd57436 authored by wangqi's avatar wangqi Committed by Copybara-Service
Browse files

Fix but that avatar overlapping with status bar.

This happens when outgoing video call is accepted as voice call or switching
between video call and voice call.

Bug: 71590134
Test: manual
PiperOrigin-RevId: 189206585
Change-Id: I564c261614990b9b6baab6025f1625f42058ba70
parent e9e0335d
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -31,8 +31,10 @@ import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.telecom.CallAudioState;
import android.telephony.TelephonyManager;
import android.transition.TransitionManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnAttachStateChangeListener;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
@@ -182,6 +184,24 @@ public class InCallFragment extends Fragment
    View space = view.findViewById(R.id.navigation_bar_background);
    space.getLayoutParams().height = ViewUtil.getNavigationBarHeight(getContext());

    // Workaround to adjust padding for status bar and navigation bar since fitsSystemWindows
    // doesn't work well when switching with other fragments.
    view.addOnAttachStateChangeListener(
        new OnAttachStateChangeListener() {
          @Override
          public void onViewAttachedToWindow(View v) {
            View container = v.findViewById(R.id.incall_ui_container);
            int topInset = v.getRootWindowInsets().getSystemWindowInsetTop();
            int bottomInset = v.getRootWindowInsets().getSystemWindowInsetBottom();
            if (topInset != container.getPaddingTop()) {
              TransitionManager.beginDelayedTransition(((ViewGroup) container.getParent()));
              container.setPadding(0, topInset, 0, bottomInset);
            }
          }

          @Override
          public void onViewDetachedFromWindow(View v) {}
        });
    return view;
  }

+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    android:layout_height="match_parent">

  <RelativeLayout
      android:id="@+id/incall_ui_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:clipChildren="false"