material/src/main/java/com/rey/material/util/ToolbarManager.java
public void registerOnToolbarGroupChangedListener(OnToolbarGroupChangedListener listener){
        for(int i = mListeners.size() - 1; i >= 0; i--){
            WeakReference<OnToolbarGroupChangedListener> ref = mListeners.get(i);
            if(ref.get() == null)
                mListeners.remove(i);
            else if(ref.get() == listener)
                return;
        }

        mListeners.add(new WeakReference<OnToolbarGroupChangedListener>(listener));
    }
/**
     * Register a listener for current group changed event. Note that it doesn't hold any strong reference to listener, so don't use anonymous listener.
     */
Register a listener for current group changed event. Note that it doesn't hold any strong reference to listener, so don't use anonymous listener.
Register a listener for current group changed event . Note that it doesn ' t hold any strong reference to listener so don ' t use anonymous listener .
public void registerOnToolbarGroupChangedListener(OnToolbarGroupChangedListener listener){
        for(int i = mListeners.size() - 1; i >= 0; i--){
            WeakReference<OnToolbarGroupChangedListener> ref = mListeners.get(i);
            if(ref.get() == null)
                mListeners.remove(i);
            else if(ref.get() == listener)
                return;
        }
        mListeners.add(new WeakReference<OnToolbarGroupChangedListener>(listener));
    }
public void registerOnToolbarGroupChangedListener ( OnToolbarGroupChangedListener listener ) { for ( int i = mListeners . size ( ) - 1 ; i >= 0 ; i -- ) { WeakReference < OnToolbarGroupChangedListener > ref = mListeners . get ( i ) ; if ( ref . get ( ) == null ) mListeners . remove ( i ) ; else if ( ref . get ( ) == listener ) return ; } mListeners . add ( new WeakReference < OnToolbarGroupChangedListener > ( listener ) ) ; }
Register a listener for current group changed event.
Register a listener for current group changed event .