Skip to content

Commit 2df3346

Browse files
Merge pull request #521 from Countly/2547
feat: 25.4.7
2 parents 6492b00 + 6902030 commit 2df3346

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 25.4.7
2+
* Mitigated an issue where the navigation bar showed an unwanted shadow during content display.
3+
14
## 25.4.6
25
* Improved content error handling and display mechanics.
36
* Updated user properties caching mechanism according to sessions.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ org.gradle.configureondemand=true
2222
android.useAndroidX=true
2323
android.enableJetifier=true
2424
# RELEASE FIELD SECTION
25-
VERSION_NAME=25.4.6
25+
VERSION_NAME=25.4.7
2626
GROUP=ly.count.android
2727
POM_URL=https://github.com/Countly/countly-sdk-android
2828
POM_SCM_URL=https://github.com/Countly/countly-sdk-android

sdk/src/androidTest/java/ly/count/android/sdk/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class TestUtils {
4444
public final static String commonAppKey = "appkey";
4545
public final static String commonDeviceId = "1234";
4646
public final static String SDK_NAME = "java-native-android";
47-
public final static String SDK_VERSION = "25.4.6";
47+
public final static String SDK_VERSION = "25.4.7";
4848
public static final int MAX_THREAD_COUNT_PER_STACK_TRACE = 50;
4949

5050
public static class Activity2 extends Activity {

sdk/src/main/java/ly/count/android/sdk/Countly.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ of this software and associated documentation files (the "Software"), to deal
4747
*/
4848
public class Countly {
4949

50-
private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "25.4.6";
50+
private final String DEFAULT_COUNTLY_SDK_VERSION_STRING = "25.4.7";
5151
/**
5252
* Used as request meta data on every request
5353
*/

sdk/src/main/java/ly/count/android/sdk/ModuleContent.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ private String prepareContentFetchRequest(@NonNull DisplayMetrics displayMetrics
186186

187187
int totalWidthPx = displayMetrics.widthPixels;
188188
int totalHeightPx = displayMetrics.heightPixels;
189-
int totalWidthDp = (int) Math.ceil(totalWidthPx / displayMetrics.density);
190-
int totalHeightDp = (int) Math.ceil(totalHeightPx / displayMetrics.density);
189+
int totalWidthDp = (int) Math.floor(totalWidthPx / displayMetrics.density);
190+
int totalHeightDp = (int) Math.floor(totalHeightPx / displayMetrics.density);
191191
L.d("[ModuleContent] prepareContentFetchRequest, total screen dimensions (px): [" + totalWidthPx + "x" + totalHeightPx + "], (dp): [" + totalWidthDp + "x" + totalHeightDp + "], density: [" + displayMetrics.density + "]");
192192

193193
WebViewDisplayOption displayOption = _cly.config_.webViewDisplayOption;
@@ -198,10 +198,10 @@ private String prepareContentFetchRequest(@NonNull DisplayMetrics displayMetrics
198198
SafeAreaDimensions safeArea = SafeAreaCalculator.calculateSafeAreaDimensions(_cly.context_, L);
199199

200200
// px to dp
201-
portraitWidth = (int) Math.ceil(safeArea.portraitWidth / displayMetrics.density);
202-
portraitHeight = (int) Math.ceil(safeArea.portraitHeight / displayMetrics.density);
203-
landscapeWidth = (int) Math.ceil(safeArea.landscapeWidth / displayMetrics.density);
204-
landscapeHeight = (int) Math.ceil(safeArea.landscapeHeight / displayMetrics.density);
201+
portraitWidth = (int) Math.floor(safeArea.portraitWidth / displayMetrics.density);
202+
portraitHeight = (int) Math.floor(safeArea.portraitHeight / displayMetrics.density);
203+
landscapeWidth = (int) Math.floor(safeArea.landscapeWidth / displayMetrics.density);
204+
landscapeHeight = (int) Math.floor(safeArea.landscapeHeight / displayMetrics.density);
205205

206206
L.d("[ModuleContent] prepareContentFetchRequest, safe area dimensions (px->dp) - Portrait: [" + safeArea.portraitWidth + "x" + safeArea.portraitHeight + " px] -> [" + portraitWidth + "x" + portraitHeight + " dp], topOffset: [" + safeArea.portraitTopOffset + " px]");
207207
L.d("[ModuleContent] prepareContentFetchRequest, safe area dimensions (px->dp) - Landscape: [" + safeArea.landscapeWidth + "x" + safeArea.landscapeHeight + " px] -> [" + landscapeWidth + "x" + landscapeHeight + " dp], topOffset: [" + safeArea.landscapeTopOffset + " px]");

sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ private void hideSystemUI() {
285285
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
286286
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
287287
| View.SYSTEM_UI_FLAG_FULLSCREEN);
288+
289+
getWindow().setNavigationBarColor(Color.TRANSPARENT);
290+
getWindow().setStatusBarColor(Color.TRANSPARENT);
291+
292+
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
293+
294+
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
295+
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
288296
}
289297

290298
private void resizeContentInternal() {

sdk/src/main/java/ly/count/android/sdk/UtilsDevice.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ private static void applyWindowMetrics(@NonNull Context context,
5050

5151
// If not activity, we can't know system UI visibility, so always use physical screen size
5252
if (!usePhysicalScreenSize) {
53-
// Only subtract navigation bar insets when navigation bar is actually visible
54-
if (windowInsets.isVisible(WindowInsets.Type.navigationBars())) {
55-
types |= WindowInsets.Type.navigationBars();
56-
}
57-
58-
if (windowInsets.isVisible(WindowInsets.Type.statusBars())) {
59-
types |= WindowInsets.Type.statusBars();
60-
}
6153

6254
boolean drawUnderCutout;
6355
WindowManager.LayoutParams params = ((Activity) context).getWindow().getAttributes();

0 commit comments

Comments
 (0)