Skip to content

Commit

Permalink
fix pop transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibarabas committed Aug 28, 2020
1 parent 956bb9f commit 274081c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 274081c

Please sign in to comment.