Esempio n. 1
0
 public void handleShow() {
   if (localLOGV)
     Log.v(TAG, "HANDLE SHOW: " + this + " mView=" + mView + " mNextView=" + mNextView);
   if (mView != mNextView) {
     // remove the old view if necessary
     handleHide();
     mView = mNextView;
     mWM = WindowManagerImpl.getDefault();
     final int gravity = mGravity;
     mParams.gravity = gravity;
     if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == Gravity.FILL_HORIZONTAL) {
       mParams.horizontalWeight = 1.0f;
     }
     if ((gravity & Gravity.VERTICAL_GRAVITY_MASK) == Gravity.FILL_VERTICAL) {
       mParams.verticalWeight = 1.0f;
     }
     mParams.x = mX;
     mParams.y = mY;
     mParams.verticalMargin = mVerticalMargin;
     mParams.horizontalMargin = mHorizontalMargin;
     if (mView.getParent() != null) {
       if (localLOGV) Log.v(TAG, "REMOVE! " + mView + " in " + this);
       mWM.removeView(mView);
     }
     if (localLOGV) Log.v(TAG, "ADD! " + mView + " in " + this);
     mWM.addView(mView, mParams);
     trySendAccessibilityEvent();
   }
 }
Esempio n. 2
0
  public WindowManager.LayoutParams getWmParams() {
    WindowManager.LayoutParams params = super.getWmParams();
    params.flags =
        WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
            | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
            | WindowManager.LayoutParams.FLAG_DIM_BEHIND;
    params.windowAnimations = android.R.style.Animation_Dialog;
    params.width = (int) (side * scale);
    params.height = (int) (side * scale);
    params.verticalMargin = 0.00f;
    params.dimAmount = .5f;

    return params;
  }
Esempio n. 3
0
 public void handleShow() {
   if (localLOGV)
     Log.v(TAG, "HANDLE SHOW: " + this + " mView=" + mView + " mNextView=" + mNextView);
   if (mView != mNextView) {
     // remove the old view if necessary
     handleHide();
     mView = mNextView;
     Context context = mView.getContext();
     if (context.getApplicationContext() != null) {
       // Use application context, except when called from system
       // service where there is no application context.
       context = context.getApplicationContext();
     }
     mWM = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
     // We can resolve the Gravity here by using the Locale for getting
     // the layout direction
     final Configuration config = mView.getContext().getResources().getConfiguration();
     final int gravity = Gravity.getAbsoluteGravity(mGravity, config.getLayoutDirection());
     mParams.gravity = gravity;
     if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == Gravity.FILL_HORIZONTAL) {
       mParams.horizontalWeight = 1.0f;
     }
     if ((gravity & Gravity.VERTICAL_GRAVITY_MASK) == Gravity.FILL_VERTICAL) {
       mParams.verticalWeight = 1.0f;
     }
     mParams.x = mX;
     mParams.y = mY;
     mParams.verticalMargin = mVerticalMargin;
     mParams.horizontalMargin = mHorizontalMargin;
     if (mView.getParent() != null) {
       if (localLOGV) Log.v(TAG, "REMOVE! " + mView + " in " + this);
       mWM.removeView(mView);
     }
     if (localLOGV) Log.v(TAG, "ADD! " + mView + " in " + this);
     mWM.addView(mView, mParams);
     trySendAccessibilityEvent();
   }
 }