BoomMenu
BoomMenu copied to clipboard
Buttons are not scaled?
I'm testing HAM buttons on several devices (emulators and real devices) and I noticed that the buttons are not scaled (?!?) depending from the used device. So, for example, on ACER Z130 (320x480) they go outside of the screen, and on Nexus 10 tablet they are very very very small... My question is: are the buttons scaled and I'm doing something wrong or the buttons are not scaled at all by default?
Thanks Rob
This code is a sample to show you how I create the HAM buttons:
`
rightBmb.addBuilder(new HamButton.Builder()
// Commons
.buttonHeight(Util.dp2px(btnHeight))
.buttonWidth(Util.dp2px(btnWidth))
.textSize(textSize)
.subTextSize(subTextSize)
.textGravity(Gravity.TOP)
.subTextGravity(Gravity.TOP)
.textRect(new Rect(Util.dp2px(textRectLeft), Util.dp2px(textRectTop), Util.dp2px(textRectRight), Util.dp2px(textRectBottom)))
.subTextRect(new Rect(Util.dp2px(subtextRectLeft), Util.dp2px(subtextRectTop), Util.dp2px(subtextRectRight), Util.dp2px(subtextRectBottom)))
.imageRect(new Rect(Util.dp2px(imgRectLeft), Util.dp2px(imgRectTop), Util.dp2px(imgRectRight), Util.dp2px(imgRectBottom)))
.shadowEffect(true)
.shadowOffsetX(shadowOffsetX)
.shadowOffsetY(shadowOffsetY)
.shadowRadius(Util.dp2px(shadowRadius))
.shadowCornerRadius(Util.dp2px(shadowCornerRadius))
//.shadowColor(Color.parseColor("#80DF1048")) // AARRGGBB
.shadowColor(tRed)
// end Commons
.normalImageRes(R.mipmap.icon_wizard)
.normalTextRes(R.string.textWizard)
.subNormalTextRes(R.string.subWizard)
.pieceColor(Color.WHITE)
.normalColorRes(R.color.colorPrimary)
.highlightedColorRes(R.color.colorAccent)
.unableColorRes(R.color.dark_text)
.normalTextColor(Color.WHITE)
.subNormalTextColor(Color.WHITE)
.listener((new OnBMClickListener() {
@Override
public void onBoomButtonClick(int index) {
launchWizardActivity();
}
})));`
Maybe I missed something?
Also the shadow color is still not working (always gray)...
Can you help me? Ciao Rob