/// <summary>
 /// Merges all the listeners registered on the specified observer with the listeners
 /// registered on this object.
 /// </summary>
 /// <remarks>
 /// Merges all the listeners registered on the specified observer with the listeners
 /// registered on this object. After this method is invoked, the specified observer
 /// will return false in
 /// <see cref="isAlive()">isAlive()</see>
 /// and should not be used anymore.
 /// </remarks>
 /// <param name="observer">The ViewTreeObserver whose listeners must be added to this observer
 ///     </param>
 internal void merge(android.view.ViewTreeObserver observer)
 {
     if (observer.mOnGlobalFocusListeners != null)
     {
         if (mOnGlobalFocusListeners != null)
         {
             mOnGlobalFocusListeners.addAll(observer.mOnGlobalFocusListeners);
         }
         else
         {
             mOnGlobalFocusListeners = observer.mOnGlobalFocusListeners;
         }
     }
     if (observer.mOnGlobalLayoutListeners != null)
     {
         if (mOnGlobalLayoutListeners != null)
         {
             mOnGlobalLayoutListeners.addAll(observer.mOnGlobalLayoutListeners);
         }
         else
         {
             mOnGlobalLayoutListeners = observer.mOnGlobalLayoutListeners;
         }
     }
     if (observer.mOnPreDrawListeners != null)
     {
         if (mOnPreDrawListeners != null)
         {
             mOnPreDrawListeners.addAll(observer.mOnPreDrawListeners);
         }
         else
         {
             mOnPreDrawListeners = observer.mOnPreDrawListeners;
         }
     }
     if (observer.mOnTouchModeChangeListeners != null)
     {
         if (mOnTouchModeChangeListeners != null)
         {
             mOnTouchModeChangeListeners.addAll(observer.mOnTouchModeChangeListeners);
         }
         else
         {
             mOnTouchModeChangeListeners = observer.mOnTouchModeChangeListeners;
         }
     }
     if (observer.mOnComputeInternalInsetsListeners != null)
     {
         if (mOnComputeInternalInsetsListeners != null)
         {
             mOnComputeInternalInsetsListeners.addAll(observer.mOnComputeInternalInsetsListeners
                                                      );
         }
         else
         {
             mOnComputeInternalInsetsListeners = observer.mOnComputeInternalInsetsListeners;
         }
     }
     observer.kill();
 }
 /**
  * Constructs a new cache using <code>capacity</code> for maximum size, and <code>loWater</code> for the low water.
  *
  * @param loWater  the low water level.
  * @param capacity the maximum capacity.
  */
 public BasicMemoryCache(long loWater, long capacity)
 {
     this.entries   = new java.util.concurrent.ConcurrentHashMap <Object, CacheEntry>();
     this.listeners = new java.util.concurrent.CopyOnWriteArrayList <MemoryCache.CacheListener>();
     this.capacity.set(capacity);
     this.lowWater = loWater;
     this.currentUsedCapacity.set((long)0);
 }
 /// <summary>
 /// Register a callback to be invoked when the invoked when it is time to
 /// compute the window's internal insets.
 /// </summary>
 /// <remarks>
 /// Register a callback to be invoked when the invoked when it is time to
 /// compute the window's internal insets.
 /// </remarks>
 /// <param name="listener">The callback to add</param>
 /// <exception cref="System.InvalidOperationException">
 /// If
 /// <see cref="isAlive()">isAlive()</see>
 /// returns false
 /// We are not yet ready to commit to this API and support it, so
 /// </exception>
 /// <hide></hide>
 public void addOnComputeInternalInsetsListener(android.view.ViewTreeObserver.OnComputeInternalInsetsListener
                                                listener)
 {
     checkIsAlive();
     if (mOnComputeInternalInsetsListeners == null)
     {
         mOnComputeInternalInsetsListeners = new java.util.concurrent.CopyOnWriteArrayList
                                             <android.view.ViewTreeObserver.OnComputeInternalInsetsListener>();
     }
     mOnComputeInternalInsetsListeners.add(listener);
 }
 /// <summary>Register a callback to be invoked when the invoked when the touch mode changes.
 ///     </summary>
 /// <remarks>Register a callback to be invoked when the invoked when the touch mode changes.
 ///     </remarks>
 /// <param name="listener">The callback to add</param>
 /// <exception cref="System.InvalidOperationException">
 /// If
 /// <see cref="isAlive()">isAlive()</see>
 /// returns false
 /// </exception>
 public void addOnTouchModeChangeListener(android.view.ViewTreeObserver.OnTouchModeChangeListener
                                          listener)
 {
     checkIsAlive();
     if (mOnTouchModeChangeListeners == null)
     {
         mOnTouchModeChangeListeners = new java.util.concurrent.CopyOnWriteArrayList <android.view.ViewTreeObserver
                                                                                      .OnTouchModeChangeListener>();
     }
     mOnTouchModeChangeListeners.add(listener);
 }
 /// <summary>Notifies registered listeners that the touch mode has changed.</summary>
 /// <remarks>Notifies registered listeners that the touch mode has changed.</remarks>
 /// <param name="inTouchMode">True if the touch mode is now enabled, false otherwise.
 ///     </param>
 internal void dispatchOnTouchModeChanged(bool inTouchMode)
 {
     java.util.concurrent.CopyOnWriteArrayList <android.view.ViewTreeObserver.OnTouchModeChangeListener
                                                > listeners = mOnTouchModeChangeListeners;
     if (listeners != null && listeners.size() > 0)
     {
         foreach (android.view.ViewTreeObserver.OnTouchModeChangeListener listener in Sharpen.IterableProxy.Create
                      (listeners))
         {
             listener.onTouchModeChanged(inTouchMode);
         }
     }
 }
 /// <summary>Notifies registered listeners that something has scrolled.</summary>
 /// <remarks>Notifies registered listeners that something has scrolled.</remarks>
 internal void dispatchOnScrollChanged()
 {
     // NOTE: because of the use of CopyOnWriteArrayList, we *must* use an iterator to
     // perform the dispatching. The iterator is a safe guard against listeners that
     // could mutate the list by calling the various add/remove methods. This prevents
     // the array from being modified while we iterate it.
     java.util.concurrent.CopyOnWriteArrayList <android.view.ViewTreeObserver.OnScrollChangedListener
                                                > listeners = mOnScrollChangedListeners;
     if (listeners != null && listeners.size() > 0)
     {
         foreach (android.view.ViewTreeObserver.OnScrollChangedListener listener in Sharpen.IterableProxy.Create
                      (listeners))
         {
             listener.onScrollChanged();
         }
     }
 }
 /// <summary>Returns whether there are listeners for computing internal insets.</summary>
 /// <remarks>Returns whether there are listeners for computing internal insets.</remarks>
 internal bool hasComputeInternalInsetsListeners()
 {
     java.util.concurrent.CopyOnWriteArrayList <android.view.ViewTreeObserver.OnComputeInternalInsetsListener
                                                > listeners = mOnComputeInternalInsetsListeners;
     return(listeners != null && listeners.size() > 0);
 }
