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

Commit 3d92ae98 authored by wangqi's avatar wangqi Committed by android-build-merger
Browse files

Merge "Fix but that avatar overlapping with status bar."

am: 8012611f

Change-Id: I7abe16b6ae5a0d246f5d1447ac34a4b8ee66ee28
parents ab75ef3d 8012611f
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"