Esempio n. 1
0
        public override void removeTabAt(int position)
        {
            if (mTabScrollView == null)
            {
                // No tabs around to remove
                return;
            }
            int selectedTabPosition = mSelectedTab != null?mSelectedTab.getPosition() : mSavedTabPosition;

            mTabScrollView.removeTabAt(position);
            [email protected] removedTab = mTabs.remove(position);
            if (removedTab != null)
            {
                removedTab.setPosition(-1);
            }
            int newTabCount = mTabs.size();

            {
                for (int i = position; i < newTabCount; i++)
                {
                    mTabs.get(i).setPosition(i);
                }
            }
            if (selectedTabPosition == position)
            {
                selectTab(mTabs.isEmpty() ? null : mTabs.get(System.Math.Max(0, position - 1)));
            }
        }
 /**
  * Removes a collection from the those being decorated in this composite.
  *
  * @param coll  collection to be removed
  */
 public virtual void removeComposited(java.util.Collection <Object> coll)
 {
     java.util.ArrayList <Object> list = new java.util.ArrayList <Object>(this.all.Length);
     list.addAll(java.util.Arrays <Object> .asList <Object>(this.all));
     list.remove(coll);
     this.all = (java.util.Collection <Object>[])list.toArray(new java.util.Collection <Object> [list.size()]);
 }
Esempio n. 3
0
 public virtual void unregisterActivityLifecycleCallbacks(android.app.Application.
                                                          ActivityLifecycleCallbacks callback)
 {
     lock (mActivityLifecycleCallbacks)
     {
         mActivityLifecycleCallbacks.remove(callback);
     }
 }
Esempio n. 4
0
 public override void unregisterComponentCallbacks(android.content.ComponentCallbacks
                                                   callback)
 {
     lock (mComponentCallbacks)
     {
         mComponentCallbacks.remove(callback);
     }
 }
Esempio n. 5
0
 protected virtual java.util.MapNS.Entry <Object, Object> nextEntry()
 {
     if (!hasNext())
     {
         throw new java.util.NoSuchElementException();
     }
     last = (java.util.MapNS.Entry <Object, Object>)current.remove(current.size() - 1);
     return(last);
 }
Esempio n. 6
0
 /// <summary>Remove a previously installed pre-draw callback</summary>
 /// <param name="victim">The callback to remove</param>
 /// <exception cref="System.InvalidOperationException">
 /// If
 /// <see cref="isAlive()">isAlive()</see>
 /// returns false
 /// </exception>
 /// <seealso cref="addOnPreDrawListener(OnPreDrawListener)">addOnPreDrawListener(OnPreDrawListener)
 ///     </seealso>
 public void removeOnPreDrawListener(android.view.ViewTreeObserver.OnPreDrawListener
                                     victim)
 {
     checkIsAlive();
     if (mOnPreDrawListeners == null)
     {
         return;
     }
     mOnPreDrawListeners.remove(victim);
 }
        /**
         * Subtracts all elements in the second list from the first list,
         * placing the results in a new list.
         * <p>
         * This differs from {@link List#removeAll(Collection)} in that
         * cardinality is respected; if <Code>list1</Code> contains two
         * occurrences of <Code>null</Code> and <Code>list2</Code> only
         * contains one occurrence, then the returned list will still contain
         * one occurrence.
         *
         * @param list1  the list to subtract from
         * @param list2  the list to subtract
         * @return  a new list containing the results
         * @throws NullPointerException if either list is null
         */
        public static java.util.List <Object> subtract(java.util.List <Object> list1, java.util.List <Object> list2)
        {
            java.util.ArrayList <Object> result   = new java.util.ArrayList <Object>(list1);
            java.util.Iterator <Object>  iterator = list2.iterator();

            while (iterator.hasNext())
            {
                result.remove(iterator.next());
            }

            return(result);
        }
