diff --git a/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java b/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java index 6c89d443..30d0838d 100644 --- a/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java +++ b/library/src/main/java/uk/co/deanwild/materialshowcaseview/MaterialShowcaseView.java @@ -62,6 +62,7 @@ public class MaterialShowcaseView extends FrameLayout implements View.OnTouchLis private int mContentTopMargin; private boolean mDismissOnTouch = false; private boolean mShouldRender = false; // flag to decide when we should actually render + private boolean mRenderOverNav = false; private int mMaskColour; private AnimationFactory mAnimationFactory; private boolean mShouldAnimate = true; @@ -269,7 +270,7 @@ public void setTarget(Target target) { /** * If we're on lollipop then make sure we don't draw over the nav bar */ - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (!mRenderOverNav && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mBottomMargin = getSoftButtonsBarSizePort((Activity) getContext()); FrameLayout.LayoutParams contentLP = (LayoutParams) getLayoutParams(); @@ -457,6 +458,7 @@ public void setConfig(ShowcaseConfig config) { setMaskColour(config.getMaskColor()); setShape(config.getShape()); setShapePadding(config.getShapePadding()); + setRenderOverNavigationBar(config.getRenderOverNavigationBar()); } private void updateDismissButton() { @@ -653,6 +655,12 @@ public Builder withRectangleShape(boolean fullWidth) { return this; } + public Builder renderOverNavigationBar() { + // Note: This only has an effect in Lollipop or above. + showcaseView.setRenderOverNavigationBar(true); + return this; + } + public MaterialShowcaseView build() { if (showcaseView.mShape == null) { switch (shapeType) { @@ -836,4 +844,7 @@ public static int getSoftButtonsBarSizePort(Activity activity) { return 0; } + private void setRenderOverNavigationBar(boolean mRenderOverNav) { + this.mRenderOverNav = mRenderOverNav; + } } diff --git a/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseConfig.java b/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseConfig.java index 32d6ecbf..fb814612 100644 --- a/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseConfig.java +++ b/library/src/main/java/uk/co/deanwild/materialshowcaseview/ShowcaseConfig.java @@ -21,6 +21,7 @@ public class ShowcaseConfig { private long mFadeDuration = DEFAULT_FADE_TIME; private Shape mShape = DEFAULT_SHAPE; private int mShapePadding = DEFAULT_SHAPE_PADDING; + private boolean renderOverNav = false; public ShowcaseConfig() { mMaskColour = Color.parseColor(ShowcaseConfig.DEFAULT_MASK_COLOUR); @@ -83,4 +84,12 @@ public void setShapePadding(int padding) { public int getShapePadding() { return mShapePadding; } + + public boolean getRenderOverNavigationBar() { + return renderOverNav; + } + + public void setRenderOverNavigationBar(boolean renderOverNav) { + this.renderOverNav = renderOverNav; + } }