Revision 7fe59aa5
Added by Leszek Koltunski almost 2 years ago
src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java | ||
---|---|---|
81 | 81 |
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); |
82 | 82 |
|
83 | 83 |
DisplayMetrics displaymetrics = new DisplayMetrics(); |
84 |
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); |
|
84 |
getWindowManager().getDefaultDisplay().getRealMetrics(displaymetrics);
|
|
85 | 85 |
mScreenWidth =displaymetrics.widthPixels; |
86 | 86 |
mScreenHeight=displaymetrics.heightPixels; |
87 |
mScreenHeight = (int)(1.07f*mScreenHeight); // add 7% for the upper bar |
|
88 |
// which is not yet hidden. |
|
89 |
// TODO: figure this out exactly. |
|
87 |
|
|
90 | 88 |
hideNavigationBar(); |
91 | 89 |
cutoutHack(); |
92 | 90 |
computeHeights(); |
... | ... | |
101 | 99 |
int butHeight = (int)(mScreenHeight*RATIO_BUT); |
102 | 100 |
int viewHeight = (int)(mScreenHeight*RATIO_SCROLL); |
103 | 101 |
int objectHeight = (int)(mScreenHeight*(1-RATIO_SCROLL+RATIO_BAR)); |
104 |
int padding = (int)(mScreenHeight* RubikActivity.PADDING);
|
|
102 |
int padding = (int)(mScreenHeight*RubikActivity.PADDING); |
|
105 | 103 |
|
106 | 104 |
LinearLayout botLayout = findViewById(R.id.lowerBar); |
107 | 105 |
ViewGroup.LayoutParams paramsL = botLayout.getLayoutParams(); |
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.