Esempio n. 8
0
 /// <summary>Removes a listener from the set listening to this animation.</summary>
 /// <remarks>Removes a listener from the set listening to this animation.</remarks>
 /// <param name="listener">
 /// the listener to be removed from the current set of listeners for this
 /// animation.
 /// </param>
 public virtual void removeListener(android.animation.Animator.AnimatorListener listener
                                    )
 {
     if (mListeners == null)
     {
         return;
     }
     mListeners.remove(listener);
     if (mListeners.size() == 0)
     {
         mListeners = null;
     }
 }
Esempio n. 9
0
        internal void reset()
        {
            levelObjVal = null;
            levelIntVal = Level.INFO.intValue();

            foreach (Handler handler in handlers)
            {
                try {
                    if (handlers.remove(handler))
                    {
                        handler.close();
                    }
                } catch (Exception) {
                }
            }
        }
Esempio n. 10
0
 public virtual bool removeHeader(android.view.View v)
 {
     {
         for (int i = 0; i < mHeaderViewInfos.size(); i++)
         {
             android.widget.ListView.FixedViewInfo info = mHeaderViewInfos.get(i);
             if (info.view == v)
             {
                 mHeaderViewInfos.remove(i);
                 mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable
                                                   (mFooterViewInfos);
                 return(true);
             }
         }
     }
     return(false);
 }
 internal static android.widget.ExpandableListPosition getRecycledOrCreate()
 {
     android.widget.ExpandableListPosition elp;
     lock (sPool)
     {
         if (sPool.size() > 0)
         {
             elp = sPool.remove(0);
         }
         else
         {
             return(new android.widget.ExpandableListPosition());
         }
     }
     elp.resetState();
     return(elp);
 }
Esempio n. 12
0
 /// <summary>Removes a previously registered observer.</summary>
 /// <remarks>
 /// Removes a previously registered observer. The observer must not be null and it
 /// must already have been registered.
 /// </remarks>
 /// <param name="observer">the observer to unregister</param>
 /// <exception cref="System.ArgumentException">the observer is null</exception>
 /// <exception cref="System.InvalidOperationException">the observer is not yet registered
 ///     </exception>
 public virtual void unregisterObserver(T observer)
 {
     if ((object)observer == null)
     {
         throw new System.ArgumentException("The observer is null.");
     }
     lock (mObservers)
     {
         int index = mObservers.indexOf(observer);
         if (index == -1)
         {
             throw new System.InvalidOperationException("Observer " + observer + " was not registered."
                                                        );
         }
         mObservers.remove(index);
     }
 }
Esempio n. 13
0
 private static android.widget.ExpandableListConnector.PositionMetadata getRecycledOrCreate
     ()
 {
     android.widget.ExpandableListConnector.PositionMetadata pm;
     lock (sPool)
     {
         if (sPool.size() > 0)
         {
             pm = sPool.remove(0);
         }
         else
         {
             return(new android.widget.ExpandableListConnector.PositionMetadata());
         }
     }
     pm.resetState();
     return(pm);
 }
Esempio n. 14
0
 /**
  * Removes user (public) listener to this list.
  *
  * @param listener - listener to be removed.
  */
 public void removeUserListener(Object listener)
 {
     if (listener == null)
     {
         return;
     }
     // transactionally replace old list
     lock (this)
     {
         if (userList == null || !userList.contains(listener))
         {
             return;
         }
         java.util.ArrayList <T> newList = new java.util.ArrayList <T>(userList);
         newList.remove(listener);
         userList = (newList.size() > 0 ? newList : null);
     }
 }
Esempio n. 15
0
        public virtual void removeGroup(int groupId)
        {
            java.util.ArrayList <*****@*****.**> items = mItems;
            int itemCount = items.size();
            int i         = 0;

            while (i < itemCount)
            {
                if (items.get(i).getGroupId() == groupId)
                {
                    items.remove(i);
                    itemCount--;
                }
                else
                {
                    i++;
                }
            }
        }
