diff --git a/bottomsheet/src/main/java/com/flipboard/bottomsheet/BottomSheetLayout.java b/bottomsheet/src/main/java/com/flipboard/bottomsheet/BottomSheetLayout.java index 24b83bee41..40ed6d6b0a 100644 --- a/bottomsheet/src/main/java/com/flipboard/bottomsheet/BottomSheetLayout.java +++ b/bottomsheet/src/main/java/com/flipboard/bottomsheet/BottomSheetLayout.java @@ -146,6 +146,7 @@ private void init() { dimView = new View(getContext()); dimView.setBackgroundColor(Color.BLACK); dimView.setAlpha(0); + dimView.setVisibility(INVISIBLE); peek = 0;//getHeight() return 0 at start! @@ -240,7 +241,11 @@ private void setSheetTranslation(float sheetTranslation) { this.contentClipRect.set(0, 0, getWidth(), bottomClip); getSheetView().setTranslationY(getHeight() - sheetTranslation); transformView(sheetTranslation); - dimView.setAlpha(shouldDimContentView ? getDimAlpha(sheetTranslation) : 0); + if (shouldDimContentView) { + float dimAlpha = getDimAlpha(sheetTranslation); + dimView.setAlpha(dimAlpha); + dimView.setVisibility(dimAlpha > 0 ? VISIBLE : INVISIBLE); + } } private void transformView(float sheetTranslation) { @@ -479,6 +484,7 @@ private void initializeSheetValues() { this.contentClipRect.set(0, 0, getWidth(), getHeight()); getSheetView().setTranslationY(getHeight()); dimView.setAlpha(0); + dimView.setVisibility(INVISIBLE); } /**