SlidingPaneLayout setCoveredFadeColor () and setSliderFadeColor()

情到浓时终转凉″ 提交于 2019-12-23 18:19:31

问题


I'm using the SlidingPaneLayout and want to set gray fade color on left pane when the slider right pane is open and a transparent fade color on the left pane when the right pane is closed and left pane is fully visible.
I know this is the default behaviour of the SlidingPaneLayout , but with default implementation I'm facing issues in the landscape mode wherein my slider left pane always remains faded and takes no click events even if right slide is closed.
I implemented the SlidingPaneLayout.SimplePanelSlideListener and managed the fade colors in onPanelOpened() and onPanelClosed() But I'm nit sure which function should I use for this... setCoveredFadeColor() or setSliderFadeColor()?
What is the exact difference between these 2 functions?

Any help is much appreciated. Thanks!


回答1:


From the docs:

setSliderFadeColor(int color) Set the color used to fade the pane covered by the sliding pane out when the pane will become fully covered in the closed state.

setCoveredFadeColor(int color) Set the color used to fade the sliding pane out when it is slid most of the way offscreen.

In my experience, I've found that the panel that gets covered needs to be at least 320dp wide for these two fade colours to work.



来源:https://stackoverflow.com/questions/18272856/slidingpanelayout-setcoveredfadecolor-and-setsliderfadecolor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!