Esempio n. 16
0
        /**
         * Removes a driver from the {@code DriverManager}'s registered driver list.
         * This will only succeed when the caller's class loader loaded the driver
         * that is to be removed. If the driver was loaded by a different class
         * loader, the removal of the driver fails silently.
         * <p>
         * If the removal succeeds, the {@code DriverManager} will not use this
         * driver in the future when asked to get a {@code Connection}.
         *
         * @param driver
         *            the JDBC driver to remove.
         * @throws SQLException
         *             if there is a problem interfering with accessing the
         *             database.
         */
        public static void deregisterDriver(Driver driver)
        {//throws SQLException {
            if (driver == null)
            {
                return;
            }
            java.lang.ClassLoader callerClassLoader = java.lang.Runtime.getRuntime().getClass().getClassLoader();// Basties note: sometime do the same as VM.callerClassLoader();

            if (!DriverManager.isClassFromClassLoader(driver, callerClassLoader))
            {
                // sql.1=DriverManager: calling class not authorized to deregister
                // JDBC driver
                throw new java.lang.SecurityException("DriverManager: calling class not authorized to deregister JDBC driver"); //$NON-NLS-1$
            } // end if
            lock (theDrivers)
            {
                theDrivers.remove(driver);
            }
        }
Esempio n. 17
0
 /**
  * Remove the element at the specified position in the list, and shift
  * any subsequent elements down one position.
  *
  * @param index Index of the element to be removed
  *
  * @exception IndexOutOfBoundsException if the index is out of range
  */
 public override Object remove(int index)
 {
     if (fast)
     {
         lock (this)
         {
             java.util.ArrayList <Object> temp = (java.util.ArrayList <Object>)list.clone();
             Object result = temp.remove(index);
             list = temp;
             return(result);
         }
     }
     else
     {
         lock (list)
         {
             return(list.remove(index));
         }
     }
 }
Esempio n. 18
0
 /**
  * Remove the first occurrence of the specified element from the list,
  * and shift any subsequent elements down one position.
  *
  * @param element Element to be removed
  */
 public override bool remove(Object element)
 {
     if (fast)
     {
         lock (this)
         {
             java.util.ArrayList <Object> temp = (java.util.ArrayList <Object>)list.clone();
             bool result = temp.remove(element);
             list = temp;
             return(result);
         }
     }
     else
     {
         lock (list)
         {
             return(list.remove(element));
         }
     }
 }
Esempio n. 19
0
        //
        // DiscardInstance
        //

        public static void DiscardInstance(SoundEffectInstance discardInstance, SoundEffect discardEffect)
        {
            if (instancesLock.isHeldByCurrentThread())
            {
                return;
            }
            try
            {
                instancesLock.@lock();
                for (int idx = instancesList.size(); idx-- > 0;)
                {
                    var instRef = ([email protected])instancesList.get(idx);
                    var inst    = (SoundEffectInstance)instRef.get();
                    if (inst == discardInstance || inst == null || inst.ShouldDiscard(discardEffect))
                    {
                        instancesList.remove(idx);
                    }
                }
            }
            finally
            {
                instancesLock.unlock();
            }
        }
Esempio n. 20
0
 public virtual void onAnimationEnd(android.animation.Animator animation)
 {
     mAnimators.remove(animation);
 }
 /**
  * Returns a new {@link Collection} containing <tt><i>a</i> - <i>b</i></tt>.
  * The cardinality of each element <i>e</i> in the returned {@link Collection}
  * will be the cardinality of <i>e</i> in <i>a</i> minus the cardinality
  * of <i>e</i> in <i>b</i>, or zero, whichever is greater.
  *
  * @param a  the collection to subtract from, must not be null
  * @param b  the collection to subtract, must not be null
  * @return a new collection with the results
  * @see Collection#removeAll
  */
 public static java.util.Collection<Object> subtract(java.util.Collection<Object> a, java.util.Collection<Object> b)
 {
     java.util.ArrayList<Object> list = new java.util.ArrayList<Object>(a);
     for (java.util.Iterator<Object> it = b.iterator(); it.hasNext(); )
     {
         list.remove(it.next());
     }
     return list;
 }
