Ejemplo n.º 1
0
 private android.widget.FrameLayout createContainer()
 {
     android.view.WindowManagerClass.LayoutParams lp = new android.view.WindowManagerClass
                                                       .LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup
                                                                     .LayoutParams.WRAP_CONTENT);
     lp.gravity = android.view.Gravity.TOP | android.view.Gravity.LEFT;
     lp.flags   = android.view.WindowManagerClass.LayoutParams.FLAG_NOT_TOUCHABLE | android.view.WindowManagerClass
                  .LayoutParams.FLAG_NOT_FOCUSABLE | android.view.WindowManagerClass.LayoutParams.
                  FLAG_LAYOUT_NO_LIMITS | android.view.WindowManagerClass.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
     lp.height              = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
     lp.width               = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
     lp.type                = android.view.WindowManagerClass.LayoutParams.TYPE_APPLICATION_PANEL;
     lp.format              = android.graphics.PixelFormat.TRANSLUCENT;
     lp.windowAnimations    = [email protected]_ZoomButtons;
     mContainerLayoutParams = lp;
     android.widget.FrameLayout container = new android.widget.ZoomButtonsController.Container
                                                (this, mContext);
     container.setLayoutParams(lp);
     container.setMeasureAllChildren(true);
     android.view.LayoutInflater inflater = (android.view.LayoutInflater)mContext.getSystemService
                                                (android.content.Context.LAYOUT_INFLATER_SERVICE);
     inflater.inflate([email protected]_container, container);
     mControls = (android.widget.ZoomControls)container.findViewById([email protected]
                                                                     .id.zoomControls);
     mControls.setOnZoomInClickListener(new _OnClickListener_266(this));
     mControls.setOnZoomOutClickListener(new _OnClickListener_272(this));
     return(container);
 }
Ejemplo n.º 2
0
 public virtual int relayout(android.view.IWindow window, int seq, android.view.WindowManagerClass
                             .LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility
                             , bool insetsPending, android.graphics.Rect outFrame, android.graphics.Rect outContentInsets
                             , android.graphics.Rect outVisibleInsets, android.content.res.Configuration outConfig
                             , android.view.Surface outSurface)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 3
0
 internal TN()
 {
     mShow = new _Runnable_302(this);
     mHide = new _Runnable_308(this);
     // XXX This should be changed to use a Dialog, with a Theme.Toast
     // defined that sets up the layout params appropriately.
     android.view.WindowManagerClass.LayoutParams @params = mParams;
     @params.height = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
     @params.width  = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
     @params.flags  = android.view.WindowManagerClass.LayoutParams.FLAG_NOT_FOCUSABLE |
                      android.view.WindowManagerClass.LayoutParams.FLAG_NOT_TOUCHABLE | android.view.WindowManagerClass
                      .LayoutParams.FLAG_KEEP_SCREEN_ON;
     @params.format           = android.graphics.PixelFormat.TRANSLUCENT;
     @params.windowAnimations = [email protected]_Toast;
     @params.type             = android.view.WindowManagerClass.LayoutParams.TYPE_TOAST;
     @params.setTitle(java.lang.CharSequenceProxy.Wrap("Toast"));
 }
Ejemplo n.º 4
0
 protected internal override void onCreate(android.os.Bundle savedInstanceState)
 {
     base.onCreate(savedInstanceState);
     android.view.WindowManagerClass.LayoutParams @params = getWindow().getAttributes(
         );
     @params.token = mView.getApplicationWindowToken();
     @params.type  = android.view.WindowManagerClass.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
     @params.flags = @params.flags | android.view.Window.FEATURE_NO_TITLE;
     setContentView([email protected]_picker);
     android.widget.GridView grid = (android.widget.GridView)findViewById([email protected]
                                                                          .id.characterPicker);
     grid.setAdapter(new android.text.method.CharacterPickerDialog.OptionsAdapter(this
                                                                                  , getContext()));
     grid.setOnItemClickListener(this);
     mCancelButton = (android.widget.Button)findViewById([email protected]
                                                         );
     mCancelButton.setOnClickListener(this);
 }