Beispiel #8
0
		/// <summary>
		/// Register a callback to be invoked when the invoked when it is time to
		/// compute the window's internal insets.
		/// </summary>
		/// <remarks>
		/// Register a callback to be invoked when the invoked when it is time to
		/// compute the window's internal insets.
		/// </remarks>
		/// <param name="listener">The callback to add</param>
		/// <exception cref="System.InvalidOperationException">
		/// If
		/// <see cref="isAlive()">isAlive()</see>
		/// returns false
		/// We are not yet ready to commit to this API and support it, so
		/// </exception>
		/// <hide></hide>
		public void addOnComputeInternalInsetsListener(android.view.ViewTreeObserver.OnComputeInternalInsetsListener
			 listener)
		{
			checkIsAlive();
			if (mOnComputeInternalInsetsListeners == null)
			{
				mOnComputeInternalInsetsListeners = new java.util.concurrent.CopyOnWriteArrayList
					<android.view.ViewTreeObserver.OnComputeInternalInsetsListener>();
			}
			mOnComputeInternalInsetsListeners.add(listener);
		}
Beispiel #9
0
		/// <summary>Register a callback to be invoked when the invoked when the touch mode changes.
		/// 	</summary>
		/// <remarks>Register a callback to be invoked when the invoked when the touch mode changes.
		/// 	</remarks>
		/// <param name="listener">The callback to add</param>
		/// <exception cref="System.InvalidOperationException">
		/// If
		/// <see cref="isAlive()">isAlive()</see>
		/// returns false
		/// </exception>
		public void addOnTouchModeChangeListener(android.view.ViewTreeObserver.OnTouchModeChangeListener
			 listener)
		{
			checkIsAlive();
			if (mOnTouchModeChangeListeners == null)
			{
				mOnTouchModeChangeListeners = new java.util.concurrent.CopyOnWriteArrayList<android.view.ViewTreeObserver
					.OnTouchModeChangeListener>();
			}
			mOnTouchModeChangeListeners.add(listener);
		}
Beispiel #10
0
		/// <summary>
		/// Merges all the listeners registered on the specified observer with the listeners
		/// registered on this object.
		/// </summary>
		/// <remarks>
		/// Merges all the listeners registered on the specified observer with the listeners
		/// registered on this object. After this method is invoked, the specified observer
		/// will return false in
		/// <see cref="isAlive()">isAlive()</see>
		/// and should not be used anymore.
		/// </remarks>
		/// <param name="observer">The ViewTreeObserver whose listeners must be added to this observer
		/// 	</param>
		internal void merge(android.view.ViewTreeObserver observer)
		{
			if (observer.mOnGlobalFocusListeners != null)
			{
				if (mOnGlobalFocusListeners != null)
				{
					mOnGlobalFocusListeners.addAll(observer.mOnGlobalFocusListeners);
				}
				else
				{
					mOnGlobalFocusListeners = observer.mOnGlobalFocusListeners;
				}
			}
			if (observer.mOnGlobalLayoutListeners != null)
			{
				if (mOnGlobalLayoutListeners != null)
				{
					mOnGlobalLayoutListeners.addAll(observer.mOnGlobalLayoutListeners);
				}
				else
				{
					mOnGlobalLayoutListeners = observer.mOnGlobalLayoutListeners;
				}
			}
			if (observer.mOnPreDrawListeners != null)
			{
				if (mOnPreDrawListeners != null)
				{
					mOnPreDrawListeners.addAll(observer.mOnPreDrawListeners);
				}
				else
				{
					mOnPreDrawListeners = observer.mOnPreDrawListeners;
				}
			}
			if (observer.mOnTouchModeChangeListeners != null)
			{
				if (mOnTouchModeChangeListeners != null)
				{
					mOnTouchModeChangeListeners.addAll(observer.mOnTouchModeChangeListeners);
				}
				else
				{
					mOnTouchModeChangeListeners = observer.mOnTouchModeChangeListeners;
				}
			}
			if (observer.mOnComputeInternalInsetsListeners != null)
			{
				if (mOnComputeInternalInsetsListeners != null)
				{
					mOnComputeInternalInsetsListeners.addAll(observer.mOnComputeInternalInsetsListeners
						);
				}
				else
				{
					mOnComputeInternalInsetsListeners = observer.mOnComputeInternalInsetsListeners;
				}
			}
			observer.kill();
		}