Closed qbai22 closed 7 years ago
you can check out the app/ folder and the sample app. There is no need to implement any activity. just put layout in the right way in xml . I don't understand what scrimColor mean ..
Thank you for your answer! I meant this shadow (see on picture). By default and in the sample app there is no any shadow overlay. So i wanted to ask how can i achieve it?
HI, @qbai22 ,I haven't found a good way to set shadow .so I didn't use shadow. This needs to be improved.
@qbai22 I have achieved the shadow effect by taking a long route.
First create a window_dim.xml
file in drawable folder and paste the below code:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#000000" />
</shape>
Go to the activity where you want the shadow effect, after you have set the layout for the activity paste the below code:
window.setForeground(ContextCompat.getDrawable(getBaseContext(), R.drawable.window_dim));
window.getForeground().setAlpha(0);
Now just use the OnDrawerStateChangeListener
like the below code:
flowingDrawer.setOnDrawerStateChangeListener(new ElasticDrawer.OnDrawerStateChangeListener() {
@Override
public void onDrawerStateChange(int oldState, int newState) {
}
@Override
public void onDrawerSlide(float openRatio, int offsetPixels) {
window.getForeground().setAlpha(offsetPixels / 10);
}
});
This worked perfect for me, let me know if you have any doubts.
@syn3sthete wow you did a great job! Thanks i will try it in a short time!
@qbai22 I am sure it will work because I was also looking solution for the same problem and implemented this, anyway let know how it worked for you and close the issue if the problem is fixed. Thanks :)
@syn3sthete all works great! Thanks
I can't find a way to implement any activity shadowing as in your example gif, setScrimColor method is not available for FlowingDrawer object. Can you please help me?