public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    pw.println("NavigationBarView {");
    final Rect r = new Rect();
    final Point size = new Point();
    mDisplay.getRealSize(size);

    pw.println(
        String.format(
            "      this: "
                + PhoneStatusBar.viewInfo(this)
                + " "
                + visibilityToString(getVisibility())));

    getWindowVisibleDisplayFrame(r);
    final boolean offscreen = r.right > size.x || r.bottom > size.y;
    pw.println(
        "      window: "
            + r.toShortString()
            + " "
            + visibilityToString(getWindowVisibility())
            + (offscreen ? " OFFSCREEN!" : ""));

    pw.println(
        String.format(
            "      mCurrentView: id=%s (%dx%d) %s",
            getResourceName(mCurrentView.getId()),
            mCurrentView.getWidth(),
            mCurrentView.getHeight(),
            visibilityToString(mCurrentView.getVisibility())));

    pw.println(
        String.format(
            "      disabled=0x%08x vertical=%s hidden=%s low=%s menu=%s",
            mDisabledFlags,
            mVertical ? "true" : "false",
            mHidden ? "true" : "false",
            mLowProfile ? "true" : "false",
            mShowMenu ? "true" : "false"));

    final View back = mCurrentView.findViewWithTag("back");
    final View home = mCurrentView.findViewWithTag("home");
    final View recent = mCurrentView.findViewWithTag("recent");

    pw.println(
        "      back: "
            + PhoneStatusBar.viewInfo(back)
            + " "
            + visibilityToString(back.getVisibility()));
    pw.println(
        "      home: "
            + PhoneStatusBar.viewInfo(home)
            + " "
            + visibilityToString(home.getVisibility()));
    pw.println(
        "      rcnt: "
            + PhoneStatusBar.viewInfo(recent)
            + " "
            + visibilityToString(recent.getVisibility()));
    pw.println("    }");
  }
예제 #2
0
  public Point getAbsolutePosition(final Point point, final boolean boundsChecking)
      throws UiObjectNotFoundException, InvalidCoordinatesException {
    final Rect rect = el.getBounds();
    final Point pos = new Point();
    Logger.debug("Element bounds: " + rect.toShortString());

    if (point.x == 0) {
      pos.x = rect.width() * 0.5 + rect.left;
    } else if (point.x <= 1) {
      pos.x = rect.width() * point.x + rect.left;
    } else {
      pos.x = rect.left + point.x;
    }
    if (boundsChecking == true) {
      if (pos.x > rect.right || pos.x < rect.left) {
        throw new InvalidCoordinatesException(
            "X coordinate ("
                + pos.x.toString()
                + " is outside of element rect: "
                + rect.toShortString());
      }
    }

    if (point.y == 0) {
      pos.y = rect.height() * 0.5 + rect.top;
    } else if (point.y <= 1) {
      pos.y = rect.height() * point.y + rect.top;
    } else {
      pos.y = rect.left + point.y;
    }
    if (boundsChecking == true) {
      if (pos.y > rect.bottom || pos.y < rect.top) {
        throw new InvalidCoordinatesException(
            "Y coordinate ("
                + pos.y.toString()
                + " is outside of element rect: "
                + rect.toShortString());
      }
    }

    return pos;
  }
예제 #3
0
 protected void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args) {
   out.print(prefix);
   out.print("mInitializing=");
   out.print(mInitializing);
   out.print(" mDestroyed=");
   out.println(mDestroyed);
   out.print(prefix);
   out.print("mVisible=");
   out.print(mVisible);
   out.print(" mScreenOn=");
   out.print(mScreenOn);
   out.print(" mReportedVisible=");
   out.println(mReportedVisible);
   out.print(prefix);
   out.print("mCreated=");
   out.print(mCreated);
   out.print(" mSurfaceCreated=");
   out.print(mSurfaceCreated);
   out.print(" mIsCreating=");
   out.print(mIsCreating);
   out.print(" mDrawingAllowed=");
   out.println(mDrawingAllowed);
   out.print(prefix);
   out.print("mWidth=");
   out.print(mWidth);
   out.print(" mCurWidth=");
   out.print(mCurWidth);
   out.print(" mHeight=");
   out.print(mHeight);
   out.print(" mCurHeight=");
   out.println(mCurHeight);
   out.print(prefix);
   out.print("mType=");
   out.print(mType);
   out.print(" mWindowFlags=");
   out.print(mWindowFlags);
   out.print(" mCurWindowFlags=");
   out.println(mCurWindowFlags);
   out.print(" mWindowPrivateFlags=");
   out.print(mWindowPrivateFlags);
   out.print(" mCurWindowPrivateFlags=");
   out.println(mCurWindowPrivateFlags);
   out.print(prefix);
   out.print("mVisibleInsets=");
   out.print(mVisibleInsets.toShortString());
   out.print(" mWinFrame=");
   out.print(mWinFrame.toShortString());
   out.print(" mContentInsets=");
   out.println(mContentInsets.toShortString());
   out.print(prefix);
   out.print("mConfiguration=");
   out.println(mConfiguration);
   out.print(prefix);
   out.print("mLayout=");
   out.println(mLayout);
   synchronized (mLock) {
     out.print(prefix);
     out.print("mPendingXOffset=");
     out.print(mPendingXOffset);
     out.print(" mPendingXOffset=");
     out.println(mPendingXOffset);
     out.print(prefix);
     out.print("mPendingXOffsetStep=");
     out.print(mPendingXOffsetStep);
     out.print(" mPendingXOffsetStep=");
     out.println(mPendingXOffsetStep);
     out.print(prefix);
     out.print("mOffsetMessageEnqueued=");
     out.print(mOffsetMessageEnqueued);
     out.print(" mPendingSync=");
     out.println(mPendingSync);
     if (mPendingMove != null) {
       out.print(prefix);
       out.print("mPendingMove=");
       out.println(mPendingMove);
     }
   }
 }