Ejemplo n.º 5
0
 public virtual void updateViewLayout(android.view.View view, android.view.ViewGroup
                                      .LayoutParams @params)
 {
     if (!(@params is android.view.WindowManagerClass.LayoutParams))
     {
         throw new System.ArgumentException("Params must be WindowManager.LayoutParams");
     }
     android.view.WindowManagerClass.LayoutParams wparams = (android.view.WindowManagerClass
                                                             .LayoutParams)@params;
     view.setLayoutParams(wparams);
     lock (this)
     {
         int index = findViewLocked(view, true);
         android.view.ViewRootImpl root = mRoots[index];
         mParams[index] = wparams;
         root.setLayoutParams(wparams, false);
     }
 }
Ejemplo n.º 6
0
        internal virtual void finishRemoveViewLocked(android.view.View view, int index)
        {
            int count = mViews.Length;

            // remove it from the list
            android.view.View[] tmpViews = new android.view.View[count - 1];
            removeItem(tmpViews, mViews, index);
            mViews = tmpViews;
            android.view.ViewRootImpl[] tmpRoots = new android.view.ViewRootImpl[count - 1];
            removeItem(tmpRoots, mRoots, index);
            mRoots = tmpRoots;
            android.view.WindowManagerClass.LayoutParams[] tmpParams = new android.view.WindowManagerClass
                                                                       .LayoutParams[count - 1];
            removeItem(tmpParams, mParams, index);
            mParams = tmpParams;
            if (view != null)
            {
                view.assignParent(null);
            }
        }
Ejemplo n.º 7
0
 /// <summary>Shows menu as a dialog.</summary>
 /// <remarks>Shows menu as a dialog.</remarks>
 /// <param name="windowToken">Optional token to assign to the window.</param>
 public virtual void show(android.os.IBinder windowToken)
 {
     // Many references to mMenu, create local reference
     [email protected] menu = mMenu;
     // Get the builder for the dialog
     android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(menu
                                                                                   .getContext());
     mPresenter = new [email protected](builder.getContext
                                                                        (), [email protected]_menu_item_layout);
     mPresenter.setCallback(this);
     mMenu.addMenuPresenter(mPresenter);
     builder.setAdapter(mPresenter.getAdapter(), this);
     // Set the title
     android.view.View headerView = menu.getHeaderView();
     if (headerView != null)
     {
         // Menu's client has given a custom header view, use it
         builder.setCustomTitle(headerView);
     }
     else
     {
         // Otherwise use the (text) title and icon
         builder.setIcon(menu.getHeaderIcon()).setTitle(menu.getHeaderTitle());
     }
     // Set the key listener
     builder.setOnKeyListener(this);
     // Show the menu
     mDialog = builder.create();
     mDialog.setOnDismissListener(this);
     android.view.WindowManagerClass.LayoutParams lp = mDialog.getWindow().getAttributes
                                                           ();
     lp.type = android.view.WindowManagerClass.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
     if (windowToken != null)
     {
         lp.token = windowToken;
     }
     lp.flags |= android.view.WindowManagerClass.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
     mDialog.show();
 }
Ejemplo n.º 8
0
 public virtual void onWindowAttributesChanged(android.view.WindowManagerClass.LayoutParams
                                               @params)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 9
