Esempio n. 1
0
		/// <summary>
		/// <p>Display the content view in a popup window anchored to the bottom-left
		/// corner of the anchor view offset by the specified x and y coordinates.
		/// </summary>
		/// <remarks>
		/// <p>Display the content view in a popup window anchored to the bottom-left
		/// corner of the anchor view offset by the specified x and y coordinates.
		/// If there is not enough room on screen to show
		/// the popup in its entirety, this method tries to find a parent scroll
		/// view to scroll. If no parent scroll view can be scrolled, the bottom-left
		/// corner of the popup is pinned at the top left corner of the anchor view.</p>
		/// <p>If the view later scrolls to move <code>anchor</code> to a different
		/// location, the popup will be moved correspondingly.</p>
		/// </remarks>
		/// <param name="anchor">the view on which to pin the popup window</param>
		/// <seealso cref="dismiss()">dismiss()</seealso>
		public virtual void showAsDropDown(android.view.View anchor, int xoff, int yoff)
		{
			if (isShowing() || mContentView == null)
			{
				return;
			}
			registerForScrollChanged(anchor, xoff, yoff);
			mIsShowing = true;
			mIsDropdown = true;
			android.view.WindowManagerClass.LayoutParams p = createPopupLayout(anchor.getWindowToken
				());
			preparePopup(p);
			updateAboveAnchor(findDropDownPosition(anchor, p, xoff, yoff));
			if (mHeightMode < 0)
			{
				p.height = mLastHeight = mHeightMode;
			}
			if (mWidthMode < 0)
			{
				p.width = mLastWidth = mWidthMode;
			}
			p.windowAnimations = computeAnimationResource();
			invokePopup(p);
		}
Esempio n. 2
0
		/// <summary>
		/// <p>
		/// Display the content view in a popup window at the specified location.
		/// </summary>
		/// <remarks>
		/// <p>
		/// Display the content view in a popup window at the specified location. If the popup window
		/// cannot fit on screen, it will be clipped. See
		/// <see cref="android.view.WindowManagerClass.LayoutParams">android.view.WindowManagerClass.LayoutParams
		/// 	</see>
		/// for more information on how gravity and the x and y parameters are related. Specifying
		/// a gravity of
		/// <see cref="android.view.Gravity.NO_GRAVITY">android.view.Gravity.NO_GRAVITY</see>
		/// is similar to specifying
		/// <code>Gravity.LEFT | Gravity.TOP</code>.
		/// </p>
		/// </remarks>
		/// <param name="parent">
		/// a parent view to get the
		/// <see cref="android.view.View.getWindowToken()">android.view.View.getWindowToken()
		/// 	</see>
		/// token from
		/// </param>
		/// <param name="gravity">the gravity which controls the placement of the popup window
		/// 	</param>
		/// <param name="x">the popup's x location offset</param>
		/// <param name="y">the popup's y location offset</param>
		public virtual void showAtLocation(android.view.View parent, int gravity, int x, 
			int y)
		{
			showAtLocation(parent.getWindowToken(), gravity, x, y);
		}
Esempio n. 3
0
		/// <summary>Called by ViewAncestor when its window gets input focus.</summary>
		/// <remarks>Called by ViewAncestor when its window gets input focus.</remarks>
		/// <hide></hide>
		public void onWindowFocus(android.view.View rootView, android.view.View focusedView
			, int softInputMode, bool first, int windowFlags)
		{
			lock (mH)
			{
				if (mHasBeenInactive)
				{
					mHasBeenInactive = false;
					mNextServedNeedsStart = true;
				}
				focusInLocked(focusedView != null ? focusedView : rootView);
			}
			checkFocus();
			lock (mH)
			{
				try
				{
					bool isTextEditor = focusedView != null && focusedView.onCheckIsTextEditor();
					mService.windowGainedFocus(mClient, rootView.getWindowToken(), focusedView != null
						, isTextEditor, softInputMode, first, windowFlags);
				}
				catch (android.os.RemoteException)
				{
				}
			}
		}