Skip to content

xukai59740/toolBarAlphaBehavior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 22, 2017
e689f50 · Feb 22, 2017

History

3 Commits
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017
Feb 22, 2017

Repository files navigation

ToolBarAlphaBehavior

Android - ToolBarAlphaBehavior

Demo

ToolBarAlphaBehavior GIF

How to Use

		int imageViewHeight=dip2px(360);
        //toolBar变色回调
        toolBarAlphaBehavior = new ToolBarAlphaBehavior(getBaseContext(),toolbar, "000000", new ToolBarAlphaBehavior.CallBack() {
            @Override
            public void callBack(int color) {
                setStatuBarColor(color);
            }
        },imageViewHeight);

        //初始化toolBar 颜色
        toolBarAlphaBehavior.setAlPha(ToolBarAlphaBehavior.minAlpha);//toolbar透明度初始化

        //监听 NestScrollView
        mScrollView.setOnCustomScroolChangeListener(new CustomNestedScrollView.ScrollInterface() {
            @Override
            public void onSChanged(int l, int t, int oldl, int oldt) {
                //渐变色.
                if (toolBarAlphaBehavior != null)
                    toolBarAlphaBehavior.onNestedScroll(t);
            }
        });

About

ToolBar transparent color gradient by scroll screen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages