diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java b/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java index b27285e04e..97fd88e67a 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java +++ b/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java @@ -163,7 +163,7 @@ public View onCreateView(LayoutInflater inflater, CoordinatorLayout view = new NotifyingCoordinatorLayout(getContext(), this); CoordinatorLayout.LayoutParams params = new CoordinatorLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); - params.setBehavior(new AppBarLayout.ScrollingViewBehavior()); + params.setBehavior(mIsTranslucent ? null : new AppBarLayout.ScrollingViewBehavior()); mScreenView.setLayoutParams(params); view.addView(recycleView(mScreenView)); diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java b/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java index ade23d2659..56ffaf2c4c 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java +++ b/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java @@ -92,6 +92,7 @@ public ScreenStackHeaderConfig(Context context) { if (context.getTheme().resolveAttribute(android.R.attr.colorPrimary, tv, true)) { mToolbar.setBackgroundColor(tv.data); } + mToolbar.setClipChildren(false); } @Override @@ -382,6 +383,10 @@ public void setHidden(boolean hidden) { mIsHidden = hidden; } + public void setTranslucent(boolean translucent) { + mIsTranslucent = translucent; + } + public void setBackButtonInCustomView(boolean backButtonInCustomView) { mBackButtonInCustomView = backButtonInCustomView; } public void setDirection(String direction) { diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.java b/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.java index 330a60ed8c..00f7cc31b7 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.java +++ b/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.java @@ -119,6 +119,11 @@ public void setHidden(ScreenStackHeaderConfig config, boolean hidden) { config.setHidden(hidden); } + @ReactProp(name = "translucent") + public void setTranslucent(ScreenStackHeaderConfig config, boolean translucent) { + config.setTranslucent(translucent); + } + @ReactProp(name = "backButtonInCustomView") public void setBackButtonInCustomView(ScreenStackHeaderConfig config, boolean backButtonInCustomView) { config.setBackButtonInCustomView(backButtonInCustomView);