|
29 | 29 | import android.app.AlertDialog;
|
30 | 30 | import android.content.Context;
|
31 | 31 | import android.content.Intent;
|
| 32 | +import android.graphics.Point; |
32 | 33 | import android.net.Uri;
|
33 | 34 | import android.os.Bundle;
|
34 | 35 | import android.view.View;
|
@@ -164,8 +165,17 @@ private void setCommandIndexAndCommand (int itemIndex) {
|
164 | 165 | */
|
165 | 166 | private void setRemoteWidthAndHeight () {
|
166 | 167 |
|
167 |
| - nativeWidth = Math.max(mainConfigDialog.getWidth(), mainConfigDialog.getHeight()); |
168 |
| - nativeHeight = Math.min(mainConfigDialog.getWidth(), mainConfigDialog.getHeight()); |
| 168 | + // Android devices with SDK newer than KITKAT use immersive mode and therefore |
| 169 | + // we get the resolution of the whole display. |
| 170 | + if (Constants.SDK_INT < android.os.Build.VERSION_CODES.KITKAT) { |
| 171 | + nativeWidth = Math.max(mainConfigDialog.getWidth(), mainConfigDialog.getHeight()); |
| 172 | + nativeHeight = Math.min(mainConfigDialog.getWidth(), mainConfigDialog.getHeight()); |
| 173 | + } else { |
| 174 | + Point dS = new Point(); |
| 175 | + mainConfigDialog.getWindowManager().getDefaultDisplay().getRealSize(dS); |
| 176 | + nativeWidth = Math.max(dS.x, dS.y); |
| 177 | + nativeHeight = Math.min(dS.x, dS.y); |
| 178 | + } |
169 | 179 |
|
170 | 180 | spinnerAutoXGeometry.setSelection(selected.getAutoXResType());
|
171 | 181 | if (selected.getAutoXResType() == Constants.AUTOX_GEOM_SELECT_NATIVE) {
|
|
0 commit comments