Project

General

Profile

« Previous | Next » 

Revision 51853bf2

Added by Leszek Koltunski almost 3 years ago

Improve initial detection of screenHeight.

View differences:

src/main/java/org/distorted/main/RubikActivity.java
115 115

  
116 116
      mJustStarted = true;
117 117
      mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
118
      mIsChinese = localeIsChinese();
118 119

  
119 120
      DisplayMetrics displaymetrics = new DisplayMetrics();
120 121
      getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
121 122
      mScreenWidth =displaymetrics.widthPixels;
122 123
      mScreenHeight=displaymetrics.heightPixels;
123

  
124
      mIsChinese = localeIsChinese();
125

  
124
      mScreenHeight = (int)(1.07f*mScreenHeight); // add 7% for the upper bar
125
                                                  // which is not yet hidden.
126
                                                  // TODO: figure this out exactly.
126 127
      hideNavigationBar();
127 128
      cutoutHack();
128 129
      computeBarHeights();
......
242 243
      RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
243 244
      view.onResume();
244 245
      restorePreferences();
246

  
245 247
      ScreenList.setScreen(this);
246 248
      unblockEverything();
247 249

  
......
256 258
      RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
257 259
      ObjectType object = play.getObject();
258 260
      changeIfDifferent(object,view.getObjectControl());
259
      
261

  
260 262
      if( mIsChinese && !mPolicyAccepted ) PrivacyPolicy();
261 263
      }
262 264
    

Also available in: Unified diff