/** * calls either #connect or #disconnect on the binder, depending on the view state. Call this * after a change to the view state. */ private void evalBinder() { if (liftedRxLifecycleBinder.isClosed()) { // abort; already done return; } boolean connect; if (View.VISIBLE == getWindowVisibility()) { if (View.VISIBLE == getVisibility()) { boolean visible = true; for (ViewParent p = getParent(); visible && p instanceof View; p = p.getParent()) { visible &= View.VISIBLE == ((View) p).getVisibility(); } connect = visible; } else { connect = false; } } else { connect = false; } if (connect) { liftedRxLifecycleBinder.connect(this); } else { liftedRxLifecycleBinder.disconnect(); } }
public void cascadeDispose(@Nullable RxLifecycleBinder parent) { liftedRxLifecycleBinder.cascadeUnsubscribe(parent); }
public void onDispose() { liftedRxLifecycleBinder.close(); }
@Override public boolean isUnsubscribed() { return liftedRxLifecycleBinder.isUnsubscribed(); }
@Override public void unsubscribe() { liftedRxLifecycleBinder.unsubscribe(); }
@Override public void bind(Subscription sub) { liftedRxLifecycleBinder.bind(sub); }
@Override public <T> Observable<T> bind(Observable<T> source) { return liftedRxLifecycleBinder.bind(source); }
@Override public boolean reset(Object id) { return liftedRxLifecycleBinder.reset(id); }
@Override public void reset() { liftedRxLifecycleBinder.reset(); }