Skip to content

Commit

Permalink
hiding status bar only on landscape orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanclevertap committed May 24, 2019
1 parent b4fce58 commit c4ab08f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit c4ab08f

Please sign in to comment.