Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOB-9111] - Inbox overlap on Android 35 #842

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

instrumentation-tests:
name: Instrumentation tests
runs-on: macos-12
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
java-version: 17

- run: touch local.properties

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.iterable.iterableapi.ui.inbox;

import android.content.Intent;
import android.graphics.Insets;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -184,6 +187,33 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
return relativeLayout;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// Use ViewCompat to handle insets dynamically
ViewCompat.setOnApplyWindowInsetsListener(view, (v, insets) -> {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// For API 30 and above: Use WindowInsetsCompat to handle insets
Insets systemBarsInsets = insets.getSystemGestureInsets().toPlatformInsets();
v.setPadding(
0,
systemBarsInsets.top, // Padding for status bar and cutout
0,
systemBarsInsets.bottom // Padding for navigation bar
);
} else {
// For older Android versions: Use legacy methods
v.setPadding(
0,
insets.getSystemWindowInsetTop(), // Padding for status bar and cutout
0,
insets.getSystemWindowInsetBottom() // Padding for navigation bar
);
}
return insets;
});
}

@Override
public void onResume() {
super.onResume();
Expand Down
Loading