Recently, in the iteration of live-streaming related functions, the previous left-swipe screen clearing in the project was implemented with ViewPager. This iteration encountered the problem of click failure caused by a layout level, and it was more complicated to change if we continued to use ViewPager. In addition, using ViewPager to make a screen clearing function was overuse, so WE optimized it and wrote a screen clearing control by ourselves, and the effect was good. At present, the project has been tested online and shared with friends in need.

Import

implementation 'com. Lmxjw3. Widget: clearscreen: 1.0.0'
Copy the code

Usage

1. Use ClearScreenLayout in the root layout as FrameLayout.
2. API
AddClearViews (View... RemoveClearViews (View... RemoveAllClearViews () // Set the slider direction (left or right)setSlideDirection(SlideDirection direction) // Set the slide listenersetOnSlideListener(OnSlideClearListener slideListener)
Copy the code