Open hirosz opened 7 years ago
This might be related. I found a bug in the below code snippet.
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
private void init21(Context context) {
if (showShadow) {
shadowElevation = getElevation();
shadowElevation = shadowElevation > 0
? shadowElevation
: getResources().getDimensionPixelSize(R.dimen.bb_default_elevation);
setElevation(MiscUtils.dpToPixel(context, shadowElevation));
setOutlineProvider(ViewOutlineProvider.BOUNDS);
}
}
If getResources().getDimensionPixelSize(R.dimen.bb_default_elevation)
is retrieved it is automatically resolved in pixels. But in setElevation(MiscUtils.dpToPixel(context, shadowElevation));
it the DP to PX convertion is applied a second time, which in most cases leads to a too high value.
My observation on Lollipop+ devices however is, that I cannot see any elevation shadow or just a tiny one. The shadow used to be much more significant in version 1.3.4.
Elevation is always on for BottomBar. I do workaround by wrapping BottomBar with LinearLayout with elevation (background need to be set) and setting app:bb_showShadow="false".
Elevation attribute doesn't work