From 5c933b8410897573cb06b34baa54d63e718c1da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAkshay?= <“ayyanchira.akshay@gmail.com”> Date: Mon, 2 Dec 2024 07:30:38 -0800 Subject: [PATCH 1/3] [MOB-9111] - Inbox overlap on Android 35 This fix makes the IterableInboxFragment adjust with window insets allowing full screen apps to take advantage of IterableInboxActivity or IterableInboxFragment. As IterableInboxActivity internally launches IterableFragment, the changes in Fragment is sufficient to make up for cut outs and notches on displays --- .../ui/inbox/IterableInboxFragment.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/inbox/IterableInboxFragment.java b/iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/inbox/IterableInboxFragment.java index 05f1842f1..4a970ebcd 100644 --- a/iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/inbox/IterableInboxFragment.java +++ b/iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/inbox/IterableInboxFragment.java @@ -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; @@ -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(); From b7c7d0741cc8e23bfb9dfbd044ae272162921631 Mon Sep 17 00:00:00 2001 From: Akshay Ayyanchira Date: Wed, 11 Dec 2024 13:41:28 -0800 Subject: [PATCH 2/3] Update build.yml Updating Github action to use MacOS 13 as mac os 12 is deprecated now. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4d46f109..3f2753eec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 From 31b4488cbea8dd1c4e783c24ca7e4779e5725e1a Mon Sep 17 00:00:00 2001 From: Akshay Ayyanchira Date: Wed, 11 Dec 2024 13:51:19 -0800 Subject: [PATCH 3/3] Update build.yml updating java version for instrumentation test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f2753eec..856867044 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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