Esempio n. 22
0
        /// <summary>
        /// Traverses the expanded group metadata list and fills in the flat list
        /// positions.
        /// </summary>
        /// <remarks>
        /// Traverses the expanded group metadata list and fills in the flat list
        /// positions.
        /// </remarks>
        /// <param name="forceChildrenCountRefresh">
        /// Forces refreshing of the children count
        /// for all expanded groups.
        /// </param>
        /// <param name="syncGroupPositions">
        /// Whether to search for the group positions
        /// based on the group IDs. This should only be needed when calling
        /// this from an onChanged callback.
        /// </param>
        private void refreshExpGroupMetadataList(bool forceChildrenCountRefresh, bool syncGroupPositions
                                                 )
        {
            java.util.ArrayList <android.widget.ExpandableListConnector.GroupMetadata> egml =
                mExpGroupMetadataList;
            int egmlSize = egml.size();
            int curFlPos = 0;

            mTotalExpChildrenCount = 0;
            if (syncGroupPositions)
            {
                // We need to check whether any groups have moved positions
                bool positionsChanged = false;
                {
                    for (int i = egmlSize - 1; i >= 0; i--)
                    {
                        android.widget.ExpandableListConnector.GroupMetadata curGm = egml.get(i);
                        int newGPos = findGroupPosition(curGm.gId, curGm.gPos);
                        if (newGPos != curGm.gPos)
                        {
                            if (newGPos == android.widget.AdapterView.INVALID_POSITION)
                            {
                                // Doh, just remove it from the list of expanded groups
                                egml.remove(i);
                                egmlSize--;
                            }
                            curGm.gPos = newGPos;
                            if (!positionsChanged)
                            {
                                positionsChanged = true;
                            }
                        }
                    }
                }
                if (positionsChanged)
                {
                    // At least one group changed positions, so re-sort
                    java.util.Collections.sort(egml);
                }
            }
            int gChildrenCount;
            int lastGPos = 0;
            {
                for (int i_1 = 0; i_1 < egmlSize; i_1++)
                {
                    android.widget.ExpandableListConnector.GroupMetadata curGm = egml.get(i_1);
                    if ((curGm.lastChildFlPos == android.widget.ExpandableListConnector.GroupMetadata
                         .REFRESH) || forceChildrenCountRefresh)
                    {
                        gChildrenCount = mExpandableListAdapter.getChildrenCount(curGm.gPos);
                    }
                    else
                    {
                        gChildrenCount = curGm.lastChildFlPos - curGm.flPos;
                    }
                    mTotalExpChildrenCount += gChildrenCount;
                    curFlPos            += (curGm.gPos - lastGPos);
                    lastGPos             = curGm.gPos;
                    curGm.flPos          = curFlPos;
                    curFlPos            += gChildrenCount;
                    curGm.lastChildFlPos = curFlPos;
                }
            }
        }
        /**
         * Subtracts all elements in the second list from the first list,
         * placing the results in a new list.
         * <p>
         * This differs from {@link List#removeAll(Collection)} in that
         * cardinality is respected; if <Code>list1</Code> contains two
         * occurrences of <Code>null</Code> and <Code>list2</Code> only
         * contains one occurrence, then the returned list will still contain
         * one occurrence.
         *
         * @param list1  the list to subtract from
         * @param list2  the list to subtract
         * @return  a new list containing the results
         * @throws NullPointerException if either list is null
         */
        public static java.util.List<Object> subtract(java.util.List<Object> list1, java.util.List<Object> list2)
        {
            java.util.ArrayList<Object> result = new java.util.ArrayList<Object>(list1);
            java.util.Iterator<Object> iterator = list2.iterator();

            while (iterator.hasNext())
            {
                result.remove(iterator.next());
            }

            return result;
        }
Esempio n. 24
0
 public virtual void removeItem(int id)
 {
     mItems.remove(findItemIndex(id));
 }
Esempio n. 25
0
 /*
  * Removes the provider
  *
  * @param providerNumber
  */
 public static void removeProvider(int providerNumber)
 {
     java.security.Provider p = providers.remove(providerNumber - 1);
     providersNames.remove(p.getName());
     setNeedRefresh();
 }
Esempio n. 26
0
 public override void removeOnMenuVisibilityListener(android.app.ActionBar.OnMenuVisibilityListener
                                                     listener)
 {
     mMenuVisibilityListeners.remove(listener);
 }