Comments (7)
@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);
NOTE: window the the view where you want the shadow effect.
- 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.
from flowingdrawer.
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 ..
from flowingdrawer.
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?
from flowingdrawer.
HI, @qbai22 ,I haven't found a good way to set shadow .so I didn't use shadow. This needs to be improved.
from flowingdrawer.
@syn3sthete wow you did a great job! Thanks i will try it in a short time!
from flowingdrawer.
@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 :)
from flowingdrawer.
@syn3sthete all works great! Thanks
from flowingdrawer.
Related Issues (20)
- Show/Hide via code HOT 1
- What kind of methods to use?
- The RTL HOT 2
- How to add items in FlowingDrawer dynamically?
- issue when changing locale HOT 1
- Android P devices HOT 6
- java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed HOT 5
- δΎ§ζ»ι΄ε½±
- Failed to run on Android P HOT 1
- code is clean but app crash when running HOT 1
- java.lang.OutOfMemoryError: com.mxn.soul.flowingdrawer_core.BuildLayerFrameLayout.dispatchDraw
- App crash HOT 3
- header divider not showing on right most part, on flowing view
- header divider not showing on right most part, on flowing view HOT 1
- Invalid Region.Op - only INTERSECT and DIFFERENCE HOT 2
- how use custom attributes, edMenuBackground?
- This should be in MIT Licensed in Anroid
- FlowinMenuLayout overlaped with NavigationBar
- Swipe drawer
- FlowingDrawer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flowingdrawer.