Project

General

Profile

« Previous | Next » 

Revision 7fe59aa5

Added by Leszek Koltunski almost 2 years ago

Correctly get the whole size fo the screen (along with thee top and bottom system bars) from the very beginning of the Activity.

View differences:

src/main/java/org/distorted/bandaged/BandagedPlayActivity.java
83 83
      mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
84 84

  
85 85
      DisplayMetrics displaymetrics = new DisplayMetrics();
86
      getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
86
      getWindowManager().getDefaultDisplay().getRealMetrics(displaymetrics);
87 87
      mScreenWidth =displaymetrics.widthPixels;
88 88
      mScreenHeight=displaymetrics.heightPixels;
89
      mScreenHeight = (int)(1.07f*mScreenHeight); // add 7% for the upper bar
90
                                                  // which is not yet hidden.
91
                                                  // TODO: figure this out exactly.
89

  
92 90
      hideNavigationBar();
93 91
      cutoutHack();
94 92
      computeBarHeights();
......
99 97

  
100 98
    private void computeBarHeights()
101 99
      {
102
      float height = mScreenHeight;
103
      int barHeight = (int)(height*RATIO_BAR);
100
      int barHeight = (int)(mScreenHeight*RATIO_BAR);
104 101
      mHeightLowerBar = barHeight;
105 102
      mHeightUpperBar = barHeight;
106 103

  

Also available in: Unified diff