kanytu / android-material-drawer-template

An Android template with navigation drawer for material design
Apache License 2.0
674 stars 217 forks source link

How to make Toolbar transparent? #9

Closed gblancogarcia closed 9 years ago

gblancogarcia commented 9 years ago

Hey @kanytu, Nice work :+1:. I wonder if it could be possible to make the toolbar transparent. Do you have any ideas? Thanks in advance. Cheers,

kanytu commented 9 years ago

You can chance the toolbar background to a transparent one. Like #00000000.

gblancogarcia commented 9 years ago

Thank you very much for your quick answer. I have already tried it but it is not working. I have also added this code:

<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
kanytu commented 9 years ago

Check my other repo for some code to make the toolbar transparent. https://github.com/kanytu/android-parallax-recyclerview. Check the readme

gblancogarcia commented 9 years ago

Do you mean this code?

@Override
public void onParallaxScroll(float percentage, float offset, View parallax) {
  Drawable c = mToolbar.getBackground();
  c.setAlpha(Math.round(percentage * 255));
  mToolbar.setBackground(c);
}

This is a cool effect but I am trying to make Toolbar always transparent. My problem is that the content is not below the Toolbar. I have tried to change the layout and place the content layout below the Toolbar but it is not working.

kanytu commented 9 years ago

My problem is that the content is not below the Toolbar

How is that a problem? I don't see how that could be a problem. If the toolbar have a transparent background that would not a problem.

I have tried to change the layout and place the content layout below the Toolbar but it is not working

Without more information on how you're setting your layout or how you're trying to change the background I can't be of more assistance. Since this is not a lib related issue I suggest you try stackoverflow for a better help on your problem.

gblancogarcia commented 9 years ago

I know this is not a issue related with your library. Anyway, thanks for your help.