Sets a new drawable to be the delegate, and returns the old one (or null).

<p>This method will cause the drawable to be invalidated.

@param newDelegate
@return the previous delegate
186247
public @Nullable Drawable setCurrent(@Nullable Drawable newDelegate) {
    Drawable previousDelegate = setCurrentWithoutInvalidate(newDelegate);
    invalidateSelf();
    return previousDelegate;
  }
714203
public void setSelectionDrawable(@NonNull Drawable drawable) {
    if (drawable == null) {
      throw new IllegalArgumentException("Cannot be null");
    }
    selectionDrawable = drawable;
    isDecorated = true;
  }
220281
public ResponseBuilder addDelegateDirective(Intent updatedIntent) {
        DelegateDirective delegateDirective = DelegateDirective.builder()
                .withUpdatedIntent(updatedIntent)
                .build();
        return addDirective(delegateDirective);
    }
1357927
public DirContext getInnermostDelegateDirContext() {
        final DirContext delegateDirContext = this.getDelegateDirContext();

        if (delegateDirContext instanceof DelegatingDirContext) {
            return ((DelegatingDirContext)delegateDirContext).getInnermostDelegateDirContext();
        }

        return delegateDirContext;
    }
252040
private final MapSubject delegate() {
    MapSubject delegate = check().that(actual());
    if (internalCustomName() != null) {
      delegate = delegate.named(internalCustomName());
    }
    return delegate;
  }
235030
public void setDelegates(java.util.Collection<Delegate> delegates) {
        if (delegates == null) {
            this.delegates = null;
            return;
        }

        this.delegates = new java.util.ArrayList<Delegate>(delegates);
    }
1014178
public static <T> Randomizer<T> aNewOptionalRandomizer(final Randomizer<T> delegate, final int optionalPercent) {
        return new OptionalRandomizer<>(delegate, optionalPercent);
    }
403757
private P createViewIdAndCreatePresenter() {

    P presenter = delegateCallback.createPresenter();
    if (presenter == null) {
      throw new NullPointerException(
          "Presenter returned from createPresenter() is null. Activity is " + activity);
    }
    if (keepPresenterInstance) {
      mosbyViewId = UUID.randomUUID().toString();
      PresenterManager.putPresenter(activity, mosbyViewId, presenter);
    }
    return presenter;
  }
975191
private void delegateChanged(Observable<T> oldDelegate, Observable<T> newDelegate)
	{
		removeObservableListeners(oldDelegate);
		
		addObservableListeners(newDelegate);

		support.fireValueChanged(oldDelegate.getValue(), newDelegate.getValue());
	}
1233091
@SuppressWarnings("deprecation")
	@SuppressLint("NewApi")
	public SwipeBack setSwipeBackContainerBackgroundDrawable(Drawable d) {
		if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
			mSwipeBackContainer.setBackgroundDrawable(d);
		} else {
			mSwipeBackContainer.setBackground(d);
		}

		return this;
	}
591383
public void setPersistenceDelegate(Class<?> type, PersistenceDelegate delegate)
	{
		if (type == null || delegate == null)
		{
			throw new NullPointerException();
		}
		delegates.put(type, delegate);
	}
565989
private V putInternal(final K key, final V value) {
        final Map<K, V> delegate = new HashMap<>(this.delegate);
        V existing = delegate.put(key, value);
        this.delegate = delegate;
        return existing;
    }
1106380
public void setPageMarginDrawable(Drawable d) {
        mMarginDrawable = d;
        if (d != null) refreshDrawableState();
        setWillNotDraw(d == null);
        invalidate();
    }
745700
private FilteredTreeNode createNode(final TreeNode delegateNode)
    {
        FilteredTreeNode node = new FilteredTreeNode(this, delegateNode);
        delegateToThis.put(delegateNode, node);
        thisToDelegate.put(node, delegateNode);

        @SuppressWarnings("unchecked")
        Enumeration<? extends TreeNode> delegateChildren = 
        delegateNode.children();
        while (delegateChildren.hasMoreElements())
        {
            TreeNode delegateChild = delegateChildren.nextElement();
            createNode(delegateChild);
        }
        return node;
    }
743427
public Layout previousGeneration() throws FetchException {
        Cursor<StoredLayout> cursor = mLayoutFactory.mLayoutStorage
            .query("storableTypeName = ? & generation < ?")
            .with(getStorableTypeName()).with(getGeneration())
            .orderBy("-generation")
            .fetch();

        try {
            if (cursor.hasNext()) {
                return new Layout(mLayoutFactory, cursor.next());
            }
        } finally {
            cursor.close();
        }

        return null;
    }
1373642
@NonNull
  public RequestCreator error(@NonNull Drawable errorDrawable) {
    if (errorDrawable == null) {
      throw new IllegalArgumentException("Error image may not be null.");
    }
    if (errorResId != 0) {
      throw new IllegalStateException("Error image already set.");
    }
    this.errorDrawable = errorDrawable;
    return this;
  }
1231228
@Override
	public ActivityDelegate createActivityDelegate(AbstractFragmentActivity abstractFragmentActivity) {
		return !fcmInitialized ? new ActivityDelegate(abstractFragmentActivity) {

			@Override
			public void onCreate(Bundle savedInstanceState) {
				if (!fcmInitialized) {
					startFcmRegistration(true);
					fcmInitialized = true;
				}
			}
		} : null;
	}