You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/02/15 15:32:57 UTC

[GitHub] elrafael commented on issue #409: Resize the IAB

elrafael commented on issue #409: Resize the IAB
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/409#issuecomment-464092007
 
 
   Open the file `InAppBrowser.java` and search for this code
   
   ```java
   WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
   lp.copyFrom(dialog.getWindow().getAttributes());
   lp.width = WindowManager.LayoutParams.MATCH_PARENT;
   lp.height = WindowManager.LayoutParams.MATCH_PARENT;
   ```
   
   It's near line 958
   you'll need to change the lp.height attribute to something like this
   ```java
   // lp.height = WindowManager.LayoutParams.MATCH_PARENT;
   DisplayMetrics displayMetrics = new DisplayMetrics();
   cordova.getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
   int displayWidth = displayMetrics.widthPixels;
   int displayHeight = displayMetrics.heightPixels - 200;
   lp.height = displayHeight;
   ```
   
   Import the Display Metrics on top of that file
   ```java
   import android.util.DisplayMetrics;
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org