0
		/// <summary><p>Generate the layout parameters for the popup window.</p></summary>
		/// <param name="token">the window token used to bind the popup's window</param>
		/// <returns>the layout parameters to pass to the window manager</returns>
		private android.view.WindowManagerClass.LayoutParams createPopupLayout(android.os.IBinder
			 token)
		{
			// generates the layout parameters for the drop down
			// we want a fixed size view located at the bottom left of the anchor
			android.view.WindowManagerClass.LayoutParams p = new android.view.WindowManagerClass
				.LayoutParams();
			// these gravity settings put the view at the top left corner of the
			// screen. The view is then positioned to the appropriate location
			// by setting the x and y offsets to match the anchor's bottom
			// left corner
			p.gravity = android.view.Gravity.LEFT | android.view.Gravity.TOP;
			p.width = mLastWidth = mWidth;
			p.height = mLastHeight = mHeight;
			if (mBackground != null)
			{
				p.format = mBackground.getOpacity();
			}
			else
			{
				p.format = android.graphics.PixelFormat.TRANSLUCENT;
			}
			p.flags = computeFlags(p.flags);
			p.type = mWindowLayoutType;
			p.token = token;
			p.softInputMode = mSoftInputMode;
			p.setTitle(java.lang.CharSequenceProxy.Wrap("PopupWindow:" + Sharpen.Util.IntToHexString
				(GetHashCode())));
			return p;
		}
Ejemplo n.º 10
0
		private android.widget.FrameLayout createContainer()
		{
			android.view.WindowManagerClass.LayoutParams lp = new android.view.WindowManagerClass
				.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup
				.LayoutParams.WRAP_CONTENT);
			lp.gravity = android.view.Gravity.TOP | android.view.Gravity.LEFT;
			lp.flags = android.view.WindowManagerClass.LayoutParams.FLAG_NOT_TOUCHABLE | android.view.WindowManagerClass
				.LayoutParams.FLAG_NOT_FOCUSABLE | android.view.WindowManagerClass.LayoutParams.
				FLAG_LAYOUT_NO_LIMITS | android.view.WindowManagerClass.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
			lp.height = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
			lp.width = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
			lp.type = android.view.WindowManagerClass.LayoutParams.TYPE_APPLICATION_PANEL;
			lp.format = android.graphics.PixelFormat.TRANSLUCENT;
			lp.windowAnimations = [email protected]_ZoomButtons;
			mContainerLayoutParams = lp;
			android.widget.FrameLayout container = new android.widget.ZoomButtonsController.Container
				(this, mContext);
			container.setLayoutParams(lp);
			container.setMeasureAllChildren(true);
			android.view.LayoutInflater inflater = (android.view.LayoutInflater)mContext.getSystemService
				(android.content.Context.LAYOUT_INFLATER_SERVICE);
			inflater.inflate([email protected]_container, container);
			mControls = (android.widget.ZoomControls)container.findViewById([email protected]
				.id.zoomControls);
			mControls.setOnZoomInClickListener(new _OnClickListener_266(this));
			mControls.setOnZoomOutClickListener(new _OnClickListener_272(this));
			return container;
		}
