Search in sources :

Example 31 with Point

use of android.graphics.Point in project platform_frameworks_base by android.

the class IconHelper method setViewMode.

/**
     * Sets the current display mode.  This affects the thumbnail sizes that are loaded.
     * @param mode See {@link State.MODE_LIST} and {@link State.MODE_GRID}.
     */
public void setViewMode(@ViewMode int mode) {
    mMode = mode;
    int thumbSize = getThumbSize(mode);
    mThumbSize = new Point(thumbSize, thumbSize);
    mCache = DocumentsApplication.getThumbnailsCache(mContext, mThumbSize);
}
Also used : Point(android.graphics.Point) Point(android.graphics.Point)

Example 32 with Point

use of android.graphics.Point in project platform_frameworks_base by android.

the class Recents method dockTopTask.

@Override
public boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds, int metricsDockAction) {
    // recents
    if (!isUserSetup()) {
        return false;
    }
    Point realSize = new Point();
    if (initialBounds == null) {
        mContext.getSystemService(DisplayManager.class).getDisplay(Display.DEFAULT_DISPLAY).getRealSize(realSize);
        initialBounds = new Rect(0, 0, realSize.x, realSize.y);
    }
    int currentUser = sSystemServicesProxy.getCurrentUser();
    SystemServicesProxy ssp = Recents.getSystemServices();
    ActivityManager.RunningTaskInfo runningTask = ssp.getRunningTask();
    boolean screenPinningActive = ssp.isScreenPinningActive();
    boolean isRunningTaskInHomeStack = runningTask != null && SystemServicesProxy.isHomeStack(runningTask.stackId);
    if (runningTask != null && !isRunningTaskInHomeStack && !screenPinningActive) {
        logDockAttempt(mContext, runningTask.topActivity, runningTask.resizeMode);
        if (runningTask.isDockable) {
            if (metricsDockAction != -1) {
                MetricsLogger.action(mContext, metricsDockAction, runningTask.topActivity.flattenToShortString());
            }
            if (sSystemServicesProxy.isSystemUser(currentUser)) {
                mImpl.dockTopTask(runningTask.id, dragMode, stackCreateMode, initialBounds);
            } else {
                if (mSystemToUserCallbacks != null) {
                    IRecentsNonSystemUserCallbacks callbacks = mSystemToUserCallbacks.getNonSystemUserRecentsForUser(currentUser);
                    if (callbacks != null) {
                        try {
                            callbacks.dockTopTask(runningTask.id, dragMode, stackCreateMode, initialBounds);
                        } catch (RemoteException e) {
                            Log.e(TAG, "Callback failed", e);
                        }
                    } else {
                        Log.e(TAG, "No SystemUI callbacks found for user: " + currentUser);
                    }
                }
            }
            mDraggingInRecentsCurrentUser = currentUser;
            return true;
        } else {
            EventBus.getDefault().send(new ShowUserToastEvent(R.string.recents_incompatible_app_message, Toast.LENGTH_SHORT));
            return false;
        }
    } else {
        return false;
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) Rect(android.graphics.Rect) ShowUserToastEvent(com.android.systemui.recents.events.component.ShowUserToastEvent) Point(android.graphics.Point) ActivityManager(android.app.ActivityManager) RemoteException(android.os.RemoteException) Point(android.graphics.Point)

Example 33 with Point

use of android.graphics.Point in project platform_frameworks_base by android.

the class SystemServicesProxy method getDisplayRect.

/**
     * Returns the current display rect in the current display orientation.
     */
public Rect getDisplayRect() {
    Rect displayRect = new Rect();
    if (mDisplay == null)
        return displayRect;
    Point p = new Point();
    mDisplay.getRealSize(p);
    displayRect.set(0, 0, p.x, p.y);
    return displayRect;
}
Also used : Rect(android.graphics.Rect) Point(android.graphics.Point)

Example 34 with Point

use of android.graphics.Point in project platform_frameworks_base by android.

the class NavigationBarView method dump.

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(getCurrentView().getId()), getCurrentView().getWidth(), getCurrentView().getHeight(), visibilityToString(getCurrentView().getVisibility())));
    pw.println(String.format("      disabled=0x%08x vertical=%s menu=%s", mDisabledFlags, mVertical ? "true" : "false", mShowMenu ? "true" : "false"));
    dumpButton(pw, "back", getBackButton());
    dumpButton(pw, "home", getHomeButton());
    dumpButton(pw, "rcnt", getRecentsButton());
    dumpButton(pw, "menu", getMenuButton());
    pw.println("    }");
}
Also used : Rect(android.graphics.Rect) Point(android.graphics.Point)

Example 35 with Point

use of android.graphics.Point in project platform_frameworks_base by android.

the class UiDevice method dumpWindowHierarchy.

/**
     * Helper method used for debugging to dump the current window's layout hierarchy.
     * The file root location is /data/local/tmp
     *
     * @param fileName
     * @since API Level 16
     */
public void dumpWindowHierarchy(String fileName) {
    Tracer.trace(fileName);
    AccessibilityNodeInfo root = getAutomatorBridge().getQueryController().getAccessibilityRootNode();
    if (root != null) {
        Display display = getAutomatorBridge().getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        AccessibilityNodeInfoDumper.dumpWindowToFile(root, new File(new File(Environment.getDataDirectory(), "local/tmp"), fileName), display.getRotation(), size.x, size.y);
    }
}
Also used : AccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo) Point(android.graphics.Point) File(java.io.File) Display(android.view.Display)

Aggregations

Point (android.graphics.Point)1151 Display (android.view.Display)217 Rect (android.graphics.Rect)194 Paint (android.graphics.Paint)170 WindowManager (android.view.WindowManager)138 RemoteException (android.os.RemoteException)76 RectF (android.graphics.RectF)62 Bitmap (android.graphics.Bitmap)54 Resources (android.content.res.Resources)41 View (android.view.View)41 ArrayList (java.util.ArrayList)40 ImageView (android.widget.ImageView)37 Camera (android.hardware.Camera)36 Canvas (android.graphics.Canvas)31 Matrix (android.graphics.Matrix)29 Animator (android.animation.Animator)27 SuppressLint (android.annotation.SuppressLint)27 Configuration (android.content.res.Configuration)26 IOException (java.io.IOException)24 Message (android.os.Message)22