Giter Club home page Giter Club logo

Comments (7)

syn3sthete avatar syn3sthete commented on August 9, 2024 1

@qbai22 I have achieved the shadow effect by taking a long route.

  1. 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>

  2. 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.

  1. 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.

mxn21 avatar mxn21 commented on August 9, 2024

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.

qbai22 avatar qbai22 commented on August 9, 2024

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?
shadow

from flowingdrawer.

mxn21 avatar mxn21 commented on August 9, 2024

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.

qbai22 avatar qbai22 commented on August 9, 2024

@syn3sthete wow you did a great job! Thanks i will try it in a short time!

from flowingdrawer.

syn3sthete avatar syn3sthete commented on August 9, 2024

@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.

qbai22 avatar qbai22 commented on August 9, 2024

@syn3sthete all works great! Thanks

from flowingdrawer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.