From dfcffb48126769a45fa1be229557ba95e48c8248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AA=E3=82=B9?= Date: Tue, 12 Jul 2022 21:17:49 +0900 Subject: [PATCH] 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));