This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git


The following commit(s) were added to refs/heads/master by this push:
     new dfcffb4  fix(android): increase toolbar to 48dp (#946)
dfcffb4 is described below

commit dfcffb48126769a45fa1be229557ba95e48c8248
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Tue Jul 12 21:17:49 2022 +0900

    fix(android): increase toolbar to 48dp (#946)
    
    Material Design Guidelines says "For most platforms, consider making touch 
targets at least 48 x 48dp."
---
 src/android/InAppBrowser.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index 9a9fc7a..76dc150 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -117,6 +117,8 @@ public class InAppBrowser extends CordovaPlugin {
     private static final String BEFORELOAD = "beforeload";
     private static final String FULLSCREEN = "fullscreen";
 
+    private static final int TOOLBAR_HEIGHT = 48;
+
     private static final List customizableOptions = 
Arrays.asList(CLOSE_BUTTON_CAPTION, TOOLBAR_COLOR, NAVIGATION_COLOR, 
CLOSE_BUTTON_COLOR, FOOTER_COLOR);
 
     private InAppBrowserDialog dialog;
@@ -799,7 +801,7 @@ public class InAppBrowser extends CordovaPlugin {
                 RelativeLayout toolbar = new 
RelativeLayout(cordova.getActivity());
                 //Please, no more black!
                 toolbar.setBackgroundColor(toolbarColor);
-                toolbar.setLayoutParams(new 
RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, this.dpToPixels(44)));
+                toolbar.setLayoutParams(new 
RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, 
this.dpToPixels(TOOLBAR_HEIGHT)));
                 toolbar.setPadding(this.dpToPixels(2), this.dpToPixels(2), 
this.dpToPixels(2), this.dpToPixels(2));
                 if (leftToRight) {
                     toolbar.setHorizontalGravity(Gravity.LEFT);
@@ -901,7 +903,7 @@ public class InAppBrowser extends CordovaPlugin {
                     _footerColor = android.graphics.Color.LTGRAY;
                 }
                 footer.setBackgroundColor(_footerColor);
-                RelativeLayout.LayoutParams footerLayout = new 
RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, this.dpToPixels(44));
+                RelativeLayout.LayoutParams footerLayout = new 
RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, 
this.dpToPixels(TOOLBAR_HEIGHT));
                 footerLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, 
RelativeLayout.TRUE);
                 footer.setLayoutParams(footerLayout);
                 if (closeButtonCaption != "") 
footer.setPadding(this.dpToPixels(8), this.dpToPixels(8), this.dpToPixels(8), 
this.dpToPixels(8));


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

Reply via email to