Browse Source

removeLifecycleRegistry supported for #288

zhpanvip 2 years ago
parent
commit
d99f59cd77

+ 5 - 0
bannerview/src/main/java/com/zhpan/bannerview/BannerViewPager.java

@@ -1067,6 +1067,11 @@ public class BannerViewPager<T> extends RelativeLayout implements LifecycleObser
     return this;
   }
 
+  public BannerViewPager<T> removeLifecycleRegistry(Lifecycle lifecycleRegistry) {
+    lifecycleRegistry.removeObserver(this);
+    return this;
+  }
+
   @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
   public void onPause() {
     stopLoop();