Skip to content

Commit f54e812

Browse files
authored
Merge pull request #842 from Iterable/MOB-9111-Inbox-Overlaps-OnNotch-Android35
[MOB-9111] - Inbox overlap on Android 35
2 parents 64d89bf + 31b4488 commit f54e812

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
5959
instrumentation-tests:
6060
name: Instrumentation tests
61-
runs-on: macos-12
61+
runs-on: macos-13
6262
steps:
6363
- name: Checkout
6464
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -69,7 +69,7 @@ jobs:
6969
- name: Configure JDK
7070
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
7171
with:
72-
java-version: 11
72+
java-version: 17
7373

7474
- run: touch local.properties
7575

iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/inbox/IterableInboxFragment.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package com.iterable.iterableapi.ui.inbox;
22

33
import android.content.Intent;
4+
import android.graphics.Insets;
5+
import android.os.Build;
46
import android.os.Bundle;
57
import androidx.annotation.LayoutRes;
68
import androidx.annotation.NonNull;
79
import androidx.annotation.Nullable;
10+
import androidx.core.view.ViewCompat;
811
import androidx.fragment.app.Fragment;
912
import androidx.recyclerview.widget.LinearLayoutManager;
1013
import androidx.recyclerview.widget.RecyclerView;
@@ -184,6 +187,33 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
184187
return relativeLayout;
185188
}
186189

190+
@Override
191+
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
192+
super.onViewCreated(view, savedInstanceState);
193+
// Use ViewCompat to handle insets dynamically
194+
ViewCompat.setOnApplyWindowInsetsListener(view, (v, insets) -> {
195+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
196+
// For API 30 and above: Use WindowInsetsCompat to handle insets
197+
Insets systemBarsInsets = insets.getSystemGestureInsets().toPlatformInsets();
198+
v.setPadding(
199+
0,
200+
systemBarsInsets.top, // Padding for status bar and cutout
201+
0,
202+
systemBarsInsets.bottom // Padding for navigation bar
203+
);
204+
} else {
205+
// For older Android versions: Use legacy methods
206+
v.setPadding(
207+
0,
208+
insets.getSystemWindowInsetTop(), // Padding for status bar and cutout
209+
0,
210+
insets.getSystemWindowInsetBottom() // Padding for navigation bar
211+
);
212+
}
213+
return insets;
214+
});
215+
}
216+
187217
@Override
188218
public void onResume() {
189219
super.onResume();

0 commit comments

Comments
 (0)