Revision 7fe59aa5
Added by Leszek Koltunski almost 2 years ago
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
126 | 126 |
mIsChinese = localeIsChinese(); |
127 | 127 |
|
128 | 128 |
DisplayMetrics displaymetrics = new DisplayMetrics(); |
129 |
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); |
|
129 |
getWindowManager().getDefaultDisplay().getRealMetrics(displaymetrics);
|
|
130 | 130 |
mScreenWidth =displaymetrics.widthPixels; |
131 | 131 |
mScreenHeight=displaymetrics.heightPixels; |
132 |
mScreenHeight = (int)(1.07f*mScreenHeight); // add 7% for the upper bar |
|
133 |
// which is not yet hidden. |
|
134 |
// TODO: figure this out exactly. |
|
132 |
|
|
135 | 133 |
hideNavigationBar(); |
136 | 134 |
cutoutHack(); |
137 | 135 |
computeBarHeights(); |
... | ... | |
142 | 140 |
|
143 | 141 |
private void computeBarHeights() |
144 | 142 |
{ |
145 |
float height = mScreenHeight; |
|
146 |
int barHeight = (int)(height*RATIO_BAR); |
|
143 |
int barHeight = (int)(mScreenHeight*RATIO_BAR); |
|
147 | 144 |
mHeightLowerBar = barHeight; |
148 | 145 |
mHeightUpperBar = barHeight; |
149 | 146 |
|
... | ... | |
421 | 418 |
errDiag.show(getSupportFragmentManager(), null); |
422 | 419 |
} |
423 | 420 |
|
424 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
425 |
|
|
426 |
void setScreenSize(int width, int height) |
|
427 |
{ |
|
428 |
mScreenWidth = width; |
|
429 |
mScreenHeight= height; |
|
430 |
} |
|
431 |
|
|
432 | 421 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
433 | 422 |
// PUBLIC API |
434 | 423 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Correctly get the whole size fo the screen (along with thee top and bottom system bars) from the very beginning of the Activity.