From d9c78e5c3e049b9af3958ae246f1d3d137de1bd8 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 7 Jan 2020 12:00:44 -0500 Subject: [PATCH] Fix toolbar overlap with cutouts in recipient preferences. Fixes #9323 --- .../thoughtcrime/securesms/RecipientPreferenceActivity.java | 5 +++++ app/src/main/res/layout/recipient_preference_activity.xml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/RecipientPreferenceActivity.java b/app/src/main/java/org/thoughtcrime/securesms/RecipientPreferenceActivity.java index 1e16f0d74..cadb851a4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/RecipientPreferenceActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/RecipientPreferenceActivity.java @@ -209,6 +209,11 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); getWindow().setStatusBarColor(Color.TRANSPARENT); + + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.recipient_preference_root), (v, insets) -> { + ViewUtil.setTopMargin(toolbar, insets.getSystemWindowInsetTop()); + return insets; + }); } } diff --git a/app/src/main/res/layout/recipient_preference_activity.xml b/app/src/main/res/layout/recipient_preference_activity.xml index c51914605..81d7e9e1e 100644 --- a/app/src/main/res/layout/recipient_preference_activity.xml +++ b/app/src/main/res/layout/recipient_preference_activity.xml @@ -2,6 +2,7 @@ @@ -47,7 +48,6 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/transparent" - android:layout_marginTop="24dp" android:theme="@style/TextSecure.DarkActionBar.Conversation" app:layout_collapseMode="pin" >