fix(android): increase toolbar to 48dp (#946)
Material Design Guidelines says "For most platforms, consider making touch targets at least 48 x 48dp."
This commit is contained in:
parent
1718efa138
commit
dfcffb4812
@ -117,6 +117,8 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
private static final String BEFORELOAD = "beforeload";
|
private static final String BEFORELOAD = "beforeload";
|
||||||
private static final String FULLSCREEN = "fullscreen";
|
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 static final List customizableOptions = Arrays.asList(CLOSE_BUTTON_CAPTION, TOOLBAR_COLOR, NAVIGATION_COLOR, CLOSE_BUTTON_COLOR, FOOTER_COLOR);
|
||||||
|
|
||||||
private InAppBrowserDialog dialog;
|
private InAppBrowserDialog dialog;
|
||||||
@ -799,7 +801,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
RelativeLayout toolbar = new RelativeLayout(cordova.getActivity());
|
RelativeLayout toolbar = new RelativeLayout(cordova.getActivity());
|
||||||
//Please, no more black!
|
//Please, no more black!
|
||||||
toolbar.setBackgroundColor(toolbarColor);
|
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));
|
toolbar.setPadding(this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2));
|
||||||
if (leftToRight) {
|
if (leftToRight) {
|
||||||
toolbar.setHorizontalGravity(Gravity.LEFT);
|
toolbar.setHorizontalGravity(Gravity.LEFT);
|
||||||
@ -901,7 +903,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
_footerColor = android.graphics.Color.LTGRAY;
|
_footerColor = android.graphics.Color.LTGRAY;
|
||||||
}
|
}
|
||||||
footer.setBackgroundColor(_footerColor);
|
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);
|
footerLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
|
||||||
footer.setLayoutParams(footerLayout);
|
footer.setLayoutParams(footerLayout);
|
||||||
if (closeButtonCaption != "") footer.setPadding(this.dpToPixels(8), this.dpToPixels(8), this.dpToPixels(8), this.dpToPixels(8));
|
if (closeButtonCaption != "") footer.setPadding(this.dpToPixels(8), this.dpToPixels(8), this.dpToPixels(8), this.dpToPixels(8));
|
||||||
|
Loading…
Reference in New Issue
Block a user