diff options
Diffstat (limited to 'java/com/android')
-rw-r--r-- | java/com/android/incallui/incall/impl/InCallFragment.java | 20 | ||||
-rw-r--r-- | java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index 5f558a4ce..1cada325a 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -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; } diff --git a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml index 2c6ee0d15..7eb924500 100644 --- a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml +++ b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml @@ -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" |