Ejemplo n.º 11
0
 private void addView(android.view.View view, android.view.ViewGroup.LayoutParams
                      @params, android.view.CompatibilityInfoHolder cih, bool nest)
 {
     if (false)
     {
         android.util.Log.v("WindowManager", "addView view=" + view);
     }
     if (!(@params is android.view.WindowManagerClass.LayoutParams))
     {
         throw new System.ArgumentException("Params must be WindowManager.LayoutParams");
     }
     android.view.WindowManagerClass.LayoutParams wparams = (android.view.WindowManagerClass
                                                             .LayoutParams)@params;
     android.view.ViewRootImpl root;
     android.view.View         panelParentView = null;
     lock (this)
     {
         // Here's an odd/questionable case: if someone tries to add a
         // view multiple times, then we simply bump up a nesting count
         // and they need to remove the view the corresponding number of
         // times to have it actually removed from the window manager.
         // This is useful specifically for the notification manager,
         // which can continually add/remove the same view as a
         // notification gets updated.
         int index = findViewLocked(view, false);
         if (index >= 0)
         {
             if (!nest)
             {
                 throw new System.InvalidOperationException("View " + view + " has already been added to the window manager."
                                                            );
             }
             root = mRoots[index];
             root.mAddNesting++;
             // Update layout parameters.
             view.setLayoutParams(wparams);
             root.setLayoutParams(wparams, true);
             return;
         }
         // If this is a panel window, then find the window it is being
         // attached to for future reference.
         if (wparams.type >= android.view.WindowManagerClass.LayoutParams.FIRST_SUB_WINDOW &&
             wparams.type <= android.view.WindowManagerClass.LayoutParams.LAST_SUB_WINDOW)
         {
             int count = mViews != null ? mViews.Length : 0;
             {
                 for (int i = 0; i < count; i++)
                 {
                     if (mRoots[i].mWindow.asBinder() == wparams.token)
                     {
                         panelParentView = mViews[i];
                     }
                 }
             }
         }
         root             = new android.view.ViewRootImpl(view.getContext());
         root.mAddNesting = 1;
         if (cih == null)
         {
             root.mCompatibilityInfo = new android.view.CompatibilityInfoHolder();
         }
         else
         {
             root.mCompatibilityInfo = cih;
         }
         view.setLayoutParams(wparams);
         if (mViews == null)
         {
             index   = 1;
             mViews  = new android.view.View[1];
             mRoots  = new android.view.ViewRootImpl[1];
             mParams = new android.view.WindowManagerClass.LayoutParams[1];
         }
         else
         {
             index = mViews.Length + 1;
             object[] old = mViews;
             mViews = new android.view.View[index];
             System.Array.Copy(old, 0, mViews, 0, index - 1);
             old    = mRoots;
             mRoots = new android.view.ViewRootImpl[index];
             System.Array.Copy(old, 0, mRoots, 0, index - 1);
             old     = mParams;
             mParams = new android.view.WindowManagerClass.LayoutParams[index];
             System.Array.Copy(old, 0, mParams, 0, index - 1);
         }
         index--;
         mViews[index]  = view;
         mRoots[index]  = root;
         mParams[index] = wparams;
     }
     // do this last because it fires off messages to start doing things
     root.setView(view, wparams, panelParentView);
 }
Ejemplo n.º 12
0
 /// <summary>Translate the location of the sub window.</summary>
 /// <remarks>Translate the location of the sub window.</remarks>
 /// <param name="params"></param>
 public virtual void translateLayoutParamsInAppWindowToScreen(android.view.WindowManagerClass
                                                              .LayoutParams @params)
 {
     @params.scale(this.applicationScale);
 }
Ejemplo n.º 13
0
 public abstract int relayout(android.view.IWindow arg1, int arg2, android.view.WindowManagerClass
                              .LayoutParams arg3, int arg4, int arg5, int arg6, bool arg7, android.graphics.Rect
                              arg8, android.graphics.Rect arg9, android.graphics.Rect arg10, android.content.res.Configuration
                              arg11, android.view.Surface arg12);
Ejemplo n.º 14
0
 public abstract int addWithoutInputChannel(android.view.IWindow arg1, int arg2, android.view.WindowManagerClass
                                            .LayoutParams arg3, int arg4, android.graphics.Rect arg5);
Ejemplo n.º 15
0
 public virtual int addWithoutInputChannel(android.view.IWindow window, int seq, android.view.WindowManagerClass
                                           .LayoutParams attrs, int viewVisibility, android.graphics.Rect outContentInsets)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 16
0
		internal virtual void finishRemoveViewLocked(android.view.View view, int index)
		{
			int count = mViews.Length;
			// remove it from the list
			android.view.View[] tmpViews = new android.view.View[count - 1];
			removeItem(tmpViews, mViews, index);
			mViews = tmpViews;
			android.view.ViewRootImpl[] tmpRoots = new android.view.ViewRootImpl[count - 1];
			removeItem(tmpRoots, mRoots, index);
			mRoots = tmpRoots;
			android.view.WindowManagerClass.LayoutParams[] tmpParams = new android.view.WindowManagerClass
				.LayoutParams[count - 1];
			removeItem(tmpParams, mParams, index);
			mParams = tmpParams;
			if (view != null)
			{
				view.assignParent(null);
			}
		}