From c4ab08feba125e526880af78fb9dc4f3bfde01bc Mon Sep 17 00:00:00 2001 From: Darshan Pania Date: Sat, 25 May 2019 02:13:13 +0530 Subject: [PATCH] hiding status bar only on landscape orientation --- .../clevertap/android/sdk/InAppNotificationActivity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/InAppNotificationActivity.java b/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/InAppNotificationActivity.java index daf876c17..3de99b002 100644 --- a/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/InAppNotificationActivity.java +++ b/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/InAppNotificationActivity.java @@ -54,7 +54,10 @@ private String getFragmentTag() { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); + int orientation = this.getResources().getConfiguration().orientation; + if(orientation == Configuration.ORIENTATION_LANDSCAPE) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); + } try { Bundle notif = getIntent().getExtras(); if (notif == null) throw new IllegalArgumentException(); @@ -72,7 +75,7 @@ public void onCreate(Bundle savedInstanceState) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } catch (Throwable t) { Logger.d("Error displaying InAppNotification", t); - int orientation = this.getResources().getConfiguration().orientation; + if (orientation == Configuration.ORIENTATION_LANDSCAPE) { Logger.d("App in Landscape, dismissing portrait InApp Notification"); finish(); @@ -89,7 +92,6 @@ public void onCreate(Bundle savedInstanceState) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } catch (Throwable t) { Logger.d("Error displaying InAppNotification", t); - int orientation = this.getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_PORTRAIT) { Logger.d("App in Portrait, dismissing landscape InApp Notification"); finish();